Skip to content

@tank/security-review

1.0.0

Security review for any codebase, PR, or architecture. OWASP Top 10, API Security Top 10, CWE Top 25, SAST (Semgrep, CodeQL, Bandit), dependency scanning (Trivy, Snyk), secret detection (Gitleaks, TruffleHog), IaC scanning (Checkov, tfsec), threat modeling (STRIDE, PASTA), language vulnerability patterns, and remediation. Triggers: security review, OWASP, vulnerability, CVE, CWE, Semgrep, CodeQL, Trivy, Gitleaks, threat model, STRIDE, XSS, SQL injection, SSRF, Checkov, security scanning, SBOM.


name: "@tank/security-review" description: | Comprehensive security review for any codebase, PR, or architecture. Covers OWASP Top 10 (2021) and API Security Top 10 (2023), CWE Top 25, code review methodology (differential and full audit), SAST tools (Semgrep, CodeQL, Bandit, ESLint security), dependency and supply chain scanning (npm audit, Trivy, Snyk, OSV-Scanner, SBOM), secret detection (Gitleaks, TruffleHog), IaC scanning (Checkov, tfsec), threat modeling (STRIDE, PASTA), language-specific vulnerability patterns (JS/TS, Python, Go, Rust, Java), and remediation patterns for every vulnerability class. Synthesizes OWASP Foundation standards, MITRE CWE, NIST NVD, Trail of Bits audit methodology, Shostack (Threat Modeling), and OWASP Testing Guide (WSTG v5).

Trigger phrases: "security review", "security audit", "OWASP", "vulnerability", "CVE", "CWE", "code audit", "penetration test", "threat model", "STRIDE", "PASTA", "Semgrep", "CodeQL", "SAST", "DAST", "dependency scan", "npm audit", "Trivy", "Snyk", "Gitleaks", "TruffleHog", "secret scanning", "supply chain", "XSS", "SQL injection", "SSRF", "CSRF", "IDOR", "injection", "deserialization", "Checkov", "tfsec", "IaC security", "security scanning", "secure code review", "attack surface", "SBOM", "ASVS", "security checklist"

Security Review

Core Philosophy

  1. High confidence only — Flag findings where you are >80% confident of real exploitability. Theoretical issues, style concerns, and low-impact findings waste reviewer trust. One confirmed RCE matters more than twenty speculative XSS.
  2. Static tools first, human judgment second — Run Semgrep/CodeQL/Gitleaks before manual review. Tools catch the mechanical bugs; the reviewer's time is for logic flaws, auth bypasses, and design-level issues that tools miss.
  3. Fix patterns, not instances — When you find one SQL injection, search for the pattern across the codebase. A vulnerability is a symptom; the missing input validation framework is the disease.
  4. Defense in depth — No single control is sufficient. Validate inputs AND encode outputs AND use parameterized queries AND enforce least privilege. Each layer catches what the previous one misses.
  5. Shift left, but verify right — Integrate scanning into CI/CD, but run a full audit before major releases. Pre-commit hooks catch secrets; production monitoring catches what pre-commit missed.

Quick-Start: Common Problems

"Review this PR for security"

  1. Get the diff: git diff main...HEAD or the PR diff
  2. Classify changed files by risk (auth, payments, user input, config > UI, docs, tests)
  3. For each high-risk file, check against → references/code-review-workflow.md
  4. Run targeted SAST: semgrep scan --config p/security-audit --diff-depth 0
  5. Check for new dependencies → references/dependency-and-supply-chain.md
  6. Report only >80% confidence findings with severity, location, and fix suggestion

"Run a full security audit"

  1. Map the attack surface: entry points, trust boundaries, data flows
  2. Run automated scans: SAST + dependency + secrets + IaC
  3. Manual review: auth flows, business logic, crypto usage, session handling
  4. Threat model critical components → references/threat-modeling.md
  5. Prioritize findings by exploitability × impact
  6. Write report → references/code-review-workflow.md (report format section)

"Check for OWASP issues"

  1. Identify the target type (web app, API, mobile backend)
  2. Select the relevant list: OWASP Top 10 (web) or API Security Top 10
  3. Walk through each category against the codebase → See references/owasp-vulnerability-taxonomy.md

