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" 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.

关于机密扫描

GitHub 扫描仓库查找已知的密码类型,以防止欺诈性使用意外提交的密码。

密码扫描合作伙伴计划

作为服务提供者,您可以与 GitHub 合作,通过密码扫描保护您的密码令牌格式,该扫描将搜索意外提交的密码格式,并且可以发送到服务提供者的验证端点。

为存储库配置机密扫描

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

关于如何使用 AI 生成正则表达式

可以使用 正则表达式生成器 为每个模式生成一个或多个正则表达式,从而定义自己的自定义模式,扩展 secret scanning 的功能。

管理来自机密扫描的警报

您可以查看、评估和解析已签入存储库的机密的警报。

机密扫描模式

支持的机密列表和 GitHub 与之合作的合作伙伴,以防止欺诈性使用意外提交的机密。

关于使用机密扫描检测通用机密

了解 secret scanning 如何使用 AI 扫描和创建非结构化机密(例如密码)的警报。

存储库和组织的推送保护

通过对存储库和组织的推送保护,secret scanning 会阻止参与者将机密推送到存储库,并在参与者绕过该阻止时生成警报。

用户的推送保护

通过用户的推送保护,你将自动受到跨 GitHub 向公共存储库的所有推送的保护。

使用推送保护

推送保护通过阻止包含机密的推送,主动保护你免受存储库中的泄露机密的威胁。 若要推送包含机密的提交,必须指定绕过阻止的原因。

推送受推送保护阻止的分支

推送保护可主动防止存储库中的机密泄露。 可以解析阻止的推送,在删除检测到的机密后,可以从命令行或 Web UI 将更改推送到工作分支。

排查机密扫描问题

如果在 secret scanning 方面遇到问题,可以使用以下提示来帮助解决问题。