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 上使用。

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

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

可以为组织拥有的任何存储库启用 Enterprise Managed Users。

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

启用 用户机密扫描警报

为仓库启用 用户机密扫描警报 时,将启用 Secret Protection。

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

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

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

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

  4. 在“Secret Protection”右侧,单击“Enable”****。

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

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

后续步骤