Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计异常

threat-modeling威胁建模

Agent Skill

threat-modeling 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

264

周安装

11

GitHub Stars

262

下载量

88
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:threat-modeling(威胁建模)
来源仓库:https://github.com/fr33d3m0n/threat-modeling
仓库路径:skills/threat-modeling
安装命令:
npx skills add https://github.com/fr33d3m0n/threat-modeling --skill threat-modeling
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/fr33d3m0n/threat-modeling --skill threat-modeling

简介

threat-modeling 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 可通过 npx skills add 命令从指定仓库安装并使用。
  • 安装前需确认权限范围、维护状态及是否触发联网或文件操作。
  • 建议结合原始 README 核验具体用法和功能细节。

SKILL.md

Note: All relative paths in this skill are relative to SKILL_PATH / CLAUDE_SKILL_DIR (the directory containing this SKILL.md file). Use ${SKILL_PATH:-$CLAUDE_SKILL_DIR} in Bash commands for cross-runtime compatibility.

Threat Modeling Skill v3.1.1 (20260420a)

AI-native automated software risk analysis skill. LLM-driven, Code-First approach for comprehensive security risk assessment, threat modeling, security testing, penetration testing, and compliance checking.

Version Banner

━━━ 🛡️ Threat Modeling Skill v3.1.1 (20260420a) ━━━

Command Line Flags

FlagDescriptionDefault
--debugPublish internal YAML data files, KB queries, coverage validation, and evaluation reportOFF
--lang=xxSet output language (en, zh, ja, ko, es, fr, de, pt, ru)Auto-detect
--detailedAuto-trigger P8R (detailed per-VR analysis reports) after P8 completesOFF

Usage Examples:

# Default mode - 11 deliverable files only
/threat-model @my-project

# Debug mode - all internal files published
/threat-model @my-project --debug

# Chinese output with debug
/threat-model @my-project --lang=zh --debug

# Generate detailed per-VR analysis reports after P8
/threat-model @my-project --detailed

# Full options
/threat-model @my-project --detailed --debug --lang=zh

⚠️ CRITICAL: Data vs Report Separation

PRINCIPLE: Markdown is for reports (human-readable), YAML is for data (machine-readable). They MUST be separated!
┌─────────────────────────────────────────────────────────────────────┐
│  DUAL OUTPUT MODEL - Each phase produces TWO files:                 │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  1. DATA FILE (.yaml) - PRIMARY                                     │
│     • Written FIRST                                                  │
│     • Structured, machine-readable                                   │
│     • Used by NEXT phase as input                                    │
│     • Path: .phase_working/{SESSION_ID}/data/P{N}_*.yaml            │
│                                                                      │
│  2. REPORT FILE (.md) - SECONDARY                                   │
│     • Written AFTER data file                                        │
│     • Human-readable, formatted                                      │
│     • For review and documentation                                   │
│     • Path: .phase_working/{SESSION_ID}/reports/P{N}-*.md           │
│                                                                      │
│  ❌ FORBIDDEN: Reading .md files for data extraction                │
│  ❌ FORBIDDEN: Embedding data as yaml blocks inside .md AS SOURCE   │
│  ✅ ALLOWED: YAML blocks in .md for schema documentation/examples   │
│  ✅ REQUIRED: Data flows via .yaml files only                       │
│                                                                      │
└─────────────────────────────────────────────────────────────────────┘

§1 Execution Model

Mode: Full Assessment Only - All 8 phases executed sequentially.

Phase 1 ──► Phase 2 ──► Phase 3 ──► Phase 4 ──► Phase 5 ──► Phase 6 ──► Phase 7 ──► Phase 8
   │            │            │            │            │            │            │
   ▼            ▼            ▼            ▼            ▼            ▼            ▼
P1.yaml ──► P2.yaml ──► P3.yaml ──► P4.yaml ──► P5.yaml ──► P6.yaml ──► P7.yaml ──► P8.yaml

Rules:

  1. Phases execute strictly in order (1→8)
  2. Each phase reads previous phase's YAML, writes its own YAML
  3. Each phase also writes a human-readable.md report
  4. Validation runs on YAML files, not.md files
  5. Phase 6 = Risk Validation (NOT mitigation)
  6. Phase 7 = Mitigation Planning (AFTER validation)

