Skip to main content

为存储库启用机密扫描

可以配置 GitHub 如何扫描存储库中遭到泄露的机密并生成警报。

谁可以使用此功能?

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 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. For more information, see "About secret scanning alerts" and "About GitHub Advanced Security."

For information about how you can try GitHub Enterprise with GitHub Advanced Security for free, see "Setting up a trial of GitHub Enterprise Cloud" and "Setting up a trial of GitHub Advanced Security" in the GitHub Enterprise Cloud documentation.

关于启用 用户的机密扫描警报

可以在你拥有的任何免费公共存储库上启用 用户的机密扫描警报。

如果你是组织所有者,则可以使用安全配置同时为多个存储库启用 secret scanning。 有关详细信息,请参阅“保护你的组织”。

启用 用户的机密扫描警报

  1. 在 GitHub.com 上,导航到存储库的主页。

  2. 在存储库名称下,单击 “设置”。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”********。

    存储库标头的屏幕截图,其中显示了选项卡。 “设置”选项卡以深橙色边框突出显示。

  3. 在边栏的“安全性”部分中,单击“ 代码安全性和分析”。

  4. 向下滚动到页面底部,为 secret scanning 单击“启用”。 如果你看到“禁用”按钮,则表示已为存储库启用 secret scanning。

    “代码安全和分析”页的“Secret scanning”部分的屏幕截图,其中“启用”按钮以深橙色边框突出显示。

存储库管理员可以选择随时为存储库禁用secret scanning。 有关详细信息,请参阅“管理存储库的安全和分析设置”。

后续步骤