/appsec-advisor:authnz-reviewfrom appsec-advisor
Runs three deterministic Python scanners (route inventory, auth-check scanner, IDOR confirmer) and dispatches a specialized agent to reason over combined output for cross-component IDOR chains, RBAC coverage gaps, JWT misconfiguration, and privilege-escalation signals.
Ships in appsec-advisor. 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.
You are performing a focused AuthN/AuthZ review of a repository. Follow the steps below exactly.
This report appears in the conversation as rendered Markdown. Raw ANSI escapes
do not colourise there — the reliable real-colour indicator is the
coloured-circle emoji. Use exactly this palette, mirroring the
audit-security-requirements skill so both skills read as one system:
| Severity / Status | Circle | Use |
|---|---|---|
| Critical | 🔴 | finding dot, stats row |
| High | 🟠 | finding dot, stats row |
| Medium | 🟡 | finding dot, stats row |
| Low | 🔵 | finding dot, stats row |
| Clean / pass | 🟢 | phase summary when no findings |
| Informational | ⚪ | deduplicated / skipped |
ANSI fallback (CLI embedding / NO_COLOR absent):
| Field | Escape |
|---|---|
● dot / severity label Critical | bold red \033[1;31m |
● dot / severity label High | bold yellow \033[1;33m |
● dot / severity label Medium | yellow \033[33m |
● dot / severity label Low | cyan \033[36m |
Finding ID (AZ-NNN) | cyan \033[36m |
| Short title (first line of finding) | bold \033[1m |
Field labels (Evidence, Fix, Reference) | dim gray \033[2m |
| File paths / line references | dim gray \033[2m |
| Phase headers | bold \033[1m |
| Progress percentage | dim gray \033[2m |
Keep the colour budget restrained: circle + severity + ID anchor each finding
line; bold title carries the eye. No box drawing, no background fills, no
accent stripes — the output must stay clean and copy-paste friendly. When
NO_COLOR is set or colour is unavailable, render identical text and glyphs
without escapes.
Console-first: all output goes to the conversation. File output is opt-in
via --save. Print each phase header and progress line immediately before
performing the described action. No trailing summaries, no preamble, no
"now I will…" narration between steps.
--help — help (early exit)If the user's arguments contain --help or -h, run the following Bash command,
output its stdout verbatim, then exit. Do not read any other file besides HELP.txt.
cat "<base-dir>/HELP.txt"
Parse the user's message or slash-command arguments:
--repo <path> → REPO_ROOT (default: current working directory)--requirements <path> → REQUIREMENTS_PATH (default: none; also
auto-detect $REPO_ROOT/docs/security/requirements.yaml when it exists)--with-threat-model → WITH_THREAT_MODEL=true--save → SAVE_FILES=true; set OUTPUT_DIR to the application's private
directory outside the repository, printed (and created) by
python3 "$CLAUDE_PLUGIN_ROOT/scripts/shared/assessment_location.py" destination --repo "$REPO_ROOT" --create.
If it exits non-zero, print its Error: ... line and stop; never fall back
to docs/security--pentest-tasks → PENTEST_TASKS=true--no-pentest-tasks → PENTEST_TASKS=false, even when the organization
profile enables it--pentest-format <fmt> → PENTEST_FORMAT (generic | strix; reject any
other value with a one-line error and stop)--pentest-target <url> → PENTEST_TARGET--slug <value> → SLUG (reject a value that is not 1-64 characters from
[A-Za-z0-9._-] with a one-line error and stop); set
PENTEST_FILE=pentest-tasks-authnz-<SLUG>.yaml, else
PENTEST_FILE=pentest-tasks-authnz.yaml--gate → GATE_MODE=trueThen resolve the organization defaults for the three pentest values — the
same outputs block appsec-analyzer honours, so both skills answer to
one profile:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/runtime/resolve_org_profile.py" --repo "$REPO_ROOT"
The resolver prints JSON and writes nothing. Read defaults.write_pentest_tasks,
defaults.pentest_format and defaults.pentest_target from it; a key that is
absent or null means the profile says nothing. A command-line flag always
wins over the profile. Where neither speaks: PENTEST_TASKS=false,
PENTEST_FORMAT=generic, PENTEST_TARGET=none. Any resolver failure (non-zero
exit, unparseable output) leaves all three at those defaults — a broken profile
must not silently change what a review writes. Record PENTEST_SOURCE as
flag or org profile <preset> for the introduction block.
When SAVE_FILES is not set, use a temp dir for scanner sidecar files.
Shell state does not survive between Bash calls, so print the path once and
write it literally as OUTPUT_DIR in every later command:
mktemp -d
Set SCRATCH_DIR and OUTPUT_DIR to the printed path.
The analyzer always writes .authnz-report.json into OUTPUT_DIR. Without
--save, that is the temp dir, which Step 10 removes — with --pentest-tasks
only the task file survives.
Record start time: START_EPOCH=$(date +%s)
Print the introduction block:
authnz-review <repo name (basename of REPO_ROOT)>
<REPO_ROOT>
route inventory · auth-check scan · IDOR confirmation · cross-component reasoning
requirements: <REQUIREMENTS_PATH or: none> · output: <OUTPUT_DIR | console only>
pentest tasks: <PENTEST_FORMAT> · target: <PENTEST_TARGET or: none> · <PENTEST_SOURCE>
← omit line when PENTEST_TASKS is false
Print:
Phase 1/5 · Route inventory [ 0%]
Parsing routes, middleware chains, and handler locations…
Run:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/analyzers/route_inventory.py" \
--repo-root "$REPO_ROOT" \
--output-dir "$OUTPUT_DIR"
If non-zero exit, print the stderr and stop.
Read $OUTPUT_DIR/.route-inventory.json. Take every count from its
coverage block — route_count, authenticated_count, authn_absent_count,
authn_unknown_count, missing_authz_suspect_count,
missing_auth_suspect_count — and never recount routes yourself. A route is
unauthenticated only when the inventory proved it (absent); unknown may sit
behind a guard the scanner cannot see. Print:
🟢 <N> routes parsed
authenticated <A> · no authentication <B> · unknown <U>
suspects: missing authz <X> · missing auth <Y>
Phase 1/5 complete [ 20%]
If X + Y == 0, use 🟢. If X + Y > 0 and < 5, use 🟡. If X + Y >= 5, use 🔴.
Print:
Phase 2/5 · Auth-check scan [ 20%]
Running pattern checks across all source files…
IDOR · missing route auth · mass assignment · JWT verification · credential policy
Run:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/analyzers/source_auth_scanner.py" \
--repo-root "$REPO_ROOT" \
--output-dir "$OUTPUT_DIR"
If non-zero exit, print the stderr and stop.
Count the findings by category; never count them yourself:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/model/authnz_report.py" counts --output-dir "$OUTPUT_DIR"
If non-zero exit, print the stderr and stop. From its scanner object, print
(<N> is in_scope; omit the out of scope token when it is 0):
<circle> <N> findings (IDOR <idor> · route auth <route_auth> · mass-assign <mass_assign> · JWT <jwt> · credential <credential>)
<out_of_scope> out of scope (injection, crypto, mobile) — not part of this review
Phase 2/5 complete [ 40%]
Circle: 🟢 for 0, 🟡 for 1–4, 🔴 for 5+.
Print:
Phase 3/5 · IDOR/BOLA confirmation [ 40%]
Reading handler bodies to confirm object-level auth suspects…
Suspects without a resolvable handler body are kept as hypotheses,
not emitted as confirmed findings.
Run:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/analyzers/authz_confirm.py" \
--repo-root "$REPO_ROOT" \
--output-dir "$OUTPUT_DIR"
If non-zero exit, print the stderr and stop.
Run the counts command from Phase 2 again and, from its confirmed object,
print (omit the second line when unresolved_suspects is 0):
<circle> <total> confirmed (<idor> IDOR/BOLA · <route_auth> missing route auth)
<unresolved_suspects> suspects unresolvable — kept as design-level hypotheses
Phase 3/5 complete [ 60%]
Circle: 🟢 for 0 confirmed, 🟡 for 1–2, 🔴 for 3+.
Only when WITH_THREAT_MODEL=true: print the assessment directory with
python3 "$CLAUDE_PLUGIN_ROOT/scripts/shared/assessment_location.py" locate --repo "$REPO_ROOT"
and set ASSESSMENT_DIR to it (none when the call fails). Glob for
$ASSESSMENT_DIR/.stride-*.json. If files exist set
STRIDE_FINDINGS_GLOB="$ASSESSMENT_DIR/.stride-*.json".
Otherwise set STRIDE_FINDINGS_GLOB=none and print:
⚪ --with-threat-model: no .stride-*.json found in the assessment directory — running standalone
When WITH_THREAT_MODEL is not set: STRIDE_FINDINGS_GLOB=none.
Print (using counts already read from Phases 1–3):
Phase 4/5 · Cross-component reasoning [ 60%]
<N> routes · <M> scanner signals · <K> confirmed instances
Dispatching authnz-analyzer — this step runs silently…
Dispatch appsec-advisor:appsec-authnz-analyzer with this prompt
(stable values first for prompt-cache friendliness):
REPO_ROOT=<REPO_ROOT>
OUTPUT_DIR=<OUTPUT_DIR>
CLAUDE_PLUGIN_ROOT=<CLAUDE_PLUGIN_ROOT>
MODEL_ID=<session model, e.g. sonnet>
SOURCE_AUTH_FINDINGS_PATH=<OUTPUT_DIR>/.source-auth-findings.json
ROUTE_INVENTORY_PATH=<OUTPUT_DIR>/.route-inventory.json
AUTHZ_CONFIRM_PATH=<OUTPUT_DIR>/.authz-confirm-findings.json
REQUIREMENTS_PATH=<REQUIREMENTS_PATH>
STRIDE_FINDINGS_GLOB=<STRIDE_FINDINGS_GLOB>
COMPONENT_INVENTORY_PATH=<$ASSESSMENT_DIR/.components.json if WITH_THREAT_MODEL and it exists, else none>
Wait for the agent to complete, then validate the report and compute its summary:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/model/authnz_report.py" finalize --report "$OUTPUT_DIR/.authnz-report.json" --require-inputs
If non-zero exit, print the stderr and stop: an invalid report is never
printed. Otherwise read $OUTPUT_DIR/.authnz-report.json into memory as
REPORT; every count below comes from REPORT.summary. When REPORT.partial
is true, the analyzer stopped early: print
⚪ partial report — the analyzer stopped after <last_step> before the counts.
Print:
🔴 Critical <critical> 🟠 High <high> 🟡 Medium <medium> 🔵 Low <low>
IDOR confirmed <idor_confirmed> · chains <chains> · STRIDE deduped <stride_deduplicated>
Phase 4/5 complete [ 80%]
Omit the STRIDE deduped token when stride_deduplicated == 0.
Print:
Phase 5/5 · Requirements annotation [ 80%]
If REQUIREMENTS_PATH is none:
(skipped — no requirements source; pass --requirements to enable)
[100%]
Otherwise the analyzer has already annotated the findings. Print, with
<N> = summary.requirements_annotated:
🟢 <N> of <total> findings linked to requirement IDs (<source>)
<M> findings use OWASP/CWE fallback references
[100%]
Use REPORT (already in memory from Step 6). Do not read from disk.
Print exactly this fixed block — never as prose. Every count is the named
REPORT.summary field; never recount findings:
Results · <repo name> · <total_findings> findings
🔴 Critical <critical>
🟠 High <high>
🟡 Medium <medium>
🔵 Low <low>
──────────────────────────────────────
IDOR confirmed <idor_confirmed>
Missing auth (routes) <missing_auth>
JWT misconfigurations <jwt_findings>
Credential policy <credential_findings>
Privilege escalation <privilege_escalation>
──────────────────────────────────────
Req. violations linked <requirements_annotated> ← omit row when REQUIREMENTS_PATH=none
STRIDE deduplicated <stride_deduplicated> ← omit row when STRIDE_FINDINGS_GLOB=none
──────────────────────────────────────
completed in <Xm Ys>
Right-align counts in one column as shown. Compute elapsed as $(( $(date +%s) - START_EPOCH )) seconds, format as Xm Ys (omit minutes when < 60s).
When REPORT contains chain_findings[] with at least one entry,
print this section before the per-finding blocks:
AuthN → AuthZ chains
────────────────────
For each chain:
🔴 **[<root_id>] <root_title>** makes <N> authorization finding(s) exploitable
<chain_ids joined by " · "> are all bypassed when this token is forged.
<one-sentence impact statement>
Sort Critical before High, then by component. For each:
🔴 **[AZ-NNN] <title>**
*Evidence* `<file>:<line>` (list all evidence entries, one per line when grouped)
*Attack path* <attack_path>
*Component* <component_id or: cross-component>
*Fix* <remediation.summary>
*Reference* <remediation.reference>
*Requirement* <requirement_id> ← omit line when null
One blank line between findings.
Print a compact block per finding, grouped under a header:
Medium findings
───────────────
🟡 **[AZ-NNN] <title>** · `<file>:<line>` [+N more]
<attack_path>
<remediation.summary>
Print a single aligned table:
Low findings
────────────
🔵 AZ-NNN <title> (<file>:<line>)
🔵 AZ-NNN <title> (<file>:<line>)
When total findings == 0 and REPORT.partial is false:
🟢 No AuthN/AuthZ findings.
When SAVE_FILES=true or PENTEST_TASKS=true, read <base-dir>/save-and-export.md
in full and follow it: Step 9 writes the Markdown and JSON report, Step 9b exports
the pentest task file. Otherwise skip to Step 10.
When GATE_MODE=true, run the deterministic gate after saving any requested artifacts:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/model/authnz_report.py" gate --report "$OUTPUT_DIR/.authnz-report.json"
Exit code 1 means incomplete analysis or Critical/High findings; print GATE FAILED with the returned reason. Exit code 2 means invalid or unreadable analysis data and also fails the gate. Only exit code 0 passes. A partial report is never described as clean, even when its finding list is empty.
When SCRATCH_DIR is set, remove it last: rm -rf "<SCRATCH_DIR>". Preserve the gate result when reporting completion.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
authn-review, authz-review, security-scanner, pentest, idor-detection
npx claudepluginhub appsec-foundry/appsec-advisor --plugin appsec-advisor28 skills in this plugin
/abuse-casesList the technical and business abuse cases defined for a repository — the plugin's standard cases, the organization profile's cases, and the repository's own cases in docs/security/abuse-cases/ — each with its origin, kind, and title. Use for "which abuse cases are defined?", "welche abuse cases gibt es?", "show our business abuse cases", or to look up the ID to pass to analyze-threats --abuse-case. Read-only; it does not check a case against the code. For the outcome a past run recorded, use ask-security-assessment./analyze-threatsAdvisory threat analysis on request: a planned design, selected code changes, a concrete threat hypothesis against named files or directories at a Git revision, or a defined abuse case by its ID. Combines source evidence with requirements, business context, and an optional threat model. Reports findings, scenarios, assumptions, and questions whose answers change the assessment. Hypothesis checks distinguish supported, not confirmed in scope, and unresolved; no result proves safety. Answers can be saved explicitly to a feature file. Never edits code, changes the threat model, or grants security approval./appsec-analyzerSecurity assessment of one repository through the deterministic controller; writes security-assessment.md and security-assessment.yaml to a private directory per application under the user data directory, or to --output. Runs full assessments only: --incremental, --rerender, --dry-run, --base, --pr-mode, --restore-from and a free-text focus are refused. Without a budget flag the depth sets a hard budget (quick 10, standard 20, thorough 40 USD). Models are fixed per role, not taken from the session; --model, --stride-model, --triage-model, --merger-model and --reasoning-model change them. --width sets the widest progress line (72 by default). Stop a running assessment with --stop./ask-security-assessmentAnswer ANY question about the threat model in this repo — read-only Q&A over the committed threat-model.yaml. The default surface for every natural-language query about the model, however simple: does one exist at all ("is there a threat model here?", "gibt es hier ein bedrohungsmodell?"), how it stands ("how bad is it?", "is it still current?"), anything about its contents ("what are the critical findings?", "does it cover SSRF / IDOR / auth?", "which findings touch the payment service?", "is there a fix for F-003?", "welche kritischen findings gibt es?", "deckt mein bedrohungsmodell XSS ab?"), and meta questions ("what does P1 mean?", "what is STRIDE here?"). Grounds every data answer in the model and cites F-ids; never analyzes code, re-scores, spawns agents, or writes files. Prefer this over show-security-assessment for anything phrased as a question — show only prints a fixed summary block on explicit request. To act on findings use triage-security-assessment; to (re)generate use appsec-analyzer./audit-security-requirementsAudit the current repository against a security requirements catalog and verify whether each requirement is implemented. Requirement IDs follow your catalog's own naming scheme (e.g. SEC-CSP-1, SCG-HARDENXML, or anything your YAML defines); tagging code with those IDs is optional and not required. Prints open requirements to the conversation with color-coded status and concise evidence. Optionally saves Markdown/PDF reports. With --json or --gate it also persists a deterministic structured verdict (.requirements-audit.json) and can act as a CI gate./check-permissionsPreflight the Claude Code permission allow-list for the AppSec plugin. Reports which Bash/Write/Edit/Read rules from data/required-permissions.yaml are missing from the user's settings.json, so unattended /appsec-advisor:appsec-analyzer runs do not block on prompts. Read-only by default; --update merges missing entries into a chosen scope.Other plugins' skills for the same job