依赖安全审计技能,用于第三方依赖漏洞、容器镜像、Git 历史密钥泄露、SBOM 与供应链安全评估,并可为 CI/CD 配置安全门禁。
主要覆盖:Node.js(npm audit、pnpm audit、npx snyk test、pnpm outdated、npx npm-check-updates)、Java(./gradlew dependencyCheckAnalyze、Maven OWASP 插件、snyk test --all-projects)、Python(safety check、pip-audit、snyk test --file=requirements.txt)、容器镜像(trivy image、docker scout cves、grype)、Git 密钥(gitleaks detect --source .、gitleaks protect --staged、trufflehog git file://. --only-verified)、IaC(trivy config .、checkov -d .)。
CI 集成示例用 GitHub Actions:npm audit --audit-level=high、gitleaks/gitleaks-action@v2、aquasecurity/trivy-action@master(scan-type: fs,severity: HIGH,CRITICAL,exit-code: 1)。配套模板为 templates/dependency-audit-template.md。
处理策略:先判断是否影响生产,有补丁立即升级,无补丁评估替代库或缓解,误报加入忽略清单并备注原因;SLA 为 CRITICAL 24 小时、HIGH 7 天、MEDIUM 下个迭代、LOW 评估后决定。
限制与注意:npm audit 可能报出大量漏洞,多来自 devDependencies;强制 npm audit fix 可能引入破坏性升级;不要忽略间接依赖;密钥已提交后需重写 Git 历史;容器避免使用 latest;建议生成 SBOM。该技能与 web-vulnerability、auth-security-audit、reverse-pentest 分工不同,DAST、认证授权审计与渗透测试不在其范围内。