| 命令 | gitleaks detect(历史/目录)、gitleaks protect(暂存区) |
|---|---|
| 配置 | .gitleaks.toml 自定义规则与 allowlist(抑制误报) |
| 输出 | JSON/SARIF,便于接入报告与门禁 |
CI 使用
CI 使用
gitleaks detect --source . --report-format sarif --report-path gitleaks.sarif --redact
gitleaks protect --staged --redact历史扫描发现条目要区分「真实凭据 / 示例占位符」:allowlist 精确到路径与规则。