SuperAPI AI 工具集

security-leak-guardrails

安全与审计

查看项目

更新于 10-15 22:38

技能介绍

用途:为代码仓库建立防止密钥进入 git 并持续扫描泄露的工作流。主要能力包括:清点现有安全工具(gitleaks/trufflehog、hooks、workflows、dependabot);添加禁止路径检查与 hook 脚本;添加 gitleaks 配置和本地安全检查脚本;添加 CI 密钥扫描与 Dependabot;更新 .gitignore 并记录策略。使用方式按步骤进行:先清点现有 .gitleaks.toml、.github/workflows/secret、dependabot.yml 与 hook 工具,若已有 husky/lefthook/pre-commit 则集成而非替换;添加 .forbidden-paths.regex 并保持严格,添加 scripts/hooks/block-forbidden-staged-files.mjs,Node 项目可加 lefthook.yml 与 prepare 脚本;添加 .gitleaks.toml,仅对测试夹具使用基于路径的允许列表;添加 scripts/secleak-check.sh,Node 项目在 package.json 加 security:check 与 security:hooks;添加运行 TruffleHog(diff 与全历史)和 Gitleaks 的 CI 工作流,按 SHA 固定 action 并对 TruffleHog 使用 --only-verified;添加 npm 与 GitHub Actions 的 dependabot.yml;在 .gitignore 加入运行时目录与凭据模式。验证命令:node scripts/hooks/block-forbidden-staged-files.mjs;gitleaks git --no-banner --redact=100 --config .gitleaks.toml .;trivy fs --scanners secret,misconfig --exit-code 1 .。限制:资料未提供具体收费、平台支持范围或效果保证,需按仓库实际情况调整。