Secret scanning detection scope

Secret scanning uses pattern matching and validation to detect secrets. Detection varies based on pattern pairs, token types, and push protection settings.

Public monitoring scope

When public monitoring is enabled for your enterprise, secret scanning extends detection beyond repositories your enterprise owns. Public monitoring scans public repositories, including non-code content like pull request comments, across GitHub for secrets associated with your enterprise members or users with an email address matching your enterprise's verified domain.

Public monitoring alerts appear in the enterprise-level security overview, on the dedicated Public monitoring page. See Public monitoring for secret scanning.

Detection of pattern pairs

Secret scanning will only detect pattern pairs, such as AWS Access Keys and Secrets, if the ID and the secret are found in the same file, and both are pushed to the repository. Pair matching helps reduce false positives since both elements of a pair (the ID and the secret) must be used together to access the provider's resource.

Pairs pushed to different files, or not pushed to the same repository, will not result in alerts. For more information about the supported pattern pairs, see the table in Supported secret scanning patterns.

About legacy GitHub tokens

For GitHub tokens, we check the validity of the secret to determine whether the secret is active or inactive. This means that for legacy tokens, secret scanning won't detect a GitHub Enterprise Server personal access token on GitHub Enterprise Cloud. Similarly, a GitHub Enterprise Cloud personal access token won't be found on GitHub Enterprise Server.

Push protection limitations

If push protection did not detect a secret that you think should have been detected, then you should first check that push protection supports the secret type in the list of supported secrets. For further information, see Supported secret scanning patterns.

If your secret is in the supported list, there are various reasons why push protection may not detect it.