Proposal: AI-Assisted Threat Modeling Workflow — A Practical Implementation for Complex Systems #31
Replies: 3 comments 2 replies
|
hi Thank you @zhangtianqi-james for this thorough contribution. this is exactly the kind of community work that moves the project forward. Answers to your three questionsDoes this align with SecOpsTM's direction? What is most valuable for the community?
Should this stay as a separate project? Integration plan1. Skill →
|
|
hi @zhangtianqi-james i'm working on it https://github.com/ellipse2v/SecOpsTM/tree/skills de66d9b |
|
Hi @zhangtianqi-james, the feature is now deployed. Thanks a lot for your contribution! You can test it out now. :) Would you be open to a private discussion? I'd love to tag you on LinkedIn to give you credit for this idea if that's okay with you! in order to try yo have more users |
Uh oh!
There was an error while loading. Please reload this page.
Proposal: AI-Assisted Threat Modeling Workflow — A Practical Implementation for Complex Systems
Abstract: Manual threat modeling for complex systems is hard. I've developed an workflow(skills) that reduces effort from 4-8 hours to 10-30 minutes with ~85% validation pass rate. While SecOpsTM's AI dialog generates quick prototypes from single prompts, this skill delivers production-quality threat models through structured 10-step workflows with source traceability, automated validation, and complete output artifacts (model + context + BOM + config/asset_types_community.yaml + config/protocols_community.yaml). Proposing to integrate parts of this workflow (skill) into SecOpsTM mainline.
I'm open to your guidance on:
Background
After proposing the Custom Asset Type Support feature in discussion #27, I encountered a practical implementation challenge:
When modeling specialized systems (e.g., DJI Power Inspection Drone, industrial IoT, SCADA equipment), manually creating a complete threat model with all required DSL fields is extremely difficult without:
The gap: Even with custom asset type support, users still face a high barrier to entry for creating production-quality threat models.
Problem Statement
Current Workflow Limitations
config/asset_types_community.yamlsecopstm --model-file model.mdReal-World Example
Modeling a DJI Power Inspection Drone System requires:
uav-platform,flight-controller,gcs-software)OCUSync-3,Lightbridge,DJI-SDK)Manual effort: 4-8 hours for an experienced security architect, with high risk of errors.
Proposed Solution: AI-Assisted Threat Modeling Workflow
I've developed a structured AI-assisted workflow that addresses these pain points. The workflow is implemented as an Agent skill (for Claude Code / OpenCode) that guides users through a 10-step process:
Workflow Overview
Step 1: Information Gathering → Search public sources, document findings Step 2: Information Staging → Structured storage in .tm-raw/ directory Step 3: Complexity Assessment → Determine single-model vs multi-subsystem Step 4: Custom Type Detection → Auto-detect non-standard assets/protocols Step 5: Strategy Confirmation → Present modeling strategy, wait for user approval Step 6: Model Generation → Generate model.md from staging files Step 7: Context/BOM Generation → Auto-generate YAML files with scripts Step 8: Config Generation → Create config/ for custom types/protocols Step 9: User Review → User supplements sensitive information Step 10: Validation → Run validate_model.py, ensure 0 failures
Key Features
1. Structured Information Collection
{system-name}/.tm-raw/
├── _search-log.md # Search keywords, URLs, timestamps, credibility
├── architecture.md # System architecture
├── assets.md # Asset inventory
├── actors.md # Actor definitions
├── boundaries.md # Boundary information
├── data.md # Data assets
├── dataflows.md # Data flow information
├── security.md # Security controls
├── context.md # GDAF context
├── protocol-styles.md # Protocol styles
├── severity.md # Severity multipliers
├── mitre-mapping.md # Custom MITRE mapping
└── compliance.md # Compliance requirements
Benefits:
Conflict:)To be supplemented:)2. Automated Validation
3. Script-Based Generation
Context YAML Generation:
python scripts/generate_context.py --model model.md --output context/ # Auto-generates: attack_objectives, threat_actors, risk_criteriaBOM YAML Generation:
python scripts/generate_bom.py --model model.md --output BOM/ # Auto-generates: one simple YAML file per ServerBenefits:
✅ No manual YAML writing (avoids format errors)
✅ Consistent structure (follows SecOpsTM conventions)
✅ GDAF-ready (includes all required fields)
4. Output Structure
Single-Model (≤15 Servers):
{system-name}/
├── model.md
├── context/
│ └── {system-name}_context.yaml
├── BOM/
│ └── {asset_name}.yaml
└── config/ # Optional
├── asset_types_community.yaml
└── protocols_community.yaml
Multi-Subsystem (>15 Servers):
{project-name}/
├── main.md # Top-level architecture
├── context/
│ └── {project-name}_context.yaml # Global Context
├── {subsystem1}/
│ ├── model.md
│ └── BOM/
└── config/ # Optional
├── asset_types_community.yaml
└── protocols_community.yaml
Implementation Status
Current State
The workflow is implemented as an Agent skill (for Agents like Claude Code / OpenCode) with:
✅ 10-step structured workflow
✅ Information staging format (.tm-raw/ directory)
✅ Validation scripts (validate_model.py)
✅ Generation scripts (generate_context.py, generate_bom.py)
✅ Comprehensive documentation (11 reference files)
✅ Example projects (DJI Power Inspection Drone System)
Skill Repository Structure
tm-en/
├── SKILL.md # Main skill instructions (316 lines)
├── references/
│ ├── workflow.md # Information collection checklist
│ ├── dsl-syntax.md # DSL syntax details
│ ├── staging-format.md # Information staging format
│ ├── naming-conventions.md # Naming conventions
│ ├── custom-asset-types.md # Custom types/protocols
│ ├── modeling-strategy.md # Single/multi-subsystem
│ ├── context-format.md # Context YAML format
│ ├── bom-format.md # BOM YAML format
│ └── ... (3 more files)
└── scripts/
├── generate_context.py # Context YAML generator
├── generate_bom.py # BOM YAML generator
├── validate_model.py # Model validator
└── requirements.txt
Attachment
I've prepared the full skill implementation as a reference attachment tm-skill.zip
Skill Repository: skill-tm/ directory (SKILL.md + reference/ + scripts/)
Agent output model files: dji-power-inspection/
Example Project report: DJI_Power_Inspection_Drone_System_20260517_203033/ (real-world example)
Please review when convenient. I'm happy to provide more details or discuss implementation specifics. Sharing this skill as a reference contribution — hoping to help make SecOpsTM even better. Feel free to adapt any parts that might be useful.
All reactions