/threat-modeling-toolkit:tm-threatsfrom threat-modeling-toolkit
Analyzes threats against discovered assets using STRIDE or PASTA framework. Generates threat catalog, attack trees, abuse cases, and risk register.
Ships in threat-modeling-toolkit. 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.
None: SKILL.md is the whole skill.
Systematically identify and analyze threats against your system using established threat modeling frameworks. This skill:
/tm-threats [--framework stride|pasta] [--focus <asset-id>] [--depth quick|standard|deep] [--include-abuse]
Arguments:
--framework: Threat framework (default: stride)--focus: Analyze specific asset only--depth: Analysis depth--include-abuse: Generate abuse cases from sequencesRequires initialized threat model. Run /tm-init first if .threatmodel/ doesn't exist.
Apply STRIDE categories based on asset type:
| Asset Type | S | T | R | I | D | E |
|---|---|---|---|---|---|---|
| External Entity | ✓ | ✓ | ||||
| Process/Service | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Data Store | ✓ | ✓ | ✓ | ✓ | ||
| Data Flow | ✓ | ✓ | ✓ |
Analyze threats for data flows crossing trust boundaries:
Analyze exposed entry points:
| Score | Level | Description |
|---|---|---|
| 1 | Rare | Requires significant resources, unlikely to occur |
| 2 | Unlikely | Difficult but possible with moderate resources |
| 3 | Possible | Achievable with common tools and moderate skill |
| 4 | Likely | Easy to exploit with readily available tools |
| 5 | Almost Certain | Trivial to exploit, may already be happening |
| Score | Level | Description |
|---|---|---|
| 1 | Negligible | Minor inconvenience, no data loss |
| 2 | Minor | Limited data exposure, quick recovery |
| 3 | Moderate | Significant data exposure, business disruption |
| 4 | Major | Large scale data breach, major business impact |
| 5 | Severe | Complete system compromise, existential threat |
| Risk Score | Level |
|---|---|
| 1-4 | Low |
| 5-9 | Medium |
| 10-15 | High |
| 16-25 | Critical |
{
"version": "1.0",
"generated": "ISO-8601",
"framework": "STRIDE",
"threats": [
{
"id": "threat-001",
"title": "Credential Stuffing Attack",
"category": "spoofing",
"framework": "STRIDE",
"description": "Attacker uses leaked credentials to gain unauthorized access",
"target": {
"asset_id": "asset-002",
"attack_surface_id": "as-001",
"entry_point": "/api/auth/login"
},
"threat_actor": "external-attacker",
"prerequisites": ["Leaked credential database", "Knowledge of login endpoint"],
"impact": {
"confidentiality": "high",
"integrity": "medium",
"availability": "low"
},
"likelihood": "likely",
"risk_score": 16,
"risk_level": "critical",
"mitre_attack": ["T1110.004"],
"cwe": ["CWE-307", "CWE-521"],
"countermeasures": ["control-001", "control-002"]
}
]
}
{
"version": "1.0",
"trees": [
{
"id": "at-001",
"threat_id": "threat-001",
"goal": "Gain unauthorized access to user accounts",
"root": {
"description": "Compromise user account",
"type": "or",
"children": [
{
"description": "Credential stuffing",
"type": "and",
"children": [
{"description": "Obtain leaked credentials", "type": "leaf", "difficulty": "low"},
{"description": "Bypass rate limiting", "type": "leaf", "difficulty": "medium"}
]
},
{"description": "Phishing attack", "type": "leaf", "difficulty": "medium"}
]
}
}
]
}
{
"version": "1.0",
"generated": "ISO-8601",
"entries": [
{
"id": "risk-001",
"threat_id": "threat-001",
"title": "Credential Stuffing Attack",
"category": "authentication",
"likelihood": {"score": 4, "rationale": "Common attack, tools readily available"},
"impact": {"score": 4, "rationale": "Account takeover leads to data breach"},
"inherent_risk_score": 16,
"inherent_risk_level": "critical",
"treatment": "mitigate",
"treatment_plan": "Implement MFA and improve rate limiting",
"owner": "security-team",
"status": "open"
}
]
}
When executing this skill:
Load existing threat model state:
.threatmodel/state/assets.json.threatmodel/state/dataflows.json.threatmodel/state/trust-boundaries.json.threatmodel/state/attack-surface.jsonApply STRIDE systematically:
Generate threat entries:
Build attack trees for critical threats:
Generate abuse cases (if --include-abuse):
Create risk register:
Write visual threat report (.threatmodel/reports/threat-report.md):
# Threat Analysis Report
**Generated**: [Date]
**Framework**: STRIDE
## Summary
THREAT ANALYSIS ═══════════════════════════════════════════════════════════
Assets Analyzed: 14 Attack Surfaces Analyzed: 12
THREATS BY SEVERITY ───────────────────────────────────────────────────────── CRITICAL │██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 5 (11%) HIGH │████████████████████████░░░░░░░░░░░░░░░░│ 12 (26%) MEDIUM │████████████████████████████████████░░░░│ 18 (38%) LOW │████████████████████████░░░░░░░░░░░░░░░░│ 12 (26%)
THREATS BY STRIDE CATEGORY ───────────────────────────────────────────────────────── Spoofing │████████████████░░░░░░░░░░░░░░░░│ 8 Tampering │████████████████████░░░░░░░░░░░░│ 10 Repudiation │████████░░░░░░░░░░░░░░░░░░░░░░░░│ 4 Information Disclosure│██████████████████░░░░░░░░░░░░░░│ 9 Denial of Service │██████████████░░░░░░░░░░░░░░░░░░│ 7 Elevation of Privilege│██████████████████░░░░░░░░░░░░░░│ 9
## Critical Threats
### THREAT-001: Credential Stuffing Attack
┌─────────────────────────────────────────────────────────┐ │ RISK SCORE: 8.5/10 (CRITICAL) │ ├─────────────────────────────────────────────────────────┤ │ Category: Spoofing │ │ Target: POST /api/auth/login │ │ │ │ ATTACK VECTOR: │ │ Automated login attempts with leaked credentials │ │ │ │ IMPACT: │ │ Confidentiality: HIGH │ │ Integrity: MEDIUM │ │ Availability: LOW │ │ │ │ MITRE ATT&CK: T1110.001 │ │ CWE: CWE-307 │ │ │ │ REQUIRED COUNTERMEASURES: │ │ • Rate limiting on auth endpoints │ │ • Account lockout after failed attempts │ │ • MFA enforcement │ └─────────────────────────────────────────────────────────┘
[Additional threats...]
Console summary (also display to user):
Threat Analysis Complete
========================
Framework: STRIDE
Assets Analyzed: X
Attack Surfaces Analyzed: Y
Threats Identified:
Critical: N
High: N
Medium: N
Low: N
Top Critical Threats:
1. [THREAT-001] Title (Risk: 16)
2. [THREAT-002] Title (Risk: 15)
Attack Trees Generated: N
Abuse Cases Documented: N
Files Updated:
.threatmodel/state/threats.json
.threatmodel/state/attack-trees.json
.threatmodel/state/risk-register.json
.threatmodel/reports/threat-report.md
Next Steps:
Run /tm-verify to check control implementations
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
threat-modeling, stride, pasta, security-analysis, risk-assessment
Other plugins' skills for the same job
9 skills in this plugin
/tm-complianceMap threats and controls to compliance frameworks like OWASP Top 10, SOC2, PCI-DSS, HIPAA, GDPR. Generates compliance reports with coverage percentages and gaps. Use when checking compliance status, mapping to security frameworks, or generating audit documentation./tm-driftDetect changes in the threat model since the last baseline snapshot. Identifies new assets, changed flows, new threats, and control status changes. Use when comparing threat model versions, tracking security drift, monitoring for new risks, or validating changes after updates./tm-fullRun the complete threat modeling workflow from initialization through reporting. Orchestrates all other skills in sequence. Use when performing full threat model analysis, running complete security assessment, or generating comprehensive threat documentation.npx claudepluginhub josemlopez/threat-modeling-toolkit --plugin threat-modeling-toolkit