Skip to main content

使用机密扫描和推送保护

通过阻止包含令牌和其他机密的推送来避免泄露敏感数据。

谁可以使用此功能?

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

Remediating a leaked secret in your repository

Learn how to respond effectively to a leaked secret in your GitHub repository.

用户的推送保护

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

从命令行使用推送保护

Avoid leaking sensitive data by blocking pushes containing tokens and other secrets.

从 REST API 使用推送保护

了解当 secret scanning 在 API 请求的内容中检测到机密时使用 REST API 取消阻止到 GitHub 的推送的选项。

使用 GitHub UI 中的推送保护

了解 secret scanning 在更改中检测到机密时取消阻止提交的选项。

Working with push protection and the GitHub MCP server

Learn how you are protected from leaking secrets during interactions with the GitHub MCP server, and how to bypass a push protection block if you need to.