| 工具 | gitleaks / trufflehog 等 |
|---|---|
| 扫描对象 | 工作区、暂存区、git 历史 |
| 处置 | 轮换凭据 → 清理历史 → 复盘流程 |
gitleaks 常用命令
gitleaks 常用命令
gitleaks detect --source .
gitleaks protect --staged
# CI 中全历史扫描
gitleaks detect --source . --log-opts="--all"发现真实凭据后:先吊销/轮换,再清理历史;只删当前文件、历史里仍可复原。
把密钥泄漏拦在提交与推送阶段:gitleaks 扫描工作区与 git 历史,检测 AWS 密钥、私钥、Token 等模式;发现泄漏须轮换凭据并清理历史,仅删文件不算处置。
| 工具 | gitleaks / trufflehog 等 |
|---|---|
| 扫描对象 | 工作区、暂存区、git 历史 |
| 处置 | 轮换凭据 → 清理历史 → 复盘流程 |
gitleaks detect --source .
gitleaks protect --staged
# CI 中全历史扫描
gitleaks detect --source . --log-opts="--all"