From appsec
This skill should be used when the user asks to "create threat model", "threat model architecture", "map security architecture", "build threat model", "STRIDE analysis", "data flow diagram", "DFD security", or "attack tree analysis". Also triggers when the user wants a systematic identification of threats against the application architecture, trust boundaries, data flows, or component interactions.
npx claudepluginhub florianbuetow/claude-code --plugin appsecThis skill uses the workspace's default tool permissions.
Full architecture-level threat modeling with automated discovery, data flow
Acquire memory dumps from live systems/VMs and analyze with Volatility 3 for processes, networks, DLLs, injections in incident response or malware hunts.
Provides x86-64/ARM disassembly patterns, calling conventions, control flow recognition for static analysis of executables and compiled binaries.
Identifies anti-debugging checks like IsDebuggerPresent, NtQueryInformationProcess in Windows binaries; suggests bypasses via patches/hooks/scripts for malware analysis, CTFs, authorized RE.
Full architecture-level threat modeling with automated discovery, data flow
mapping, STRIDE-per-component analysis, and attack tree generation. Produces
persistent, incremental threat models stored in .appsec/model/ that evolve
as the codebase changes.
Read ../../shared/schemas/flags.md for the full flag specification.
| Flag | Model Behavior |
|---|---|
--scope | Default full. Threat models benefit from whole-system visibility. Narrow scopes produce partial models with a warning. |
--depth quick | Component inventory and trust boundary identification only. |
--depth standard | Full threat model: components, data flows, STRIDE analysis, mitigations. |
--depth deep | Standard + attack trees, cross-component threat chains, external dependency threats. |
--depth expert | Deep + DREAD scoring, attack simulation narratives, compliance mapping. |
--severity | Filter reported threats by severity in output. |
--format | Default md. Use json for structured model data. |
--diff | Incremental mode: only analyze changes since last model. Compare against .appsec/model/current.json. |
Automatically discover the application architecture by analyzing the codebase:
Identify all significant components:
Identify boundaries where trust levels change:
Generate Mermaid data flow diagrams (DFDs) at two levels:
Generate Mermaid DFDs at two levels: Level 0 (system context -- actors, application, external systems) and Level 1 (component detail with trust boundary subgraphs showing internal services, data stores, and message queues).
Annotate each data flow with:
Apply STRIDE to each component and data flow:
| STRIDE | Question |
|---|---|
| Spoofing | Can an attacker impersonate this component or a user of it? |
| Tampering | Can data in transit or at rest be modified without detection? |
| Repudiation | Can actions be performed without an audit trail? |
| Information Disclosure | Can sensitive data leak from this component? |
| Denial of Service | Can this component be made unavailable? |
| Elevation of Privilege | Can an attacker gain higher access through this component? |
For each component, generate a threat table:
For each component, produce a table with columns: #, STRIDE category, Threat description, Severity, Mitigation, Status (Mitigated/Partial/Gap/Accepted).
At --depth deep and above, generate attack trees for high-value targets:
For each high-value target (e.g., "Exfiltrate User PII"), produce a numbered attack tree with branches for direct access, application-layer attacks, and infrastructure attacks. Each leaf node references severity and mitigation status from the STRIDE analysis.
For each threat identified:
Mitigated: Security control exists and is properly implemented.Partial: Control exists but is incomplete or has known weaknesses.Gap: No mitigation found. This becomes a finding.Accepted: Risk acknowledged and accepted (noted in threat model).When --diff flag is set:
.appsec/model/current.json.Output a changelog showing NEW, CHANGED, and REMOVED components with threat counts for each.
Save the threat model to .appsec/model/:
| File | Contents |
|---|---|
current.json | Full structured model (components, flows, threats, mitigations) |
threat-model.md | Human-readable report with Mermaid diagrams |
dfd-level0.mmd | Level 0 Mermaid DFD source |
dfd-level1.mmd | Level 1 Mermaid DFD source |
attack-trees.md | Attack tree documentation |
history/<timestamp>.json | Snapshot for diffing (incremental mode) |
For each threat with status Gap, emit a finding using ../../shared/schemas/findings.md:
references.stride value.Findings follow ../../shared/schemas/findings.md.
Finding ID prefix: TM (e.g., TM-001).
metadata.tool: "model"metadata.framework: "stride" (or specific framework if used)references.stride: The STRIDE category letter--diff) rather than full rebuilds.