Skip to main content

为存储库启用机密扫描

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

谁可以使用此功能?

Secret scanning 可用于以下存储库类型:

  • 公共存储库:Secret scanning 自动且免费地运行。
  •           **组织拥有的私有和内部存储库**:在 GitHub Secret Protection 或 GitHub Team 上启用 [GitHub Enterprise Cloud](/get-started/learning-about-github/about-github-advanced-security) 后可用。
    
  • 用户拥有的存储库:在 GitHub Enterprise Cloud 上可用,配合 Enterprise Managed Users。 当企业启用了 GitHub Enterprise Server 时,可在 GitHub Secret Protection 上使用。

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

可以为组织拥有的任何存储库启用用户机密扫描警报,并在使用GitHub Enterprise CloudEnterprise Managed Users时,为用户帐户拥有的存储库启用。

如果您是组织的拥有者,您可以使用security configurations同时为多个存储库启用secret scanning。 有关详细信息,请参阅“关于批量启用安全功能”。

如果组织由企业帐户拥有,企业所有者还可以在企业级别启用 secret scanning 。 有关详细信息,请参阅“为企业创建自定义安全配置”。

启用 用户机密扫描警报

启用存储库的 Secret Protection 后,用户机密扫描警报 会被启用。

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

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

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

  3. 在边栏的“Security”部分中,单击“ Advanced Security”****。

  4. 在“”Secret Protection右侧,单击“ 启用”。

  5. 查看启用 Secret Protection的影响,然后单击“ 启用 Secret Protection”。

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

后续步骤