Security Audit
Use this skill to drive a thorough, evidence-first security review of a workspace. Prefer automated signals over eyeballing.
When to use
- The user asks "audit this repo", "find vulnerabilities", "security review".
- Before shipping code that handles external input, secrets, or serialization.
- As the analysis step of
/code-reviewwhen the security persona is active.
Workflow
Static SAST with semgrep. Produce SARIF so the reviewer can normalize it into
security_issues:semgrep --config auto --sarif --output semgrep.sarif .If
semgrepis unavailable, fall back to the bundled rule presets and the static analyzer's taint engine. Never claim a clean bill of health you didn't actually verify.Dependency / OSV scan. Parse the lockfile (
Cargo.lock,package-lock.json) and cross-check against the OSV advisory database; prune to reachable dependencies only.Gadget-chain & knowledge-base check. Enumerate attack surface: which known gadget chains (Log4Shell, C3P0, Commons-Collections, Fastjson autoType) are satisfiable given the resolved dependencies.
Taint review. For each source→sink path the analyzer reports, confirm the evidence chain and whether a sanitizer (strong or partial) breaks it.
Report. Emit one
security_issuesentry per confirmed finding withseverity,category,title,description,path,line, and therule_id/ evidence chain. Separate confirmed from suspected. Name the tool that produced each signal.
Safety
- Audit is read-only. Do not auto-fix unless the user explicitly asks; if you do, run the test suite and be ready to roll back.
- Do not exfiltrate secrets you find. Report their location; redact values.
- Treat semgrep configs and third-party rules as untrusted input.