运行时依赖
无特殊依赖
安装命令
点击复制官方npx clawhub@latest install secret-detector
镜像加速npx clawhub@latest install secret-detector --registry https://cn.longxiaskill.com镜像同步中
技能文档
Secrets Scanner 概览 扫描仓库中意外提交的密钥与 API Key。
何时使用 用户提出“scan for secrets”或“security audit” 提交或推送前的安全检查
检测模式 AWS Key: AKIA[0-9A-Z]{16} GitHub Token: ghp_[a-zA-Z0-9]{36} Generic API Key: api[_-]?key.[a-zA-Z0-9]{20,} Private Key: -----BEGIN (RSA|DSA|EC) PRIVATE KEY----- Password in URL: ://[^@]+:.@ Slack Token: xox[baprs]-[0-9]{10,13}-[0-9]{10,13}
命令 Windows: Select-String -Path . -Include .js,.py -Recurse -Pattern "ghp_[a-zA-Z0-9]{36}"
Linux/macOS: grep -rE "ghp_[a-zA-Z0-9]{36}|AKIA[0-9A-Z]{16}" --include=".js" --include=".py" .
预防 加入 .gitignore: .env .key credentials. secrets. .pem