Departments / security / security-audit

security-audit

Use when the user asks for a full security audit, pre-release security gate, or "scan this repo / service end-to-end". Orchestrates DAST (ZAP, Nuclei, Wapiti), SAST (Semgrep, SonarQube), and SCA (OSV-Scanner, npm audit, pip-audit, govulncheck, cargo-audit), deduplicates findings, classifies by severity, and emits a combined markdown report.

Department

Security

Safety

writes-local
Writes locally

Supported stacks

Stack-agnostic — no detection required.

When to use

Invoke this skill when any of the following apply:

Do not use for a secrets-only sweep (use secret-scanner) or a container image review (use container-scan). For a client-ready pentest deliverable, chain this skill into pentest-report.

Inputs

Outputs

All paths relative to $OUT_DIR:

Tool dependencies

Procedure

  1. Resolve inputs. Require TARGET_URL when DAST is requested; warn and continue SAST+SCA only if absent.
  2. mkdir -p "$OUT_DIR" and cd "$REPO_PATH".
  3. Run SCA first — cheapest, loudest: scripts/run-sca.sh "$REPO_PATH" "$OUT_DIR".
  4. Run SAST: scripts/run-sast.sh "$REPO_PATH" "$OUT_DIR".
  5. Run DAST (only if TARGET_URL set): scripts/run-dast.sh "$TARGET_URL" "$OUT_DIR".
  6. Normalize and deduplicate. For each scanner output build a record of {tool, rule_id, severity, cwe, file/url, line, message, evidence_path} then dedupe by (rule_id or cwe, file+line or url+param) keeping the highest severity.
  7. Classify severity using references/severity-thresholds.md (CVSS 3.1 buckets: Critical >= 9.0, High 7.0-8.9, Medium 4.0-6.9, Low 0.1-3.9).
  8. Drop findings below $SEVERITY_FLOOR from the report but keep them in findings.normalized.json.
  9. Emit security-report.md:
    • Executive summary (counts per severity, top 5 risks).
    • Findings grouped by severity, each with fix guidance and evidence pointer.
    • Appendix linking each raw artifact.
  10. Exit non-zero if any Critical remains (CI gate).

Examples

Example 1 — local repo + staging URL

REPO_PATH=/src/checkout \
TARGET_URL=https://staging.checkout.example.com \
OUT_DIR=/tmp/audit-checkout \
SEVERITY_FLOOR=medium \
./scripts/run-sca.sh  /src/checkout /tmp/audit-checkout
./scripts/run-sast.sh /src/checkout /tmp/audit-checkout
./scripts/run-dast.sh https://staging.checkout.example.com /tmp/audit-checkout

Expected tail of security-report.md:

## Summary
- Critical: 1
- High:     4
- Medium:  17
- Low:     32

## Critical findings
### CVE-2024-21626 — runc file descriptor leak (container escape)
- Source: osv-scanner (dependency: runc@1.1.9)
- CVSS 3.1: 8.6 (High base, Critical in privileged-container context)
- Fix: upgrade runc to >= 1.1.12. Rebuild base image.
- Evidence: /tmp/audit-checkout/osv.json#/results/2

Example 2 — SAST + SCA only (no running target)

REPO_PATH=. OUT_DIR=./out ./scripts/run-sca.sh  . ./out
REPO_PATH=. OUT_DIR=./out ./scripts/run-sast.sh . ./out

Expected: ./out/semgrep.sarif, ./out/osv.json, ./out/findings.normalized.json, ./out/security-report.md (DAST section marked “skipped — no TARGET_URL”).

Constraints

Quality checks

Customise for your organisation

security-audit

The LLM will rewrite this skill for your environment. Your API key and form inputs stay in your browser — only the skill and your environment go to OpenRouter.

One line. Be specific — cloud, language, framework, orchestrator.

Free text that steers the rewrite. Leave blank if nothing specific.

cost estimate: