plugins/clade/skills/cso/SKILL.md
Security audit skill — systematic OWASP + STRIDE review of a project. Covers attack surface, secrets archaeology, dependency supply chain, OWASP Top 10, threat modeling, and false-positive filtering. Outputs a prioritized findings report.
npx skillsauth add shenxingy/claude-code-kit csoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This workflow runs directly in Codex. Do not launch the claude CLI or
delegate the workflow to Clade's MCP bridge.
Codex compatibility rules:
AGENTS.md files for repository instructions. If a project
has only CLAUDE.md, treat it as legacy project guidance and read it too..clade/ (or ~/.clade/ for personal
state). Existing legacy Claude state may be read for migration, but do not
create new vendor-specific state./skill-name reference means the corresponding Codex $skill-name skill,
or the same workflow invoked naturally when explicit skill invocation is not
available.<plugin-root>/... are relative to the installed Clade plugin
containing this SKILL.md; resolve that root before invoking a helper.You are the CSO (Chief Security Officer) skill. You perform a systematic security audit of the project.
/cso --full) — flag findings with confidence ≥ 2/10. Exhaustive, for pre-launch audits.git branch --show-current
ls -la # project structure
cat AGENTS.md 2>/dev/null | head -30 # tech stack
Identify:
Map all entry points where attacker-controlled data enters the system:
Code surface:
Infrastructure surface:
Search for hardcoded secrets and credential exposure:
# Hardcoded secrets patterns
grep -rn "sk-\|api_key\s*=\|password\s*=\|secret\s*=\|token\s*=" \
--include="*.py" --include="*.ts" --include="*.js" --include="*.env*" \
. | grep -v ".git" | grep -v "__pycache__" | grep -v "node_modules"
# Check for .env files committed to git
git log --all --full-history -- "**/.env" "*.env"
# Check git history for removed secrets (they're still there)
git log --all -S "password" --oneline | head -10
git log --all -S "sk-" --oneline | head -10
Check CI/CD configs for exposed secrets:
find .github -name "*.yml" -o -name "*.yaml" 2>/dev/null | xargs grep -l "secret\|password\|key" 2>/dev/null
# Python
pip-audit 2>/dev/null || safety check 2>/dev/null || \
pip list --format=json | python3 -c "import sys,json; pkgs=json.load(sys.stdin); print(f'{len(pkgs)} packages — run pip-audit for vuln scan')"
# Node.js
npm audit --json 2>/dev/null | python3 -c "
import sys, json
try:
d = json.load(sys.stdin)
vulns = d.get('metadata', {}).get('vulnerabilities', {})
print(f'Vulnerabilities: critical={vulns.get(\"critical\",0)}, high={vulns.get(\"high\",0)}, moderate={vulns.get(\"moderate\",0)}')
except: pass
" 2>/dev/null || true
Flag: unpinned major dependencies (e.g., requests>=2.0.0 instead of requests==2.31.0).
Load references/owasp-top10.md now — it contains the full checklist, high-signal grep patterns, and confidence guidance for each category.
Check each of the 10 categories using that reference. For each finding, confirm it's exploitable before flagging (skip if false positive — see Phase 6).
Load references/stride.md now — it contains the full STRIDE analysis table, component template, and priority matrix.
For each major component (web server, database, auth service, background workers), work through S-T-R-I-D-E using that reference. Only flag items with a plausible attack path for this project's threat model.
Load references/false-positive-filter.md now — it contains 12 auto-discard rules, a self-check protocol, and confidence level definitions.
Apply all 12 rules to every finding. For each surviving finding, confirm there's a concrete attack path and real impact specific to this codebase. Assign a confidence level (HIGH/MEDIUM/LOW) per the reference.
Output a prioritized report:
SECURITY AUDIT REPORT
════════════════════════════════════════
Project: [name] Branch: [branch] Date: [date]
Mode: daily | comprehensive
Threat model: [brief description of attacker profile]
CRITICAL (must fix before ship)
[C1] [A03-Injection] SQL injection at routes/users.py:87
Attack: GET /users?id=1 OR 1=1--
Impact: Full DB read access
Fix: Use parameterized query — `cursor.execute("SELECT ... WHERE id = %s", (id,))`
HIGH (fix in this sprint)
[H1] ...
MEDIUM (fix in next sprint)
[M1] ...
LOW / Informational
[L1] ...
DISCARDED (false positives filtered)
- [DoS exclusion] Rate limiting on /api/generate — LLM cost risk is LOW (auth required)
- [Test-only exclusion] Hardcoded credentials in tests/fixtures/
Summary: N critical, M high, P medium, Q low
════════════════════════════════════════
Save report to .clade/security-reports/YYYY-MM-DD.md.
Scope note: This is an AI-assisted audit, not a penetration test. Flag findings confidently but caveat that manual verification is needed before treating any finding as confirmed exploitable.
For HIGH-confidence findings in critical files, spawn the security-auditor subagent for line-by-line analysis:
Use a Codex subagent when available with subagent_type="security-auditor":
"Audit [file path] for [specific vulnerability category]. Context: [what you already know about this component]"
Merge the subagent's findings into the main report. The subagent has no Write access — it only reads and reports.
| Scenario | Action | |----------|--------| | Cannot read key source files (permission denied) | Note in report as "Partial audit — [file] unreadable". Continue with what's accessible. | | No package manager detected (no requirements.txt, package.json, etc.) | Skip Phase 3, note "Dependency audit skipped — no package manifest found" | | Git history unavailable | Skip git-based secret archaeology, note it | | Project is non-code (docs-only, config-only) | Output "No attack surface found — this directory contains no executable code" | | Ambiguous tech stack | List what was detected, ask user to confirm before proceeding with OWASP analysis |
development
Orchestrate a fleet of parallel `codex exec` workers with you (Claude Code) as the supervisor — spawn one per isolated git worktree, dispatch headless, verify each INDEPENDENTLY, PR/merge. The manual "codex-ultracode" pattern for fanning out real implementation, research, or review work onto Codex. Bakes in the hard gotchas (stdin blocking, background tracking, don't-trust-self-reports, writer isolation). Triggers on — orchestrate codex, codex workers, codex fleet, spawn codex, delegate to codex in parallel, manual ultracode, 开 codex 小弟, 派 codex worker — NOT for a single cross-vendor opinion (use the `second-opinion-codex` agent), NOT for web-UI worker decomposition (use `/orchestrate`).
development
Create and manage git worktrees for parallel Codex sessions
development
Verify project behavior anchors — compilation, tests, and interaction checks after autonomous runs. NOT the Codex built-in /verify (which runs the app to observe a single change working) — this one walks the AGENTS.md "Features (Behavior Anchors)" list.
documentation
End-of-session documentation sync — updates TODO.md and PROGRESS.md only (run /commit after to commit everything)