Phase Gate Protocol:

FOR each phase N in [1..8]:
    1. Read: @phases/P{N}-*.md (instructions)
    2. Read: .phase_working/{SESSION_ID}/data/P{N-1}_*.yaml (input, except P1)
    3. Execute analysis per phase instructions
    4. Write: .phase_working/{SESSION_ID}/data/P{N}_*.yaml (PRIMARY output)
    5. Write: .phase_working/{SESSION_ID}/reports/P{N}-*.md (SECONDARY output)
    6. Hook validates YAML file
    7. IF exit != 0: Fix YAML and rewrite
    8. IF exit == 0: Update session meta, continue to N+1

§2 Output Convention

Output Modes

┌─────────────────────────────────────────────────────────────────────┐
│  OUTPUT MODES - Control what files are generated                    │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  DEFAULT MODE (Production)                                          │
│  ─────────────────────────────────────────────────────────────────  │
│  Only user-deliverable files are published:                         │
│  ✅ 4 Required Reports (RISK-ASSESSMENT, INVENTORY, MITIGATION,    │
│                         PENETRATION-TEST-PLAN)                      │
│  ✅ 7 Phase Reports (P1-P7-*.md) for audit trail                    │
│  ❌ .phase_working/ - NOT published (kept internally)               │
│  ❌ YAML data files - NOT published                                 │
│  ❌ EVALUATION-REPORT.md - NOT published                            │
│                                                                      │
│  DEBUG MODE (--debug flag)                                          │
│  ─────────────────────────────────────────────────────────────────  │
│  All files are published including internal data:                   │
│  ✅ All default mode outputs                                        │
│  ✅ .phase_working/{SESSION_ID}/data/*.yaml - Published             │
│  ✅ P5_knowledge_base_queries.yaml - Published                      │
│  ✅ P8_coverage_validation.yaml - Published                         │
│  ✅ EVALUATION-REPORT.md - Published                                │
│                                                                      │
│  Usage: /threat-model @project --debug                              │
│                                                                      │
└─────────────────────────────────────────────────────────────────────┘

Directory Structure

Default Mode (11 files published):

{PROJECT_ROOT}/
└── Risk_Assessment_Report/
    ├── {PROJECT}-RISK-ASSESSMENT-REPORT.md    ← Required (P8)
    ├── {PROJECT}-RISK-INVENTORY.md            ← Required (P6)
    ├── {PROJECT}-MITIGATION-MEASURES.md       ← Required (P7)
    ├── {PROJECT}-PENETRATION-TEST-PLAN.md     ← Required (P6)
    ├── P1-PROJECT-UNDERSTANDING.md            ← Phase reports
    ├── P2-DFD-ANALYSIS.md
    ├── P3-TRUST-BOUNDARY.md
    ├── P4-SECURITY-DESIGN-REVIEW.md
    ├── P5-STRIDE-THREATS.md
    ├── P6-RISK-VALIDATION.md
    ├── P7-MITIGATION-PLAN.md
    ├── detailed/                              ← P8R only (--detailed flag)
    │   ├── VR-001-{title-slug}.md
    │   └── ...
    └── html/                                  ← HTML output (report_generator.py)
        ├── index.html
        ├── {PROJECT}-RISK-ASSESSMENT-REPORT.html
        ├── ...
        └── detailed/
            └── VR-001-{slug}.html

Debug Mode (--debug, full structure):

{PROJECT_ROOT}/
└── Risk_Assessment_Report/
    ├── {PROJECT}-RISK-ASSESSMENT-REPORT.md    ← Main report (from P8)
    ├── {PROJECT}-RISK-INVENTORY.md            ← From P6 YAML
    ├── {PROJECT}-MITIGATION-MEASURES.md       ← From P7 YAML
    ├── {PROJECT}-PENETRATION-TEST-PLAN.md     ← From P6 YAML
    ├── {PROJECT}-ARCHITECTURE-ANALYSIS.md     ← From P1-P3 YAML
    ├── {PROJECT}-DFD-DIAGRAM.md               ← From P2 YAML
    ├── {PROJECT}-COMPLIANCE-REPORT.md         ← From P4+P7 YAML
    ├── {PROJECT}-ATTACK-PATH-VALIDATION.md    ← From P6 YAML
    ├── P1-PROJECT-UNDERSTANDING.md            ← Published phase reports
    ├── P2-DFD-ANALYSIS.md
    ├── P3-TRUST-BOUNDARY.md
    ├── P4-SECURITY-DESIGN-REVIEW.md
    ├── P5-STRIDE-THREATS.md
    ├── P6-RISK-VALIDATION.md
    ├── EVALUATION-REPORT.md                   ← DEBUG ONLY
    └── .phase_working/                        ← DEBUG ONLY
        ├── _sessions_index.yaml               ← Multi-session index (optional)
        └── {SESSION_ID}/                      ← Session isolated directory
            ├── _session_meta.yaml             ← Session state
            ├── data/                          ← STRUCTURED DATA
            │   ├── P1_project_context.yaml
            │   ├── P2_dfd_elements.yaml
            │   ├── P3_boundary_context.yaml
            │   ├── P4_security_gaps.yaml
            │   ├── P5_threat_inventory.yaml
            │   ├── P5_knowledge_base_queries.yaml  ← KB transparency
            │   ├── P6_validated_risks.yaml
            │   ├── P7_mitigation_plan.yaml
            │   ├── P8_report_manifest.yaml
            │   └── P8_coverage_validation.yaml     ← Coverage metrics
            ├── reports/                       ← WORKING REPORTS
            │   └── (phase reports during execution)
            └── data/P8R_manifest.yaml         ← P8R manifest (--detailed only)

Naming Convention

  • PROJECT: Uppercase, max 30 chars, format: ^[A-Z][A-Z0-9-]{0,29}$
  • Example: OPEN-WEBUI, MY-PROJECT, STRIDE-DEMO

Session ID Format

  • SESSION_ID: {PROJECT_NAME}_{YYYYMMDD_HHMMSS}
  • Example: OPEN-WEBUI_20260130_143022

Session Metadata

# .phase_working/{SESSION_ID}/_session_meta.yaml
schema_version: "3.1.1 (20260420a)"
session_id: "OPEN-WEBUI_20260130_143022"  # {PROJECT}_{YYYYMMDD_HHMMSS}
project_name: "OPEN-WEBUI"
project_path: "/path/to/project"
started_at: "ISO8601 timestamp"
language: "en"
skill_version: "3.1.1 (20260420a)"

phases:
  P1:
    status: "completed"
    started_at: "2026-01-30T10:00:00Z"
    completed_at: "2026-01-30T10:30:00Z"
    data_file: "data/P1_project_context.yaml"
    report_file: "reports/P1-PROJECT-UNDERSTANDING.md"
  P2:
    status: "in_progress"
    # ...

§3 Core Data Model

See @assets/contracts/data-model.yaml for complete schema definitions.

Entity Types

EntityID FormatPhaseDescription
ModuleM-{Seq:03d}P1Code modules/components
FindingF-P{N}-{Seq:03d}P1-P3Security observations (factual)
GapGAP-{Seq:03d}P4Security control deficiencies
ThreatT-{STRIDE}-{Element}-{Seq}P5STRIDE threats
ValidatedRiskVR-{Seq:03d}P6Verified risks
MitigationMIT-{Seq:03d}P7Remediation measures
POCPOC-{Seq:03d}P6Proof of concept
AttackPathAP-{Seq:03d}P6Attack vectors (single path)
AttackChainAC-{Seq:03d}P6Multi-step attack sequences
TestCaseTC-{Seq:03d}P8Penetration test cases
DetailedRiskRpt(uses VR-{Seq:03d})P8RPer-VR analysis report

Finding vs Gap Semantic Boundary

  • Finding (F-P{N}-xxx): A factual observation from phases 1-3 that MAY have security implications. Findings are objective facts about architecture, data flows, or boundaries. Example: "API endpoint uses HTTP instead of HTTPS"
  • Gap (GAP-xxx): A security control deficiency identified in P4 after analyzing findings against security domains. Gaps represent missing or inadequate controls. Example: "Missing TLS enforcement (NETWORK domain)"

Transition Rule: Findings from P1-P3 feed into P4 analysis. P4 evaluates findings against 16 security domains and produces Gaps where controls are deficient.

DFD Element IDs

Element TypePrefixFormatExample
External InteractorEIEI-{NNN}EI-001
ProcessPP-{NNN}P-001
Data StoreDSDS-{NNN}DS-001
Data FlowDFDF-{NNN}DF-001
Trust BoundaryTBTB-{NNN}TB-001

Count Conservation (P5→P6 Threat Accounting)

P5.threat_count = P6.verified + P6.theoretical + P6.pending + P6.excluded

All threats from P5 must be accounted for in P6 (no threat loss).

Semantic Distinction:

  • Count Conservation: P5→P6 threat accounting (threats flow from P5 to P6 dispositions)
  • Element Coverage Verification: P2→P5 element coverage (every DFD element has STRIDE analysis)

§4 Security Knowledge Architecture

See @knowledge/ for complete reference materials (~11 MB, 113 files).

Three Knowledge Sets

  1. Security Control Set (What to do)

- 16 Security Domains (AUTHN, AUTHZ, INPUT, etc.) - Control Sets (18 files, 107 controls) - OWASP References (74 items) - Compliance Frameworks (14 frameworks)

  1. Threat Pattern Set (What to know)

- CWE Weaknesses (974) - CAPEC Attack Patterns (615) - ATT&CK Techniques (835) - CVE/KEV Vulnerabilities (323K+)

  1. Verification Set (How to test)

- WSTG Tests (121) - MASTG Tests (206) - ASVS Requirements (345)

Security Principles (11)

CodePrincipleDefinition
DIDDefense in DepthMultiple independent security controls
LPLeast PrivilegeMinimum permissions required
ZTZero TrustNever trust, always verify
FSFail SecureDefault to secure state on error
SODSeparation of DutiesCritical ops require multiple parties
SBDSecure by DefaultDefault config is secure
CMComplete MediationEvery access verified
EOMEconomy of MechanismSimple, auditable mechanisms
ODOpen DesignSecurity not dependent on secrecy
IVInput ValidationAll input validated
LALeast AgencyLimit AI agent autonomy

STRIDE Categories

STRIDENameCWEsCAPEC
SSpoofingCWE-287, 290, 307CAPEC-151, 194, 600
TTamperingCWE-20, 77, 78, 89CAPEC-66, 88, 248
RRepudiationCWE-117, 223, 778CAPEC-93
IInformation DisclosureCWE-200, 209, 311CAPEC-116, 157
DDenial of ServiceCWE-400, 770, 918CAPEC-125, 227
EElevation of PrivilegeCWE-269, 284, 862CAPEC-122, 233

§5 Knowledge Base Queries

kb Wrapper Usage

# Resolve skill path (works in Claude Code, Codex CLI, and manual testing)
SKILL_PATH=${SKILL_PATH:-${CLAUDE_SKILL_DIR:-$(bash skill_path.sh)}}

# STRIDE queries
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --stride spoofing
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --stride-controls S

# CWE queries
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --cwe CWE-89
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --full-chain CWE-89

# Attack patterns
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --capec CAPEC-89
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --attack-technique T1078

# Verification tests
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --stride-tests S
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --wstg-category ATHN

# LLM/AI extensions
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --all-llm
${SKILL_PATH:-$CLAUDE_SKILL_DIR}/kb --ai-component

§6 Language Adaptation

Output language follows context language unless --lang=xx specified.

ContextFile NamesContent
ChineseP1-项目理解.md中文
EnglishP1-PROJECT-UNDERSTANDING.mdEnglish

Supported: en, zh, ja, ko, es, fr, de, pt, ru


§7 Progressive Context Loading

This skill uses progressive disclosure:

  1. Always Loaded: This file (SKILL.md) - ~5.5K tokens
  2. Session Start: @WORKFLOW.md - ~4.8K tokens
  3. Per Phase: @phases/P{N}-*.md - ~4K-10K tokens each (varies by phase)

Total per-phase context: ~12K-18K tokens per phase (vs 30K monolithic)

Loading Pattern:

Session Start:
  1. Load SKILL.md (global rules)
  2. Load WORKFLOW.md (orchestration)
  3. Create 8 phase todos

Per Phase:
  1. Read @phases/P{N}-*.md
  2. Execute phase instructions
  3. Write to .phase_working/{SESSION_ID}/reports/P{N}-*.md
  4. Hook validates and extracts data

Post-P8 (Optional):
  1. If --detailed flag OR user confirms: Load @phases/P8R-DETAILED-REPORT.md
  2. Generate per-VR detailed analysis reports
  3. Write to Risk_Assessment_Report/detailed/VR-{NNN}-{slug}.md

§8 Reference Files

PathPurpose
@WORKFLOW.mdOrchestration contracts, phase gates
@phases/P{1-8}-*.mdPhase-specific instructions
@assets/contracts/data-model.yamlEntity schemas
@knowledge/security-design.yaml16 security domains
@knowledge/security-principles.yaml11 security principles
@knowledge/sast-rules.yamlSAST tool configs and STRIDE mappings
@scripts/module_discovery.pyP1 three-layer module discovery
@scripts/phase_data.pyPhase validation and extraction
@scripts/unified_kb_query.pyKnowledge base queries
@scripts/report_generator.pyMD→HTML batch converter
@phases/P8R-DETAILED-REPORT.mdOptional per-VR detailed reports
@docs/REPORT-DESIGN.mdv3.0.3+ report enhancement design
@skill_path.shSKILL_PATH resolution helper

§9 Quick Start

# 1. Start new session (default mode - 11 deliverable files)
/threat-model @my-project

# 2. With debug mode (all internal files published)
/threat-model @my-project --debug

# 3. Session execution:
#    - Claude loads SKILL.md + WORKFLOW.md automatically
#    - For each phase N (1-8): Read → Execute → Write → Validate
#    - Generate final reports in Risk_Assessment_Report/

Output Summary

ModeFiles PublishedUse Case
Default11 (4 required + 7 phase reports)Production delivery
--detailed11 + per-VR detailed reportsComprehensive assessment
--debug11 + YAML data + evaluationDevelopment, audit

§10 Core Execution Constraints (Invariants)

PRINCIPLE: The quality of threat modeling depends on execution rigor. The following constraints are INVIOLABLE.

Three Absolute Prohibitions

ConstraintDescriptionViolation Consequence
❌ NO MOCK DATAAll analysis must be based on real code evidenceAnalysis results invalid
❌ NO SIMPLIFIED IMPLEMENTATIONSEach phase must be fully executedCoverage requirements not met
❌ NO BYPASSING PROBLEMSMust diagnose root cause when blockedData chain broken

Phase Execution Invariant

∀ Phase N ∈ [1..8]:
  - Input: P{N-1}_*.yaml (except P1)
  - Output: P{N}_*.yaml (PRIMARY) + P{N}-*.md (SECONDARY)
  - Gate: Hook validation must return exit 0
  - Transition: Only proceed to N+1 after gate passes
Execution Protocol Details: See WORKFLOW.md §2 Phase Execution Protocol

§11 Phase Isolation Constraints

INVARIANT: Each Phase is an independent execution unit. FSM state transitions MUST follow strict sequential order.

Forbidden State Transitions

Illegal TransitionReason
Pn → Pn+2 (skip)Violates FSM order invariant (S1)
Pn → Pn+1 (unvalidated)Violates data contract completeness (S2)
Parallel Phase executionData dependencies cannot be satisfied
Complete FSM Specification: See WORKFLOW.md §1 Formal Properties: See docs/SKILL-ARCHITECTURE-DESIGN.md §0.2

End of SKILL.md (~540 lines, ~5.5K tokens)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.38%
按下载量换算30

Claude

33.57%
按下载量换算30

Cursor

19.45%
按下载量换算17

Gemini CLI

9.79%
按下载量换算9

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

未通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills