Skip to main content

Managing custom patterns

You can view, edit, and remove custom patterns, as well as enable push protection for custom patterns.

Wer kann dieses Feature verwenden?

Repositorybesitzer, Organisationsbesitzer, Sicherheitsmanager, Unternehmensadministratoren und Benutzer mit der Administratorrolle

Custom patterns are user-defined patterns that you can use to identify secrets that are not detected by the default patterns supported by secret scanning. For more information, see Defining custom patterns for secret scanning.

At the enterprise level, only the creator of a custom pattern can edit the pattern, and use it in a dry run. There are no similar restrictions for editing custom patterns at repository and organization level.

Editing a custom pattern

When you save a change to a custom pattern, this closes all the Warnungen zur Geheimnisüberprüfung that were created using the previous version of the pattern.

  1. Navigiere zu der Stelle, an der das benutzerdefinierte Muster erstellt wurde. Ein benutzerdefiniertes Muster kann in einem Repository, einer Organisation oder einem Unternehmenskonto erstellt werden.

  2. Under "Custom patterns", to the right of the custom pattern you want to edit, click .

  3. When you're ready to test your edited custom pattern, to identify matches without creating alerts, click Save and dry run.

  4. When you have reviewed and tested your changes, click Publish changes.

  5. Klicke optional auf Aktivieren, um den Pushschutz für dein benutzerdefiniertes Muster zu aktivieren.

    Hinweis

    • Der Pushschutz für benutzerdefinierte Muster wird nur auf Repositorys angewendet, bei denen die secret scanning als Pushschutz aktiviert ist. Weitere Informationen zum Aktivieren des Pushschutzes findest du unter Push protection.
    • Die Aktivierung des Pushschutzes für häufig vorkommende benutzerdefinierte Muster kann für Mitwirkende störend sein.

    Screenshot: Seite eines benutzerdefinierten Musters mit hervorgehobener Schaltfläche zum Aktivieren des Pushschutzes

  6. Optionally, to disable push protection for your custom pattern, click Disable.

    Screenshot of the custom pattern page with the button to disable push protection highlighted with a dark orange outline.

Removing a custom pattern

When you remove a custom pattern, GitHub gives you the option to close the Warnungen zur Geheimnisüberprüfung relating to the pattern, or keep these alerts.

  1. Navigiere zu der Stelle, an der das benutzerdefinierte Muster erstellt wurde. Ein benutzerdefiniertes Muster kann in einem Repository, einer Organisation oder einem Unternehmenskonto erstellt werden.
  2. To the right of the custom pattern you want to remove, click .
  3. Review the confirmation, and select a method for dealing with any open alerts relating to the custom pattern.
  4. Click Yes, delete this pattern.

If you choose to close the alerts when removing a custom pattern, you need to be aware that the deletion process happens asynchronously in the background. For custom patterns that have generated a high volume of alerts (thousands or more), the deletion process may take several minutes to hours to complete. You can continue working while the process completes.

Enabling push protection for a custom pattern

You can enable secret scanning as a push protection for custom patterns stored at the enterprise, organization, or repository level.

Enabling push protection for a custom pattern stored in an enterprise

Hinweis

  • Um den Pushschutz für benutzerdefinierte Muster zu ermöglichen, muss der secret scanning als Pushschutz auf Unternehmensebene aktiviert werden.
  • Die Aktivierung des Pushschutzes für häufig vorkommende benutzerdefinierte Muster kann für Mitwirkende störend sein.

Before enabling push protection for a custom pattern at enterprise level, you must also test your custom patterns using dry runs. Du kannst einen Testlauf nur für Repositorys ausführen, auf die du Administratorzugriff hast. Unternehmensbesitzer*innen, die Zugriff zum Ausführen von Testläufen für ein Repository in einer Organisation wünschen, muss die Rolle „Organisationsbesitzer“ zugewiesen sein. Weitere Informationen finden Sie unter Verwalten deiner Rolle in einer Organisation, die deinem Unternehmen gehört.

  1. Navigieren Sie zu Ihrem Unternehmen. Beispielsweise auf der Seite Unternehmen in GitHub.com.

  2. Klicke oben auf der Seite auf Policies.

  3. Klicke unter „Policies“ auf Advanced SecurityCode security.

  4. Under "Advanced SecurityCode security", click Security features.

  5. Klicke unter „Secret scanning“ und „Benutzerdefinierte Muster“ bei dem Muster, das du bearbeiten möchtest, auf .

    Hinweis

    At the enterprise level, you can only edit and enable push protection for custom patterns that you created.

  6. To enable push protection for your custom pattern, scroll down to "Push Protection", and click Enable.

    Hinweis

    Die Option zum Aktivieren des Pushschutzes ist nur für veröffentlichte Muster sichtbar.

    Screenshot of the custom pattern page with the button to enable push protection highlighted with a dark orange outline.

Enabling secret scanning as a push protection in an organization for a custom pattern

Before enabling push protection for a custom pattern at organization level, you must ensure that you enable secret scanning for the repositories that you want to scan in your organization. To enable secret scanning on all repositories in your organization, see Verwalten von Sicherheits- und Analyseeinstellungen für deine Organisation.

  1. Klicke in der rechten oberen Ecke von GitHub auf dein Profilbild und dann auf Your organizations.

  2. Wählen Sie eine Organisation aus, indem Sie darauf klicken.

  3. Klicke unter dem Organisationsnamen auf Settings. Wenn die Registerkarte „Einstellungen“ nicht angezeigt wird, wähle im Dropdownmenü die Option Einstellungen aus.

    Screenshot der Registerkarten im Profil einer Organisation. Die Registerkarte „Einstellungen“ ist dunkelorange umrandet.

  4. In the "Security" section of the sidebar, select the Advanced Security dropdown menu, then click Global settings.

  5. Under "Custom patterns", click for the pattern of interest.

  6. To enable push protection for your custom pattern, scroll down to "Push Protection", and click Enable.

    Hinweis

    • Die Option zum Aktivieren des Pushschutzes ist nur für veröffentlichte Muster sichtbar.
    • Der Pushschutz für benutzerdefinierte Muster wird nur auf Repositorys in deiner Organisation angewendet, bei denen die secret scanning als Pushschutz aktiviert ist.
    • Die Aktivierung des Pushschutzes für häufig vorkommende benutzerdefinierte Muster kann für Mitwirkende störend sein.

    Screenshot of the "Push protection" section of the custom pattern page. A button, labeled "Enable", is outlined in dark orange.

Enabling secret scanning as a push protection in a repository for a custom pattern

Before enabling push protection for a custom pattern at repository level, you must define the custom pattern for the repository, and test it in the repository. For more information, see Defining custom patterns for secret scanning.

  1. Navigieren Sie auf GitHub zur Hauptseite des Repositorys.

  2. Klicke unter dem Repositorynamen auf Settings. Wenn die Registerkarte „Einstellungen“ nicht angezeigt wird, wähle im Dropdownmenü die Option Einstellungen aus.

    Screenshot eines Repositoryheaders mit den Registerkarten. Die Registerkarte „Einstellungen“ ist dunkelorange umrandet.

  3. Klicke im Abschnitt „Security“ der Randleiste auf Advanced Security.

  4. Under "Secret Protection", under "Custom patterns", click for the pattern of interest.

  5. To enable push protection for your custom pattern, scroll down to "Push Protection", and click Enable.

    Hinweis

    Die Option zum Aktivieren des Pushschutzes ist nur für veröffentlichte Muster sichtbar.

    Screenshot of the "Push protection" section of the custom pattern page. A button, labeled "Enable", is outlined in dark orange.