Learn about the different types of secret scanning alerts.
There are three types of secret scanning alerts:
When you enable secret scanning for a repository or push commits to a repository with secret scanning enabled, GitHub scans the contents for secrets that match patterns defined by service providers.
When secret scanning detects a secret, GitHub generates an alert. GitHub displays an alert in the Security and quality tab of the repository. If the same secret appears multiple times within a single file, only one alert is created.
To help you triage alerts more effectively, GitHub separates alerts into two lists:
The default alerts list displays alerts that relate to supported patterns and specified custom patterns. This is the main view for alerts.
The generic alerts list displays alerts that relate to generic secrets detected with patterns and deterministic methods (such as private keys), as well as secrets detected with AI (such as passwords). These types of alerts can have a higher rate of false positives or secrets used in tests. You can toggle to the generic alerts list from the default alerts list.
GitHub will continue to release new patterns and secret types to the generic alerts list.
In addition, alerts that fall into this category:
For GitHub to scan for generic patterns and AI-detected secrets, you must first enable the features for your repository or organization. For more information, see Enabling secret scanning for generic patterns and Enabling generic secret detection for AI-detected secrets.
If access to a resource requires paired credentials, then secret scanning will create an alert only when both parts of the pair are detected in the same file. This ensures that the most critical leaks are not hidden behind information about partial leaks. Pair matching also helps reduce false positives since both elements of a pair must be used together to access the provider's resource.
Push protection scans pushes for supported secrets. If push protection detects a supported secret, it will block the push. When a contributor bypasses push protection to push a secret to the repository, a push protection alert is generated and displayed in the Security and quality tab of the repository. To see all push protection alerts for a repository, you must filter by bypassed: true on the alerts page. For more information, see Viewing and filtering alerts from secret scanning.
If access to a resource requires paired credentials, then secret scanning will create an alert only when both parts of the pair are detected in the same file. This ensures that the most critical leaks are not hidden behind information about partial leaks. Pair matching also helps reduce false positives since both elements of a pair must be used together to access the provider's resource.
Note
You can also enable push protection for your personal account, called "push protection for users", which prevents you from accidentally pushing supported secrets to any public repository. Alerts are not created if you choose to bypass your user-based push protection only. Alerts are only created if the repository itself has push protection enabled. For more information, see Managing push protection for users.
Older versions of certain tokens may not be supported by push protection as these tokens may generate a higher number of false positives than their most recent version. Push protection may also not apply to legacy tokens. For tokens such as Azure Storage Keys, GitHub only supports recently created tokens, not tokens that match the legacy patterns. For more information about push protection limitations, see Secret scanning detection scope.
When GitHub detects a leaked secret in a public repository or npm package, an alert is sent directly to the secret provider, if they are part of GitHub's secret scanning partner program. For more information about secret scanning alerts for partners, see Secret scanning partner program and Supported secret scanning patterns.
Partner alerts are not sent to repository administrators, so you do not need to take any action for this type of alert.