"Scan dependencies for vulnerabilities"

  1. Detect package manager (package.json, requirements.txt, go.mod, Cargo.toml)
  2. Run the appropriate scanner: npm audit, pip-audit, trivy fs .
  3. Triage: fixable vs unfixable, exploitable vs theoretical, direct vs transitive → See references/dependency-and-supply-chain.md

"Set up security scanning in CI"

  1. Add SAST (Semgrep) → non-blocking initially, blocking after baseline
  2. Add dependency scanning (Trivy or npm audit) → block on critical/high
  3. Add secret scanning (Gitleaks) → always blocking
  4. Add IaC scanning if applicable (Checkov) → block on high → See references/sast-and-scanning-tools.md and references/secrets-and-iac-scanning.md

"Find secrets in the codebase"

  1. Run gitleaks detect --source . --verbose (includes git history)
  2. Run trufflehog filesystem . --only-verified (verifies credentials are live)
  3. For pre-commit prevention: pre-commit install with gitleaks hook → See references/secrets-and-iac-scanning.md

Decision Trees

Which Review Depth?

SignalDepthTime
Small PR, no auth/payment/input changesQuick scan — SAST + dependency check10 min
PR touches auth, sessions, payments, cryptoTargeted review — manual + automated1 hour
New feature with external inputFull feature review — threat model + manual2-4 hours
Pre-release audit, compliance requirementFull audit — all tools + manual + report1-3 days

Which SAST Tool?

NeedToolWhy
Fast, broad coverage, custom rulesSemgrepPattern-based, 30+ languages, free tier
Deep data flow / taint trackingCodeQLInterprocedural analysis, 166 CWEs, GitHub-native
Python-specificBanditAST-based, Python-only, fast
JavaScript/TypeScript lintingeslint-plugin-security + no-unsanitizedIntegrates with existing ESLint
Quick pattern matchingast-grepYAML rules, fast, multi-language

Which Dependency Scanner?

EcosystemToolCommand
Node.jsnpm audit / Trivynpm audit --audit-level=high
Pythonpip-audit / Trivypip-audit --strict
Gogovulncheck / Trivygovulncheck ./...
Rustcargo-auditcargo audit
Multi-ecosystemTrivytrivy fs --scanners vuln .
Enterprise / paidSnyksnyk test

Exclusions

These are handled by other skills or processes — do not duplicate:

  • Auth patterns (JWT, OAuth2, session design) → @tank/auth-patterns
  • Container security (image scanning, cosign, SBOM signing) → @solaraai/devops-mastery
  • macOS system security (SIP, Gatekeeper, FileVault) → @tank/macos-maintenance
  • DOS/rate limiting — typically operational, not code review scope
  • Secrets already on disk — handled by secret managers, not review

Reference Files

FileContents
references/owasp-vulnerability-taxonomy.mdOWASP Top 10 (2021), API Security Top 10 (2023), CWE Top 25 (2024), ASVS verification levels, vulnerability classification with code examples
references/code-review-workflow.mdDifferential (PR) review methodology, full audit workflow, attack surface mapping, >80% confidence threshold, finding classification (severity/exploitability), report format, review anti-patterns
references/sast-and-scanning-tools.mdSemgrep (configs, custom rules, CI), CodeQL (query suites, MRVA), Bandit, ESLint security, ast-grep rules. Tool selection, result interpretation, false positive triage, CI pipeline setup
references/dependency-and-supply-chain.mdnpm audit, pip-audit, cargo-audit, govulncheck, Trivy, Snyk, OSV-Scanner. SBOM generation (CycloneDX/SPDX). Lock file analysis, typosquatting, supply chain attack patterns
references/secrets-and-iac-scanning.mdGitleaks, TruffleHog, detect-secrets for secret detection. Checkov, tfsec, KICS for IaC. Pre-commit hooks, CI integration, incident response for leaked secrets
references/language-vulnerability-patterns.mdCommon vulns per language: JS/TS (XSS, prototype pollution, ReDoS), Python (SSTI, pickle, command injection), Go (race conditions, integer overflow), Rust (unsafe, FFI), Java (deserialization, JNDI injection)
references/threat-modeling.mdSTRIDE framework, PASTA methodology (7 stages), attack trees, trust boundaries, data flow diagrams, when to threat model, lightweight vs formal approaches
references/remediation-patterns.mdFix patterns per vulnerability class: input validation, output encoding, parameterized queries, CSP/CORS headers, secure defaults, crypto best practices, safe deserialization, secure file handling

Command Palette

Search skills, docs, and navigate Tank