v3.0.3 Report Enhancement Design Document
Version: 3.0.3
Date: 2026-02-09
Status: Approved
1. Problem Diagnosis
1.1 Structural Problems
- Main report has only 9 sections, missing a high-level risk posture overview (dashboard view)
- No per-risk detailed analysis reports — all risks condensed into summary tables
- No HTML output — only Markdown, which is hard to read on screen
1.2 Content Quality Problems
- §1 Executive Summary: Only Top-3 critical risks, only 5 key findings → insufficient
- §2 System Architecture Overview: Missing dependency graph, tech stack security context, entry point quantification, criticality notation
- §3 Security Design Assessment: Missing security scorecard, domain evaluation detail, threat-gap traceability matrix, gap categorization
- §5 Risk Validation: POC content sometimes summarized despite prohibition
- §6 Attack Path Analysis: ASCII diagrams only, no Mermaid for complex flows
- §8 Mitigation: Missing implementation difficulty and effort breakdown
1.3 Readability Problems
- Monotonous text formatting, no visual hierarchy
- No diagram support beyond ASCII art
- Large tables without color-coding for severity
- No navigation or cross-reference structure
2. Three-Layer Enhancement Plan
Layer 1: Main Report Optimization (10-Section Template)
Expand from 9 sections to 10 sections. Optimize ALL existing sections.
§0 Risk Posture Overview (NEW)
- Top-10 Risk Cards: Each card shows VR-ID, title, CVSS, STRIDE type, priority, affected modules
- STRIDE × Severity Heatmap Matrix: 6×4 grid (S/T/R/I/D/E × CRITICAL/HIGH/MEDIUM/LOW)
- Key Metrics Dashboard:
- Total risks by priority (P0/P1/P2/P3)
- Average CVSS score
- Attack surface breadth (entry points × boundaries)
- Mitigation coverage ratio
§1 Executive Summary (ENHANCED)
- 10 Key Findings (was 5)
- Immediate Action Items: Top-3 P0 with responsible team and deadline
- Assessment Scope Summary: project path, tech stack, module count, analysis duration
§2 System Architecture Overview (ENHANCED)
- Dependency Graph: Module dependency visualization (ASCII in .md, Mermaid in HTML)
- Tech Stack Security Context: Framework versions with known CVE status
- Entry Point Quantification: Count by type (API/UI/CLI/WebSocket/gRPC), with auth status
- Trust Boundary Mechanisms: Summary of controls at each boundary crossing
- Criticality Notation: Mark security-critical modules with ⚠️ in component table
- Security Observations from P1-P3: Inline findings with F-xxx references
§3 Security Design Assessment (ENHANCED)
- Security Scorecard: Standardized X/100 score per domain (16 domains)
- Domain Evaluation Detail: For each domain: checks performed, checks passed, gaps found, coverage %
- Threat-Gap Traceability Matrix: GAP-xxx → T-xxx → VR-xxx cross-reference table
- Gap Categorization: G-ARCH (architecture redesign), G-IMPL (code/config fix), G-PROC (policy/process)
- Control Flow Diagram: Security control assessment workflow (ASCII)
- Priority Matrix: Gap severity × effort matrix for remediation planning
§4 STRIDE Threat Analysis (MAINTAINED)
- Keep current structure, no changes needed
§5 Risk Validation & POC Design (ENHANCED)
- Complete POC Content: Enforce verbatim copy with code blocks
- Verification Status Badges: ✅ Verified | ⚠️ Theoretical | ❓ Pending | ❌ Excluded
- POC Execution Environment: Required tools, environment setup instructions
§6 Attack Path Analysis (ENHANCED)
- DFD Report: ASCII + Mermaid diagrams side-by-side in .md
- Other .md reports: ASCII diagrams only
- HTML reports: Rendered Mermaid via CDN
§7 Threat Priority Matrix (MAINTAINED)
- Keep current structure, no changes needed
§8 Mitigation Recommendations (ENHANCED)
- Implementation Difficulty Rating: LOW/MEDIUM/HIGH per mitigation
- Effort Breakdown: Estimated hours/days per mitigation
- Before/After Code Comparison: Side-by-side diff format
- Dependency Chain: MIT-xxx prerequisite relationships
§9 Compliance Mapping (MAINTAINED)
- Keep current structure, no changes needed
Layer 2: P8R Detailed Risk Reports (NEW)
Optional post-P8 phase generating per-VR detailed analysis reports.
Trigger Conditions
- P8 completion prompt: "Generate detailed risk analysis? [Y/N]"
--detailed flag at session start
- Standalone invocation:
phase_data.py --p8r --session {SESSION_ID}
Output Structure
Risk_Assessment_Report/
└── detailed/
├── VR-001-{title-slug}.md
├── VR-002-{title-slug}.md
└── ...
12 Analysis Elements Per VR Report
| # |
Element |
Description |
| 1 |
Risk Overview |
VR-ID, title, CVSS, CWE, priority, STRIDE, affected assets (table) |
| 2 |
Entry Points |
All attack entry points with conditions and triggers |
| 3 |
Data Flow Analysis |
Complete data flow from entry to vulnerable point (ASCII diagram) |
| 4 |
Root Cause Analysis |
Why the vulnerability exists, code-level root cause with file:line |
| 5 |
Exploit Scenario |
Step-by-step exploitation procedure |
| 6 |
POC Code |
Complete executable POC (verbatim from P6) |
| 7 |
Impact Analysis |
Business impact, data sensitivity, blast radius |
| 8 |
Attack Chain Context |
Which AC-xxx chains include this VR, position in chain |
| 9 |
Related Vulnerabilities |
CWE details, related CVEs, CAPEC attack patterns |
| 10 |
Mitigation Strategy |
Complete MIT-xxx details with before/after code |
| 11 |
Verification Method |
Test cases (TC-xxx), ASVS/WSTG references |
| 12 |
References & Traceability |
F-xxx → GAP-xxx → T-xxx → VR-xxx → MIT-xxx chain |
Reference Standard
- VR-Analysis samples at
~/STRIDE/test/e/EDA代码文件/Risk_Assessment_Report/VR-Analysis/*.md
- 20 VR reports (VR-001 through VR-020), each 4K-30K characters
Layer 3: HTML Output Support (NEW)
HTML Report Generator (scripts/report_generator.py)
Batch MD→HTML converter with:
- Terminal aesthetic CSS (reuse from md_to_html.py)
- CJK font stack (Sarasa Term SC, Noto Sans Mono CJK SC, PingFang SC)
- Mermaid CDN rendering (client-side via
<script src="mermaid.min.js">)
- Severity color coding (CRITICAL=red, HIGH=orange, MEDIUM=yellow, LOW=blue)
- Navigation sidebar with report index
- Index page (index.html) with links to all reports
- Print-friendly media queries
Output Structure:
Risk_Assessment_Report/
└── html/
├── index.html ← Report index page
├── RISK-ASSESSMENT-REPORT.html ← Main report
├── RISK-INVENTORY.html
├── MITIGATION-MEASURES.html
├── PENETRATION-TEST-PLAN.html
├── ARCHITECTURE-ANALYSIS.html
├── DFD-DIAGRAM.html
├── COMPLIANCE-REPORT.html
├── ATTACK-PATH-VALIDATION.html
└── detailed/ ← If P8R was executed
├── VR-001-{slug}.html
└── ...
Mermaid Rendering Strategy:
- In .md files: ASCII diagrams (always readable)
- In DFD .md: ASCII + Mermaid source side-by-side
- In HTML: Mermaid source rendered via client-side JS
- Mermaid CDN:
https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
3. Implementation File List
| # |
File |
Action |
Description |
| T1 |
docs/REPORT-DESIGN.md |
CREATE |
This design document |
| T2 |
phases/P8-REPORT-GENERATION.md |
MODIFY |
Expand to 10-section template |
| T3 |
phases/P8R-DETAILED-REPORT.md |
CREATE |
New P8R phase instructions |
| T4 |
assets/contracts/data-model.yaml |
MODIFY |
Add DetailedRiskReport + P8R manifest |
| T5 |
scripts/report_generator.py |
CREATE |
MD→HTML batch converter |
| T6 |
SKILL.md |
MODIFY |
Add --detailed flag, update directory structure |
| T7 |
WORKFLOW.md |
MODIFY |
Add P8R optional phase |
4. Design Decisions
| # |
Decision |
Rationale |
| D1 |
Top-10 risk cards (not Top-5) |
Better coverage for comprehensive assessments |
| D2 |
10 key findings (not 5) |
More thorough executive summary |
| D3 |
DFD: ASCII + Mermaid side-by-side in .md |
Maximum compatibility + visual richness |
| D4 |
Other .md: ASCII only |
Keeps non-DFD reports simple and portable |
| D5 |
HTML: Mermaid via CDN |
Client-side rendering, no server dependency |
| D6 |
Reuse md_to_html.py CSS aesthetic |
Consistent visual identity across reports |
| D7 |
P8R as optional post-P8 phase |
Doesn't break existing P1-P8 workflow |
| D8 |
Gap categorization: G-ARCH/G-IMPL/G-PROC |
Clear remediation responsibility assignment |
| D9 |
Security scorecard X/100 per domain |
Quantifiable, comparable across projects |
| D10 |
12 analysis elements per VR |
Matches reference VR-Analysis samples |
5. Backward Compatibility
- Existing P1-P8 workflow unchanged
- P8R is optional (only triggered by --detailed flag or user confirmation)
- HTML output is additive (generated alongside existing .md reports)
- No changes to PostToolUse hook behavior
- No changes to phase_data.py validation logic
End of Report Enhancement Design Document
1---2name: 2844-report-design-874a71e13description: <!-- Threat Modeling Skill | Version 3.0.3 | https://github.com/fr33d3m0n/threat-modeling | License: BSD-3-Clause -->4---5<!-- Threat Modeling Skill | Version 3.0.3 | https://github.com/fr33d3m0n/threat-modeling | License: BSD-3-Clause -->67# v3.0.3 Report Enhancement Design Document89**Version**: 3.0.310**Date**: 2026-02-0911**Status**: Approved1213---1415## 1. Problem Diagnosis1617### 1.1 Structural Problems18- Main report has only 9 sections, missing a high-level risk posture overview (dashboard view)19- No per-risk detailed analysis reports — all risks condensed into summary tables20- No HTML output — only Markdown, which is hard to read on screen2122### 1.2 Content Quality Problems23- §1 Executive Summary: Only Top-3 critical risks, only 5 key findings → insufficient24- §2 System Architecture Overview: Missing dependency graph, tech stack security context, entry point quantification, criticality notation25- §3 Security Design Assessment: Missing security scorecard, domain evaluation detail, threat-gap traceability matrix, gap categorization26- §5 Risk Validation: POC content sometimes summarized despite prohibition27- §6 Attack Path Analysis: ASCII diagrams only, no Mermaid for complex flows28- §8 Mitigation: Missing implementation difficulty and effort breakdown2930### 1.3 Readability Problems31- Monotonous text formatting, no visual hierarchy32- No diagram support beyond ASCII art33- Large tables without color-coding for severity34- No navigation or cross-reference structure3536---3738## 2. Three-Layer Enhancement Plan3940### Layer 1: Main Report Optimization (10-Section Template)4142Expand from 9 sections to 10 sections. Optimize ALL existing sections.4344#### §0 Risk Posture Overview (NEW)45- **Top-10 Risk Cards**: Each card shows VR-ID, title, CVSS, STRIDE type, priority, affected modules46- **STRIDE × Severity Heatmap Matrix**: 6×4 grid (S/T/R/I/D/E × CRITICAL/HIGH/MEDIUM/LOW)47- **Key Metrics Dashboard**:48 - Total risks by priority (P0/P1/P2/P3)49 - Average CVSS score50 - Attack surface breadth (entry points × boundaries)51 - Mitigation coverage ratio5253#### §1 Executive Summary (ENHANCED)54- **10 Key Findings** (was 5)55- **Immediate Action Items**: Top-3 P0 with responsible team and deadline56- **Assessment Scope Summary**: project path, tech stack, module count, analysis duration5758#### §2 System Architecture Overview (ENHANCED)59- **Dependency Graph**: Module dependency visualization (ASCII in .md, Mermaid in HTML)60- **Tech Stack Security Context**: Framework versions with known CVE status61- **Entry Point Quantification**: Count by type (API/UI/CLI/WebSocket/gRPC), with auth status62- **Trust Boundary Mechanisms**: Summary of controls at each boundary crossing63- **Criticality Notation**: Mark security-critical modules with ⚠️ in component table64- **Security Observations from P1-P3**: Inline findings with F-xxx references6566#### §3 Security Design Assessment (ENHANCED)67- **Security Scorecard**: Standardized X/100 score per domain (16 domains)68- **Domain Evaluation Detail**: For each domain: checks performed, checks passed, gaps found, coverage %69- **Threat-Gap Traceability Matrix**: GAP-xxx → T-xxx → VR-xxx cross-reference table70- **Gap Categorization**: G-ARCH (architecture redesign), G-IMPL (code/config fix), G-PROC (policy/process)71- **Control Flow Diagram**: Security control assessment workflow (ASCII)72- **Priority Matrix**: Gap severity × effort matrix for remediation planning7374#### §4 STRIDE Threat Analysis (MAINTAINED)75- Keep current structure, no changes needed7677#### §5 Risk Validation & POC Design (ENHANCED)78- **Complete POC Content**: Enforce verbatim copy with code blocks79- **Verification Status Badges**: ✅ Verified | ⚠️ Theoretical | ❓ Pending | ❌ Excluded80- **POC Execution Environment**: Required tools, environment setup instructions8182#### §6 Attack Path Analysis (ENHANCED)83- **DFD Report**: ASCII + Mermaid diagrams **side-by-side** in .md84- **Other .md reports**: ASCII diagrams only85- **HTML reports**: Rendered Mermaid via CDN8687#### §7 Threat Priority Matrix (MAINTAINED)88- Keep current structure, no changes needed8990#### §8 Mitigation Recommendations (ENHANCED)91- **Implementation Difficulty Rating**: LOW/MEDIUM/HIGH per mitigation92- **Effort Breakdown**: Estimated hours/days per mitigation93- **Before/After Code Comparison**: Side-by-side diff format94- **Dependency Chain**: MIT-xxx prerequisite relationships9596#### §9 Compliance Mapping (MAINTAINED)97- Keep current structure, no changes needed9899### Layer 2: P8R Detailed Risk Reports (NEW)100101Optional post-P8 phase generating per-VR detailed analysis reports.102103#### Trigger Conditions1041. P8 completion prompt: "Generate detailed risk analysis? [Y/N]"1052. `--detailed` flag at session start1063. Standalone invocation: `phase_data.py --p8r --session {SESSION_ID}`107108#### Output Structure109```110Risk_Assessment_Report/111└── detailed/112 ├── VR-001-{title-slug}.md113 ├── VR-002-{title-slug}.md114 └── ...115```116117#### 12 Analysis Elements Per VR Report118119| # | Element | Description |120|---|---------|-------------|121| 1 | Risk Overview | VR-ID, title, CVSS, CWE, priority, STRIDE, affected assets (table) |122| 2 | Entry Points | All attack entry points with conditions and triggers |123| 3 | Data Flow Analysis | Complete data flow from entry to vulnerable point (ASCII diagram) |124| 4 | Root Cause Analysis | Why the vulnerability exists, code-level root cause with file:line |125| 5 | Exploit Scenario | Step-by-step exploitation procedure |126| 6 | POC Code | Complete executable POC (verbatim from P6) |127| 7 | Impact Analysis | Business impact, data sensitivity, blast radius |128| 8 | Attack Chain Context | Which AC-xxx chains include this VR, position in chain |129| 9 | Related Vulnerabilities | CWE details, related CVEs, CAPEC attack patterns |130| 10 | Mitigation Strategy | Complete MIT-xxx details with before/after code |131| 11 | Verification Method | Test cases (TC-xxx), ASVS/WSTG references |132| 12 | References & Traceability | F-xxx → GAP-xxx → T-xxx → VR-xxx → MIT-xxx chain |133134#### Reference Standard135- VR-Analysis samples at `~/STRIDE/test/e/EDA代码文件/Risk_Assessment_Report/VR-Analysis/*.md`136- 20 VR reports (VR-001 through VR-020), each 4K-30K characters137138### Layer 3: HTML Output Support (NEW)139140#### HTML Report Generator (`scripts/report_generator.py`)141142**Batch MD→HTML converter** with:143- Terminal aesthetic CSS (reuse from md_to_html.py)144- CJK font stack (Sarasa Term SC, Noto Sans Mono CJK SC, PingFang SC)145- Mermaid CDN rendering (client-side via `<script src="mermaid.min.js">`)146- Severity color coding (CRITICAL=red, HIGH=orange, MEDIUM=yellow, LOW=blue)147- Navigation sidebar with report index148- Index page (index.html) with links to all reports149- Print-friendly media queries150151**Output Structure**:152```153Risk_Assessment_Report/154└── html/155 ├── index.html ← Report index page156 ├── RISK-ASSESSMENT-REPORT.html ← Main report157 ├── RISK-INVENTORY.html158 ├── MITIGATION-MEASURES.html159 ├── PENETRATION-TEST-PLAN.html160 ├── ARCHITECTURE-ANALYSIS.html161 ├── DFD-DIAGRAM.html162 ├── COMPLIANCE-REPORT.html163 ├── ATTACK-PATH-VALIDATION.html164 └── detailed/ ← If P8R was executed165 ├── VR-001-{slug}.html166 └── ...167```168169**Mermaid Rendering Strategy**:170- In .md files: ASCII diagrams (always readable)171- In DFD .md: ASCII + Mermaid source side-by-side172- In HTML: Mermaid source rendered via client-side JS173- Mermaid CDN: `https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js`174175---176177## 3. Implementation File List178179| # | File | Action | Description |180|---|------|--------|-------------|181| T1 | docs/REPORT-DESIGN.md | CREATE | This design document |182| T2 | phases/P8-REPORT-GENERATION.md | MODIFY | Expand to 10-section template |183| T3 | phases/P8R-DETAILED-REPORT.md | CREATE | New P8R phase instructions |184| T4 | assets/contracts/data-model.yaml | MODIFY | Add DetailedRiskReport + P8R manifest |185| T5 | scripts/report_generator.py | CREATE | MD→HTML batch converter |186| T6 | SKILL.md | MODIFY | Add --detailed flag, update directory structure |187| T7 | WORKFLOW.md | MODIFY | Add P8R optional phase |188189---190191## 4. Design Decisions192193| # | Decision | Rationale |194|---|----------|-----------|195| D1 | Top-10 risk cards (not Top-5) | Better coverage for comprehensive assessments |196| D2 | 10 key findings (not 5) | More thorough executive summary |197| D3 | DFD: ASCII + Mermaid side-by-side in .md | Maximum compatibility + visual richness |198| D4 | Other .md: ASCII only | Keeps non-DFD reports simple and portable |199| D5 | HTML: Mermaid via CDN | Client-side rendering, no server dependency |200| D6 | Reuse md_to_html.py CSS aesthetic | Consistent visual identity across reports |201| D7 | P8R as optional post-P8 phase | Doesn't break existing P1-P8 workflow |202| D8 | Gap categorization: G-ARCH/G-IMPL/G-PROC | Clear remediation responsibility assignment |203| D9 | Security scorecard X/100 per domain | Quantifiable, comparable across projects |204| D10 | 12 analysis elements per VR | Matches reference VR-Analysis samples |205206---207208## 5. Backward Compatibility209210- Existing P1-P8 workflow unchanged211- P8R is optional (only triggered by --detailed flag or user confirmation)212- HTML output is additive (generated alongside existing .md reports)213- No changes to PostToolUse hook behavior214- No changes to phase_data.py validation logic215216---217218**End of Report Enhancement Design Document**