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 Alertes d’analyse de secrets that were created using the previous version of the pattern.
-
Accédez à l’emplacement où le modèle personnalisé a été créé. Un modèle personnalisé peut être créé dans un compte d’organisation ou d’entreprise ou dans un dépôt.
- Pour un référentiel ou une organisation, affichez les paramètres « Advanced Security » du référentiel ou de l’organisation où le modèle personnalisé a été créé. Pour plus d’informations, consultez Définition d’un modèle personnalisé pour un référentiel ou Définition d’un modèle personnalisé pour une organisation.
- Pour une entreprise, sous « Stratégies », affichez la zone « Advanced Security », puis cliquez sur Fonctionnalités de sécurité. Pour plus d’informations, consultez Définition d’un modèle personnalisé pour un compte d’entreprise.
-
Under "Custom patterns", to the right of the custom pattern you want to edit, click .
-
When you're ready to test your edited custom pattern, to identify matches without creating alerts, click Save and dry run.
-
When you have reviewed and tested your changes, click Publish changes.
-
Vous pouvez éventuellement activer la protection des poussées (push) pour votre modèle personnalisé, en cliquant sur Activer.
Remarque
- La protection des envois (push) pour les modèles personnalisés s’applique uniquement aux référentiels sur lesquels l’secret scanning est activée comme protection des envois (push). Pour plus d’informations sur l’activation de la protection d’envoi (push), consultez À propos de la protection push.
- L’activation de la protection des envois (push) pour les modèles personnalisés courants peut entraîner des perturbations pour les contributeurs.

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

Removing a custom pattern
When you remove a custom pattern, GitHub gives you the option to close the Alertes d’analyse de secrets relating to the pattern, or keep these alerts.
- Accédez à l’emplacement où le modèle personnalisé a été créé. Un modèle personnalisé peut être créé dans un compte d’organisation ou d’entreprise ou dans un dépôt.
- Pour un référentiel ou une organisation, affichez les paramètres « Advanced Security » du référentiel ou de l’organisation où le modèle personnalisé a été créé. Pour plus d’informations, consultez Définition d’un modèle personnalisé pour un référentiel ou Définition d’un modèle personnalisé pour une organisation.
- Pour une entreprise, sous « Stratégies », affichez la zone « Advanced Security », puis cliquez sur Fonctionnalités de sécurité. Pour plus d’informations, consultez Définition d’un modèle personnalisé pour un compte d’entreprise.
- To the right of the custom pattern you want to remove, click .
- Review the confirmation, and select a method for dealing with any open alerts relating to the custom pattern.
- 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
Remarque
- Pour rendre possible la protection des envois (push) dans le cadre des modèles personnalisés, l’secret scanning doit être activée comme protection des envois (push) au niveau de l’entreprise. Pour plus d’informations, consultez « À propos de la protection push ».
- L’activation de la protection des envois (push) pour les modèles personnalisés courants peut entraîner des perturbations pour les contributeurs.
Before enabling push protection for a custom pattern at enterprise level, you must also test your custom patterns using dry runs. Vous pouvez uniquement effectuer un essai à blanc sur les dépôts auxquels vous bénéficiez d’un accès administrateur. Si un propriétaire d’entreprise souhaite pouvoir effectuer des essais à blanc sur n’importe quel dépôt d’une organisation, le rôle propriétaire d’organisation doit lui être attribué. Pour plus d’informations, consultez « Gestion de votre rôle dans une organisation appartenant à votre entreprise ».
-
En haut de la page, cliquez sur Stratégies.
-
Sous » Politiques », cliquez sur Advanced Security.
-
Under "Advanced Security", click Security features.
-
Sous « Secret scanning », sous « Modèles personnalisés », cliquez sur pour le modèle qui vous intéresse.
Remarque
At the enterprise level, you can only edit and enable push protection for custom patterns that you created.
-
To enable push protection for your custom pattern, scroll down to "Push Protection", and click Enable.
Remarque
L'option permettant d'activer la protection push n'est visible que pour les modèles publiés.

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 Gestion des paramètres de sécurité et d'analyse pour votre organisation.
-
Dans le coin supérieur droit de GitHub, cliquez sur votre photo de profil, puis sur Vos organisations.
-
En regard de l’organisation, cliquez sur Paramètres.
-
In the "Security" section of the sidebar, select the Advanced Security dropdown menu, then click Global settings.
-
Under "Custom patterns", click for the pattern of interest.
-
To enable push protection for your custom pattern, scroll down to "Push Protection", and click Enable.
Remarque
- L'option permettant d'activer la protection push n'est visible que pour les modèles publiés.
- La protection des envois (push) pour les modèles personnalisés s’applique uniquement aux référentiels de l’organisation sur lesquels l’secret scanning est activée comme protection des envois (push). Pour plus d’informations, consultez « À propos de la protection push ».
- L’activation de la protection des envois (push) pour les modèles personnalisés courants peut entraîner des perturbations pour les contributeurs.

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.
-
Sur GitHub, accédez à la page principale du référentiel.
-
Sous le nom de votre référentiel, cliquez sur Paramètres. Si vous ne voyez pas l’onglet « Paramètres », sélectionnez le menu déroulant , puis cliquez sur Paramètres.

-
Dans la section « Sécurité » de la barre latérale, cliquez sur Advanced Security.
-
Under "Secret Protection", under "Custom patterns", click for the pattern of interest.
-
To enable push protection for your custom pattern, scroll down to "Push Protection", and click Enable.
Remarque
L'option permettant d'activer la protection push n'est visible que pour les modèles publiés.
