Skip to main content

为存储库启用有效性检查

为存储库启用有效性检查有助于你确定警报修复的优先级,因为它会告知你机密是活跃的还是非活跃的。

谁可以使用此功能?

合作伙伴模式的有效性检查可用于以下存储库类型:

GHE.com 上的 具有数据驻留的 GitHub Enterprise Cloud 不支持针对合作伙伴模式的有效性检查。

在本文中

You can enable validity checks for individual repositories through repository settings. Validity checks verify whether detected secrets are still active, helping you prioritize remediation efforts. For information about what validity checks are and how they work, see About validity checks.

Enabling validity checks

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

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

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

  3. In the "Security" section of the sidebar, click Advanced Security.

  4. Under "Secret Protection", to the right of "Validity checks", click Enable.

  5. Scroll to the bottom of the page and click Save changes.

注意

You can also use the REST API to enable validity checks for partner patterns for your repository. For more information, see REST API endpoints for repositories.

Alternatively, organization owners and enterprise administrators can enable the feature for all repositories in the organization or enterprise. For more information on enabling at the organization-level, see Creating a custom security configuration. For more information on enabling at the enterprise-level, see Creating a custom security configuration for your enterprise.

Further reading