/phoenix-security-review:threat-modelingfrom phoenix-security-review
Automates STRIDE/DREAD threat modeling from code analysis, extracting architecture, data flows, and trust boundaries to produce ranked threats, attack scenarios, and mitigations for security assessments and compliance documentation.
Ships in phoenix-security-review. 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.
Purpose: Automated threat modeling from code analysis using STRIDE/DREAD methodologies
When to use: Security assessment, architecture review, compliance documentation, attack scenario planning
Determine analysis scope:
Check prerequisites:
Extract system architecture from:
Enrich with:
Generate threats for each category:
For each threat, identify:
Score each threat (1-10):
Calculate:
Enrich with Phoenix data (IP-protected):
Validate IP protection:
psHpScore, psHpTier, componentLevelsCombine threats with CVE attack vectors:
Build hierarchical attack structure:
Link threats to code:
Generate security controls:
Generate comprehensive report:
# Generate threat model
POST /api/v1/threat-model/assessments
{
"repo_name": "myapp",
"assessment_type": "full_repo",
"include_dread": true,
"include_attack_tree": true,
"provider": "openai",
"model": "gpt-4o",
"industry": "financial_services",
"compliance_frameworks": ["pci_dss", "sox"]
}
# Get assessment status
GET /api/v1/threat-model/assessments/{assessment_id}/status
# Get threat model results
GET /api/v1/threat-model/assessments/{assessment_id}
# Upload architecture diagram
POST /api/v1/threat-model/architecture-diagrams
(multipart/form-data: file, name, description, provider, model)
# Generate feature threat model
POST /api/v1/threat-model/assessments/feature
{
"repo_name": "myapp",
"feature_name": "User Authentication",
"entry_points": ["login", "register", "resetPassword"]
}
// Generate threat model
await use_mcp_tool("gitnexus", "threat_model", {
repo_name: "myapp",
assessment_type: "full_repo",
include_dread: true
})
// Get threats for component
await use_mcp_tool("gitnexus", "get_threats", {
repo_name: "myapp",
component_name: "Authentication Service"
})
// Get attack scenarios
await use_mcp_tool("gitnexus", "get_attack_scenarios", {
assessment_id: "tm_abc123"
})
MATCH (threat:ThreatModel {repoName: 'myapp'})
RETURN threat.category, threat.title, threat.riskScore
ORDER BY threat.riskScore DESC
MATCH (threat:ThreatModel)-[:THREATENS]->(func:Function {name: 'authenticate'})
RETURN threat.title, threat.scenario, threat.riskScore, threat.category
MATCH path = (entry:Function {isEntryPoint: true})-[:CALLS*1..5]->(func:Function)
WHERE EXISTS((threat:ThreatModel)-[:THREATENS]->(func))
WITH path, func
MATCH (threat:ThreatModel)-[:THREATENS]->(func)
RETURN path, threat.title, threat.riskScore
ORDER BY threat.riskScore DESC
LIMIT 10
MATCH (threat:ThreatModel {repoName: 'myapp', category: 'SPOOFING'})
RETURN threat.title, threat.scenario, threat.riskScore
ORDER BY threat.riskScore DESC
MATCH (threat:ThreatModel)-[:EXPLOITS_VIA_CVE]->(cve:CVE)
WHERE threat.repoName = 'myapp' AND threat.riskScore >= 7.0
RETURN threat.title, threat.riskScore, collect(cve.cveId) as relatedCVEs
ORDER BY threat.riskScore DESC
data class ThreatModelConfig(
val userId: String,
val repoName: String,
// Architecture extraction
val includeBusinessContext: Boolean = true,
val architectureDiagramIds: List<String> = emptyList(),
val extractFromCode: Boolean = true,
// Analysis settings
val strideCategories: List<STRIDECategory> = STRIDECategory.values().toList(),
val includeDREAD: Boolean = true,
val includeAttackTree: Boolean = true,
val includeAttackScenarios: Boolean = true,
val includeMitigations: Boolean = true,
// LLM settings
val provider: LLMProvider = LLMProvider.OPENAI,
val model: String = "gpt-4o",
val temperature: Double = 0.2,
// Phoenix integration
val usePhoenixIntelligence: Boolean = true,
val includeThreatActors: Boolean = true,
val includeMITREAttack: Boolean = true,
// Industry/compliance
val industry: Industry? = null,
val complianceFrameworks: List<ComplianceFramework> = emptyList(),
// Output settings
val outputFormats: List<OutputFormat> = listOf(OutputFormat.JSON, OutputFormat.MARKDOWN)
)
IMPORTANT: When displaying risk assessments, use a proper risk matrix format, NOT a flowchart.
✅ CORRECT - Use Markdown Table Matrix:
| Impact ↓ / Likelihood → | 🟢 Low | 🟡 Medium | 🟠 High | 🔴 Very High |
|---|---|---|---|---|
| 🔴 Critical | Medium | High | Critical | SQL Injection, Command Injection |
| 🟠 High | Low | Medium | XXE Injection | Critical |
| 🟡 Medium | Low | Medium | High | High |
| 🟢 Low | Low | Low | Medium | Medium |
✅ CORRECT - Use Mermaid Quadrant Chart (Mermaid 10.6+):
%%{init: {'theme': 'dark', 'themeVariables': { 'quadrant1Fill': '#991b1b', 'quadrant2Fill': '#b45309', 'quadrant3Fill': '#166534', 'quadrant4Fill': '#7d6608', 'quadrant1TextFill': '#ffffff', 'quadrant2TextFill': '#ffffff', 'quadrant3TextFill': '#ffffff', 'quadrant4TextFill': '#ffffff'}}}%%
quadrantChart
title Vulnerability Risk Assessment
x-axis Low Likelihood --> High Likelihood
y-axis Low Impact --> High Impact
quadrant-1 Critical Risk
quadrant-2 High Risk
quadrant-3 Low Risk
quadrant-4 Medium Risk
SQL Injection: [0.90, 0.95]
Command Injection: [0.90, 0.95]
XXE Injection: [0.75, 0.70]
❌ WRONG - Never use flowchart/graph for risk matrix:
graph LR
subgraph Likelihood
L1[Low] --> L2[Medium]
end
This creates a flow diagram, NOT a risk matrix. Risk matrices must show 2D positioning (likelihood × impact).
psHpScore, psHpTier, componentLevelsPhoenixDataShieldingService# Generate comprehensive threat model
# Note: Use port 8090 for Docker deployments, 8080 for direct Gradle runs
curl -X POST http://localhost:8090/api/v1/threat-model/assessments \
-H "Content-Type: application/json" \
-d '{
"repo_name": "financial-platform",
"assessment_type": "full_repo",
"include_dread": true,
"include_attack_tree": true,
"include_attack_scenarios": true,
"provider": "openai",
"model": "gpt-4o",
"industry": "financial_services",
"compliance_frameworks": ["pci_dss", "sox", "glba"]
}'
# Response
{
"assessment_id": "tm_abc123",
"status": "processing",
"progress_percentage": 10,
"estimated_completion": "2026-02-27T10:15:00Z"
}
# Check status
curl http://localhost:8090/api/v1/threat-model/assessments/tm_abc123/status
# Get results
curl http://localhost:8090/api/v1/threat-model/assessments/tm_abc123
# Generate threat model for authentication feature
curl -X POST http://localhost:8090/api/v1/threat-model/assessments/feature \
-H "Content-Type: application/json" \
-d '{
"repo_name": "financial-platform",
"feature_name": "User Authentication",
"entry_points": ["login", "register", "resetPassword", "validateToken"],
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022"
}'
## Executive Summary
### Overall Risk Posture: HIGH
Your application has **24 identified threats** with **3 critical** and **8 high-risk** threats requiring immediate attention.
### Top 5 Critical Threats
1. **SQL Injection in Authentication Endpoint** (8.5/10)
- Allows unauthorized database access
- PCI-DSS compliance violation
- Related CVEs: CVE-2024-12345
- Threat Actors: APT28, Lazarus
2. **OAuth Token Theft via MITM** (8.0/10)
- Enables account takeover
- Affects all users
- No certificate pinning
3. **Privilege Escalation via API Misconfiguration** (7.8/10)
- Allows admin access from user role
- Missing authorization checks
### Key Recommendations
**Immediate (0-30 days):**
- Implement parameterized queries
- Add certificate pinning
- Fix authorization bypass
**Short-term (1-6 months):**
- Deploy WAF
- Implement database monitoring
- Add input validation framework
### Business Impact
**Financial Risk:** $2M+ in potential fines and remediation costs
**Compliance Status:** ❌ FAILING PCI-DSS requirements 6.5.1, 6.5.8
**Reputation Risk:** HIGH - data breach could affect 100,000+ customers
| Category | Threat | Risk Score | Affected Components |
|---|---|---|---|
| Spoofing | OAuth Token Theft via MITM | 8.0/10 | API Gateway, Auth Service |
| Tampering | SQL Injection in Login | 8.5/10 | Auth Service, Database |
| Information Disclosure | Database Exposure via API | 7.5/10 | API Gateway, Database |
| Elevation of Privilege | Authorization Bypass | 7.8/10 | API Gateway |
## SCENARIO_001: SQL Injection to Database Exfiltration
**Threat:** SQL Injection in Authentication Endpoint
**Risk Score:** 8.5/10
**Related CVEs:** CVE-2024-12345
### Attack Chain
1. **Initial Access** - SQL Injection
- Attacker identifies injection point in login endpoint
- MITRE ATT&CK: T1190
- Tools: sqlmap, Burp Suite
- Indicators: SQL error messages, failed login attempts
2. **Execution** - Database Enumeration
- Attacker enumerates database structure
- MITRE ATT&CK: T1213
- Indicators: Excessive queries, schema access
3. **Exfiltration** - Data Extraction
- Attacker extracts customer data via DNS tunneling
- MITRE ATT&CK: T1041
- Indicators: Unusual DNS queries
### Detection Opportunities
- WAF SQL injection detection
- Database query anomaly detection
- DNS tunneling detection
### Mitigations
- Implement parameterized queries
- Deploy WAF
- Add database monitoring
Version: 1.0
Last Updated: 2026-02-27
Status: Planned
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
threat-modeling, stride, dread, security-assessment, attack-tree
npx claudepluginhub security-phoenix-demo/security-skills-claude-code --plugin phoenix-security-review6 skills in this plugin
/0day-scannerLLM-powered zero-day vulnerability analysis of code changes — a commit, a pull request, a file or a branch — in light, standard or deep mode, with cost budgeting and knowledge-graph linking. Use whenever someone asks to scan for vulnerabilities, check for security issues, mentions 0-day or zero-day, or wants a specific commit, PR, diff or branch reviewed for security. Prefers the `analyze_for_zero_day_vulnerabilities` MCP tool and falls back to the per-language reference packs plus the 8-point check scoped to the diff. For a whole-repo pass use `security-assessment`.
/security-assessmentComprehensive OWASP Top 10 2025 and ASVS Level 1 security assessment across a whole codebase, with cost budgeting, knowledge-graph linking and automated test generation. Use whenever someone asks to run a security assessment, a security audit, a security check or a vulnerability assessment; mentions OWASP Top 10 or ASVS; or wants a full security pass before a release. Prefers the `run_security_assessment` MCP tool and falls back to the bundled OWASP/ASVS checklists and per-language reference packs when MCP is unreachable. For a diff-scoped pass use `0day-scanner`; for design risk use `threat-modeling`; for a threat-model-driven review use `tm-security-review`.
/security-reviewerMulti-language security review for web apps, APIs, and CLIs. Use whenever code is added or modified — new endpoints, auth/RBAC changes, template or DOM rendering, outbound HTTP, dependency updates, IaC/config changes, or end-of-feature reviews. Covers Python, JavaScript, TypeScript, Go, Rust, Java/Kotlin, Ruby, C#/.NET, plus shared OWASP Top 10 and ASVS L1 logic. Triggers on phrases like "security review", "review this for security", "audit this code", "is this safe", "AppSec check", "threat-model this change", "supply chain risk", "before I merge", or whenever a senior engineer would pause to ask "what could go wrong here". Pairs with the `security-reviewer` subagent and the session-start / pre-bash / post-edit hooks shipped alongside it./tm-quick-security-assessmentThe QUICK tier. Scope to a git worktree/branch and assess only what changed against a base — a fast, threat-model-aware pre-merge security pass (attack-surface delta + OWASP Top 10 on changed files) with the trust-direction gate applied. Composes the security-assessment + 0day-scanner (light) skills. Use for "quick security assessment on this branch", pre-merge review of a worktree/diff, or a fast posture check. For a comprehensive whole-repo review with a full threat model as input, use tm-security-review./tm-security-reviewThe COMPREHENSIVE tier. Build (or ingest) a full STRIDE threat model as input, then run a sophisticated whole-repo adversarial zeroday exploit review (triple-pass HUNT -> JUDGE -> VERIFY) that validates the model against the code and proves a runnable PoC per confirmed finding. Composes the threat-modeling + 0day-scanner (deep) skills. Use for "tm security review", a deep exploit-focused review with a threat model, or any agentic/LLM/MCP codebase where design risk outweighs pattern bugs. Ask about deployment/trust context when unclear. For a quick pre-merge diff pass instead, use tm-security-assessment.Other plugins' skills for the same job