Skip to main content

Resolving alerts from secret scanning

After reviewing the details of a secret scanning alert, you should fix and then close the alert.

Who can use this feature?

People with admin access to a repository can dismiss secret scanning alerts for the repository.

Secret scanning alerts for partners runs automatically on public repositories and public npm packages to notify service providers about leaked secrets on GitHub.

Secret scanning alerts for users are available for user-owned public repositories for free. Organizations using GitHub Enterprise Cloud with a license for GitHub Advanced Security can also enable secret scanning alerts for users on their private and internal repositories. Additionally, secret scanning alerts for users are available and in beta on user-owned repositories for GitHub Enterprise Cloud with Enterprise Managed Users. For more information, see "About secret scanning alerts" and "About GitHub Advanced Security."

For information about how you can try GitHub Advanced Security for free, see "Setting up a trial of GitHub Advanced Security."

Fixing alerts

Once a secret has been committed to a repository, you should consider the secret compromised. GitHub recommends the following actions for compromised secrets:

  • For a compromised GitHub personal access token, delete the compromised token, create a new token, and update any services that use the old token. For more information, see "Managing your personal access tokens."
  • For all other secrets, first verify that the secret committed to GitHub Enterprise Cloud is valid. If so, create a new secret, update any services that use the old secret, and then delete the old secret.

Note

If a secret is detected in a public repository on GitHub and the secret also matches a partner pattern, an alert is generated and the potential secret is reported to the service provider. For details of partner patterns, see "Supported secret scanning patterns."

Closing alerts

Note

Secret scanning doesn't automatically close alerts when the corresponding token has been removed from the repository. You must manually close these alerts in the alert list on GitHub.

  1. On GitHub, navigate to the main page of the repository.

  2. Under the repository name, click Security. If you cannot see the "Security" tab, select the dropdown menu, and then click Security.

    Screenshot of a repository header showing the tabs. The "Security" tab is highlighted by a dark orange outline.

  3. In the left sidebar, under "Vulnerability alerts", click Secret scanning.

  4. Under "Secret scanning", click the alert you want to view.

  5. To dismiss an alert, select the "Close as" dropdown menu and click a reason for resolving an alert.

    Screenshot of a secret scanning alert. A dropdown menu, titled "Close as", is expanded and highlighted in a dark orange outline.

  6. Optionally, in the "Comment" field, add a dismissal comment. The dismissal comment will be added to the alert timeline and can be used as justification during auditing and reporting. You can view the history of all dismissed alerts and dismissal comments in the alert timeline. You can also retrieve or set a comment by using the Secret scanning API. The comment is contained in the resolution_comment field. For more information, see "REST API endpoints for secret scanning" in the REST API documentation.

  7. Click Close alert.

Next steps