AGENT SKILL
common-security-audit
Adversarial security probing and vulnerability assessments across Node, Go, Dart, Java, Python, and Rust. (triggers: package.json, go.mod, pubspec.yaml, pom.xml, Dockerfile, security audit, vulnerability scan, secrets detection, injection probe, pentest)
- License 许可
- MIT
- 最近更新
- 2026-06-24
- Stars
- ★ 67
- Forks
- 24
01 前言 Front Matter
- name
- common-security-audit
- description
- Adversarial security probing and vulnerability assessments across Node, Go, Dart, Java, Python, and Rust. (triggers: package.json, go.mod, pubspec.yaml, pom.xml, Dockerfile, security audit, vulnerability scan, secrets detection, injection probe, pentest)
02 资源文件 34
- 参考文档references/agent_skill_roots_contract.md2.5 KB
- 参考文档references/agents/prompt_templates/modes/code.md3.8 KB
- 参考文档references/agents/prompt_templates/review_base.md4.3 KB
- 参考文档references/clean_code_checklist.md2.3 KB
- 参考文档references/coordinator_runtime_contract.md2.6 KB
- 参考文档references/coordinator_summary_contract.md1009 B
- 参考文档references/environment_state_contract.md2.3 KB
- 参考文档references/git_scope_detection.md2.4 KB
- 参考文档references/git_worktree_fallback.md2.9 KB
- 参考文档references/input_resolution_pattern.md1.9 KB
- 参考文档references/loop_health_contract.md2.4 KB
- 参考文档references/meta_analysis_protocol.md1.5 KB
- 参考文档references/minimum_quality_checks.md2.5 KB
- 脚本references/scripts/coordinator-runtime/lib/artifacts.mjs2.4 KB
- 脚本references/scripts/coordinator-runtime/lib/cli-helpers.mjs3.5 KB
- 脚本references/scripts/coordinator-runtime/lib/core.mjs18.6 KB
- 脚本references/scripts/coordinator-runtime/lib/loop-health.mjs7.5 KB
- 脚本references/scripts/coordinator-runtime/lib/runtime-constants.mjs3.8 KB
- 脚本references/scripts/coordinator-runtime/lib/schemas.mjs37.2 KB
- 脚本references/scripts/coordinator-runtime/lib/validate.mjs4.8 KB
- 脚本references/scripts/quality-runtime/cli.mjs7.6 KB
- 脚本references/scripts/quality-runtime/lib/guards.mjs4.2 KB
- 脚本references/scripts/quality-runtime/lib/phases.mjs752 B
- 脚本references/scripts/quality-runtime/lib/store.mjs3.3 KB
- 脚本references/scripts/story-gate-runtime/cli.mjs9.2 KB
- 脚本references/scripts/story-gate-runtime/lib/guards.mjs5.4 KB
- 脚本references/scripts/story-gate-runtime/lib/phases.mjs712 B
- 脚本references/scripts/story-gate-runtime/lib/store.mjs5.7 KB
- 脚本references/scripts/test-planning-runtime/cli.mjs7.5 KB
- 脚本references/scripts/test-planning-runtime/lib/guards.mjs3.8 KB
- 脚本references/scripts/test-planning-runtime/lib/phases.mjs629 B
- 脚本references/scripts/test-planning-runtime/lib/store.mjs3.7 KB
- 参考文档references/storage_mode_detection.md2.0 KB
- 参考文档references/story_gate_runtime_contract.md3.9 KB
03 SKILL.md 正文
Security Audit
Priority: P0 (CRITICAL)
? Security Probing Protocol
1. Hardcoded Secrets (Critical)
Scan for plain-text keys, passwords, and tokens in code.
grep -riE "(password|apiKey|api_key|secret|private_key|token)\s*=\s*['\"][^'\"]{6,}" \
. --exclude-dir={node_modules,dist,build,.git} -l
2. Data Leakage in Logs (PII/Secrets)
Identify sensitive info printed to logs or stdout.
- Node/TS:
grep -rE "console\.(log|error|warn)" . --include="*.ts" --include="*.js" | grep -iE "password|token|secret|private" - Go:
grep -rE "log\.(Print|Printf|Println|Fatal)" . --include="*.go" | grep -iE "password|token|secret" - Dart/Flutter:
grep -rE "print\(|debugPrint\(" . --include="*.dart" | grep -iE "password|token|secret" - Java/Spring:
grep -rE "log(ger)?\.(info|debug|warn|error)" . --include="*.java" | grep -iE "password|token|secret"
3. Injection Surface (SQL / Command)
Detect raw string concatenation in queries or system commands.
grep -rE "\+.*SELECT|\+.*INSERT|\+.*UPDATE|\+.*DELETE|query\(.*\+|fmt\.Sprintf.*SELECT" \
. --include="*.ts" --include="*.js" --include="*.go" --include="*.java" --include="*.py"
4. Auth Coverage vs Exposure
Compare total routes vs protected endpoints.
- NestJS:
total=$(grep -r "@(Get|Post|Put|Delete|Patch)" . | wc -l); guarded=$(grep -r "@(UseGuards|Auth)" . | wc -l) - Spring:
total=$(grep -r "@(GetMapping|PostMapping|PutMapping)" . | wc -l); guarded=$(grep -r "@(PreAuthorize|Secured)" . | wc -l) - Go:
total=$(grep -rE "(GET|POST|PUT|DELETE)" . | wc -l); guarded=$(grep -rE "(middleware|auth|jwt|guard)" . | wc -l)
5. Dependency Audit (CVE Scan)
- Node:
npm audit --audit-level=high - Dart/Flutter:
dart pub outdated --json - Go:
go list -m -u all | grep "\[" - Java:
mvn dependency:listor./gradlew dependencies - Python:
pip-audit - Rust:
cargo audit
6. Infrastructure Hardening
grep -rE "^FROM .+:latest|^USER root|curl.*sh.*|ADD http" . --include="Dockerfile"
⚖️ Scoring Impact
| Finding | Threshold | Severity | Deduction |
|---|---|---|---|
| Hardcoded Secrets | Any match | ? P0 | -25 |
| Plain-text PII in Logs | Any match | ? P0 | -20 |
| Unguarded Routes > 20% | > 0.2 | ? P0 | -15 |
| Raw SQL Concatenation | Any match | ? P1 | -10 |
| Response Leakage (Stack) | > 0 | ? P1 | -10 |
[!CAUTION] A ? P0 finding immediately caps the Security score at 40/100.
? Reference Links
? Anti-Patterns
- Do NOT use standard patterns if specific project rules exist.
- Do NOT ignore error handling or edge cases.