/ceh-security-audit:audit-codebase-security [path or service]from ceh-security-audit
Load this skill when a whole codebase, not one diff, needs a security audit: attack surface, entry points traced to sinks, each exploitable finding with severity and fix. Trigger on "security audit", "is this codebase secure". Not for pending changes (use the built-in /security-review).
Ships in ceh-security-audit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Audit everything already in the codebase for weaknesses an attacker can reach, and report each
one as the attack it enables. Claude Code's built-in /security-review checks pending changes
only, and most vulnerabilities are in code that was merged long ago. Done means every entry point
is traced, every category below is checked or listed as skipped with a reason, and the report is
saved.
Map the attack surface before reading for bugs. List the entry points (HTTP routes, CLI arguments, queue consumers, webhooks, file uploads and parsers, jobs that read external data), the trust boundaries where outside data enters, the assets (credentials, personal data, money, admin actions), and the attackers who can reach each entry point (anonymous, signed-in user, another tenant, an operator). Severity only means something against an asset and an attacker who can reach it.
Trace each entry point to its sinks, done by the subagents of step 4: queries, shell commands, file paths, HTML and
templates, outbound requests, deserializers, eval. Request every search and file read that does not depend on another's result in the same turn. Check each category, and name the ones that
do not apply:
| Category | Look for |
|---|---|
| Access control | A route with no auth, an object fetched by id with no owner check, a role checked only in the UI, tenant from input |
| Injection | SQL or shell built from strings, a file path from input with no containment check, unescaped HTML |
| Secrets | Credentials in code, config, tests, or git history (git log -p -S '<pattern>'), tokens written to logs |
| Outbound | A server-side fetch of a URL from input (SSRF), an open redirect |
| Parsing | Unsafe deserialization (pickle, yaml.load), XML external entities, archive path traversal, unbounded uploads |
| Crypto, sessions | Fast hashes for passwords, random for tokens, unverified JWTs, cookies without HttpOnly, Secure, SameSite |
| Configuration | Debug on in production config, CORS * with credentials, stack traces in error responses, default credentials |
| Resource limits | No rate limit on login or costly endpoints, a regex with catastrophic backtracking on input |
| Dependencies | A pinned version with a published advisory |
Check dependencies only with consent to the network. The audit tools send the dependency list to an advisory database, which is sending content to an external service. Run them when the user asked for the dependency check or network use is already authorized. Otherwise put the exact command under Not checked.
Hand the reading to subagents, on every run. Write the surface map to the report's
attack_surface first, then dispatch background subagents to run step 2 and the tracing of
step 5: one per group of categories, in parallel, with more than one service or more than about
fifty entry points, otherwise one for the whole surface. Each brief holds the report path and
its categories, and never an earlier security audit, so the reader is independent of earlier
runs. Each subagent returns its findings as rows of the report's findings, plus its Possible
list as possible rows. Merge by path:line, and re-read every quoted line before it becomes
a finding.
Confirm each finding by quoting both ends: where the attacker's input enters and the sink it reaches, with every step between that could stop it. Rate severity (critical, high, medium, low) from impact and reachability, and confidence: confirmed (traced end to end, or proven by a local test) or likely. A finding you cannot trace goes under Possible, not in the table.
Act on findings only as the section below says.
path:line and the
kind of secret. Removing a committed secret from the code does not remove it from history, so
the fix is rotating it, which is the owner's call: report it, never rotate it..agents_workspace/, never in a committed path: a committed audit of an
unfixed hole publishes it.Save to .agents_workspace/product/audit/security/<YYYYMMDD-HHMMSS>-<session-id>-security-audit.yaml, so a
second audit keeps the first. Take <YYYYMMDD-HHMMSS> from one date +%Y%m%d-%H%M%S call and <session-id> from ${CLAUDE_SESSION_ID}. Reply
with the counts by severity and the critical and high rows. The report fills
assets/security-audit.template.yaml, per the security-audit/v2 section of
references/security-audit-schema.md. After the last edit, run
uv run --script ${CLAUDE_SKILL_DIR}/scripts/artifact.py render <file>.yaml, which writes the
.md beside it in the layout of assets/security-audit.template.md, and fix the YAML for each
error it lists. That is the only edit a saved report takes: the report is fixed once rendered,
and a later audit is a new file. Never edit the generated .md. On exit 2 or 3, or without uv, say in the reply that the
report went unchecked and unrendered.
The saved report stays as it is: it records what the audit found, never what came of it. End by asking the user which findings to act on. Act only on the findings the user chooses in this session, and fix none directly: each goes to a fix record, a plan or a rule before any edit, because the audited work has already landed. With no user to choose, as in a headless run or a report-only subagent, route nothing: the report stands, and a calling agent does any routing.
| Finding is | Route |
|---|---|
| A bug in this repo's code or config | ceh-coding-conduct:find-root-cause, writes a fix record |
| A feature, design or any other change in this repo | ceh-build-plan:write-build-plan |
| A rule for how work is done in this repo | ceh-every-session:record-project-decisions |
| Outside this repo | Left for the user |
Each chosen finding ends handed off or dropped with a reason, and stays open only while it
waits on a user decision: one outside the repo, or a route whose plugin is not installed. A row in
a backlog file the repo names (in its README, CLAUDE.md or AGENTS.md) counts as handed off, and
an open finding gets one there too. Every plan, fix record, rule or backlog row names the audit
file and the finding as its source, the finding by its id where the format has one, else by its
location. The reply lists each chosen finding with where it went.
A committed secret always goes to the user, because rotating it is the owner's call.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub cheneeheng/ceh-claude-code-library --plugin ceh-security-audit