implementing-threat-modeling-with-mitre-attack
使用 MITRE ATT&CK 框架实施威胁建模,将对手 TTP 映射到组织资产, 评估检测覆盖缺口,并优化防御投资。 适用于 SOC 团队需要将检测工程与威胁态势对齐、对新环境开展威胁评估, 或为安全工具采购提供决策依据时。
Best use case
implementing-threat-modeling-with-mitre-attack is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
使用 MITRE ATT&CK 框架实施威胁建模,将对手 TTP 映射到组织资产, 评估检测覆盖缺口,并优化防御投资。 适用于 SOC 团队需要将检测工程与威胁态势对齐、对新环境开展威胁评估, 或为安全工具采购提供决策依据时。
Teams using implementing-threat-modeling-with-mitre-attack should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/implementing-threat-modeling-with-mitre-attack/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How implementing-threat-modeling-with-mitre-attack Compares
| Feature / Agent | implementing-threat-modeling-with-mitre-attack | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
使用 MITRE ATT&CK 框架实施威胁建模,将对手 TTP 映射到组织资产, 评估检测覆盖缺口,并优化防御投资。 适用于 SOC 团队需要将检测工程与威胁态势对齐、对新环境开展威胁评估, 或为安全工具采购提供决策依据时。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 使用 MITRE ATT&CK 实施威胁建模
## 适用场景
以下情况使用本技能:
- SOC 团队需要针对相关威胁行为者及其 TTP 评估检测覆盖率
- 安全领导层需要基于威胁的防御优先级排序
- 新环境(云迁移、OT 集成)需要制定检测策略规划
- 紫队演练需要基于威胁模型进行结构化的对手仿真
- 年度风险评估需要基于 ATT&CK 的威胁态势分析
**不适用于**一次性演练——威胁模型必须随着对手 TTP 演进和组织攻击面变化而持续更新。
## 前置条件
- 了解 MITRE ATT&CK 框架(Enterprise、ICS、Mobile 或 Cloud 矩阵)
- ATT&CK Navigator 工具(Web 版或本地版)用于层次可视化
- 已映射到 ATT&CK 技术 ID 的当前检测规则清单
- 针对所在行业的威胁行为者组织的威胁情报
- 含关键性分类的组织资产清单
## 工作流程
### 步骤 1:识别相关威胁行为者
使用 MITRE ATT&CK 组织数据库研究针对您所在行业的对手组织:
```python
import requests
import json
# 下载 ATT&CK STIX 数据
response = requests.get(
"https://raw.githubusercontent.com/mitre/cti/master/enterprise-attack/enterprise-attack.json"
)
attack_data = response.json()
# 提取组织及其技术
groups = {}
for obj in attack_data["objects"]:
if obj["type"] == "intrusion-set":
group_name = obj["name"]
aliases = obj.get("aliases", [])
description = obj.get("description", "")
groups[group_name] = {
"aliases": aliases,
"description": description[:200],
"techniques": []
}
# 通过关系映射技术到组织
relationships = [obj for obj in attack_data["objects"] if obj["type"] == "relationship"]
techniques = {obj["id"]: obj for obj in attack_data["objects"]
if obj["type"] == "attack-pattern"}
for rel in relationships:
if rel["relationship_type"] == "uses":
source = rel["source_ref"]
target = rel["target_ref"]
for group_name, group_data in groups.items():
if source == group_data.get("id") and target in techniques:
tech = techniques[target]
ext_refs = tech.get("external_references", [])
for ref in ext_refs:
if ref.get("source_name") == "mitre-attack":
group_data["techniques"].append(ref["external_id"])
# 示例:金融行业威胁行为者
financial_actors = ["FIN7", "FIN8", "Carbanak", "APT38", "Lazarus Group"]
for actor in financial_actors:
if actor in groups:
print(f"{actor}: {len(groups[actor]['techniques'])} 个技术")
print(f" 主要技术:{groups[actor]['techniques'][:10]}")
```
### 步骤 2:构建威胁行为者 TTP 画像
为优先威胁行为者创建 ATT&CK Navigator 层:
```python
import json
def create_attack_layer(actor_name, techniques, color="#ff6666"):
"""为威胁行为者生成 ATT&CK Navigator JSON 层"""
layer = {
"name": f"{actor_name} TTP 画像",
"versions": {
"attack": "15",
"navigator": "5.0",
"layer": "4.5"
},
"domain": "enterprise-attack",
"description": f"与 {actor_name} 相关的技术",
"techniques": [
{
"techniqueID": tech_id,
"tactic": "",
"color": color,
"comment": f"被 {actor_name} 使用",
"enabled": True,
"score": 1
}
for tech_id in techniques
],
"gradient": {
"colors": ["#ffffff", color],
"minValue": 0,
"maxValue": 1
}
}
return layer
# 为主要威胁行为者创建层
fin7_techniques = ["T1566.001", "T1059.001", "T1053.005", "T1547.001",
"T1078", "T1021.001", "T1003", "T1071.001", "T1041"]
layer = create_attack_layer("FIN7", fin7_techniques, "#ff6666")
with open("fin7_layer.json", "w") as f:
json.dump(layer, f, indent=2)
```
### 步骤 3:映射当前检测覆盖率
导出已映射到 ATT&CK 的当前检测规则:
```spl
--- 从 Splunk ES 关联搜索提取 ATT&CK 技术映射
| rest /services/saved/searches
splunk_server=local
| where match(title, "^(COR|ESCU|RBA):")
| eval techniques = if(isnotnull(action.correlationsearch.annotations),
spath(action.correlationsearch.annotations, "mitre_attack"),
"unmapped")
| stats count by techniques
| mvexpand techniques
| stats count by techniques
| rename techniques AS technique_id, count AS rule_count
```
创建检测覆盖率层:
```python
def create_coverage_layer(detection_rules):
"""从检测规则清单生成覆盖率层"""
technique_counts = {}
for rule in detection_rules:
for tech in rule.get("techniques", []):
technique_counts[tech] = technique_counts.get(tech, 0) + 1
layer = {
"name": "SOC 检测覆盖率",
"versions": {"attack": "15", "navigator": "5.0", "layer": "4.5"},
"domain": "enterprise-attack",
"techniques": [
{
"techniqueID": tech_id,
"color": "#31a354" if count >= 2 else "#a1d99b" if count == 1 else "",
"score": count,
"comment": f"{count} 条检测规则"
}
for tech_id, count in technique_counts.items()
],
"gradient": {
"colors": ["#ffffff", "#a1d99b", "#31a354"],
"minValue": 0,
"maxValue": 3
}
}
return layer
```
### 步骤 4:执行缺口分析
将威胁行为者 TTP 叠加到检测覆盖率上:
```python
def gap_analysis(threat_techniques, covered_techniques):
"""识别特定威胁行为者的检测缺口"""
gaps = set(threat_techniques) - set(covered_techniques)
covered = set(threat_techniques) & set(covered_techniques)
print(f"威胁行为者技术数:{len(threat_techniques)}")
print(f"已检测:{len(covered)} ({len(covered)/len(threat_techniques)*100:.0f}%)")
print(f"缺口:{len(gaps)} ({len(gaps)/len(threat_techniques)*100:.0f}%)")
# 按杀伤链阶段排列缺口优先级
priority_order = {
"TA0001": 1, "TA0002": 2, "TA0003": 3, "TA0004": 4,
"TA0005": 5, "TA0006": 6, "TA0007": 7, "TA0008": 8,
"TA0009": 9, "TA0010": 10, "TA0011": 11, "TA0040": 12
}
gap_details = []
for tech_id in gaps:
gap_details.append({
"technique": tech_id,
"priority": "HIGH" if tech_id.split(".")[0] in ["T1003", "T1021", "T1059"] else "MEDIUM",
"recommendation": f"为 {tech_id} 构建检测"
})
return {
"total_actor_techniques": len(threat_techniques),
"covered": len(covered),
"gaps": len(gaps),
"coverage_pct": round(len(covered)/len(threat_techniques)*100, 1),
"gap_details": sorted(gap_details, key=lambda x: x["priority"])
}
# 运行分析
result = gap_analysis(fin7_techniques, current_coverage)
```
### 步骤 5:创建优先级修复计划
构建检测工程路线图:
```yaml
threat_model_remediation_plan:
assessed_date: 2024-03-15
primary_threats:
- FIN7(金融行业)
- APT38(朝鲜金融)
- Lazarus Group(破坏性攻击)
current_coverage: 64%
target_coverage: 80%
priority_1_gaps: # 30 天目标
- technique: T1021.002
name: SMB/Windows 管理共享
data_source: Windows Security Event 5140
effort: 低
detection_approach: 监控来自非管理工作站的管理共享访问
- technique: T1003.006
name: DCSync
data_source: Windows Security Event 4662
effort: 中
detection_approach: 检测来自非域控制器的 DS-Replication-Get-Changes
priority_2_gaps: # 60 天目标
- technique: T1055
name: 进程注入
data_source: Sysmon EventCode 8, 10
effort: 高
detection_approach: 监控跨进程内存访问模式
- technique: T1071.001
name: Web 协议(C2)
data_source: 代理/防火墙日志
effort: 中
detection_approach: 检测 HTTP/S 流量中的信标模式
priority_3_gaps: # 90 天目标
- technique: T1070.004
name: 文件删除
data_source: Sysmon EventCode 23
effort: 低
detection_approach: 监控敏感目录中的批量文件删除
```
### 步骤 6:通过对手仿真验证
使用 MITRE Caldera 或 Atomic Red Team 测试覆盖率:
```bash
# 使用 Atomic Red Team 验证 FIN7 技术覆盖率
# T1566.001 — 鱼叉式钓鱼附件
Invoke-AtomicTest T1566.001
# T1059.001 — PowerShell
Invoke-AtomicTest T1059.001 -TestNumbers 1,2,3
# T1053.005 — 计划任务
Invoke-AtomicTest T1053.005
# T1547.001 — 注册表运行键
Invoke-AtomicTest T1547.001
# T1003 — 凭据转储
Invoke-AtomicTest T1003 -TestNumbers 1,2
# 验证检测
# 在 15 分钟内检查 SIEM 中是否有相应告警
```
记录仿真结果以验证威胁模型准确性。
## 核心概念
| 术语 | 定义 |
|------|------|
| **MITRE ATT&CK** | 基于真实观察的对手战术、技术和程序知识库 |
| **TTP** | 战术、技术和程序(Tactics, Techniques, and Procedures)——对手组织的行为模式 |
| **ATT&CK Navigator** | 用于以分层热力图可视化 ATT&CK 矩阵(显示覆盖率或威胁画像)的 Web 工具 |
| **缺口分析(Gap Analysis)** | 将威胁行为者 TTP 与检测覆盖率进行比较以识别盲区的过程 |
| **威胁驱动防御(Threat-Informed Defense)** | 基于实际对手行为而非理论风险来确定防御优先级的安全策略 |
| **对手仿真(Adversary Emulation)** | 受控模拟威胁行为者 TTP 以验证检测和响应能力 |
## 工具与系统
- **MITRE ATT&CK Navigator**:用于创建和叠加 ATT&CK 技术层的基于 Web 的可视化工具
- **MITRE Caldera**:用于规模化测试检测覆盖率的自动化对手仿真平台
- **Atomic Red Team**:用于安全控制验证的 ATT&CK 技术测试开源库
- **CTID ATT&CK Workbench**:用于以组织上下文定制 ATT&CK 知识库的 MITRE 工具
- **Tidal Cyber**:使用 ATT&CK 框架进行威胁驱动防御规划的商业平台
## 常见场景
- **年度威胁评估**:映射前 5 大威胁行为者到 ATT&CK,叠加到检测上,生成缺口分析
- **云迁移规划**:对云特定威胁(T1078.004、T1537)建模并规划检测覆盖率
- **并购安全评估**:针对相关威胁行为者对被收购公司环境进行威胁建模
- **预算论证**:使用缺口分析展示需要工具投资的检测盲区
- **紫队规划**:基于威胁模型中优先级最高的缺口选择对手仿真场景
## 输出格式
```
威胁模型评估 — 金融服务部门
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
日期: 2024-03-15
威胁行为者: FIN7、APT38、Lazarus Group
技术总计: 所有行为者共计 87 种独特技术
检测覆盖率:
已覆盖: 56/87 (64%)
缺口: 31/87 (36%)
战术覆盖率分解:
初始访问: 78% ████████░░
执行: 82% █████████░
持久化: 71% ████████░░
权限提升: 65% ███████░░░
防御规避: 52% ██████░░░░ <-- 优先缺口
凭据访问: 58% ██████░░░░ <-- 优先缺口
发现: 45% █████░░░░░
横向移动: 61% ███████░░░
数据收集: 50% ██████░░░░
渗漏: 55% ██████░░░░
C2: 67% ███████░░░
优先缺口(30 天修复计划):
1. T1055 进程注入 — 所有 3 个行为者均使用,0 条检测
2. T1003.006 DCSync — FIN7 和 Lazarus 使用,0 条检测
3. T1070.004 文件删除 — 证据销毁,0 条检测
投资建议:
弥补前 10 个缺口需要:2 名检测工程师 FTE,60 天
预期覆盖率提升:64% -> 76%
```Related Skills
tracking-threat-actor-infrastructure
威胁行为者基础设施追踪涉及使用被动 DNS、证书透明度日志、Shodan/Censys 扫描、WHOIS 分析和网络指纹技术,对对手控制的 C2 服务器、钓鱼域名和暂存服务器等资产进行监控、映射和持续追踪
recovering-from-ransomware-attack
按照 NIST 和 CISA 框架执行结构化勒索软件事件恢复,包括环境隔离、取证证据保全、 干净基础设施重建、从已验证备份优先还原系统、凭据重置,以及针对再感染的验证。 涵盖 Active Directory 恢复、数据库还原和按依赖顺序重建应用栈。
profiling-threat-actor-groups
通过聚合 TTP 文档、历史活动数据、工具指纹和来自多个情报源的归因指标,为 APT 组织、犯罪组织和黑客活动组织开发全面的威胁行为者画像。适用于就行业特定威胁向管理层汇报、更新威胁模型假设,或针对特定对手优先部署防御控制措施。当涉及 MITRE ATT&CK 组织、Mandiant APT 画像、CrowdStrike 对手命名或行业特定威胁简报时激活。
performing-web-cache-poisoning-attack
在授权安全测试期间,通过未纳入缓存键的头部和参数毒化缓存响应,利用 Web 缓存机制向其他用户投递恶意内容。
performing-web-cache-deception-attack
通过利用 CDN 缓存层与源服务器之间的路径规范化差异,执行 Web 缓存欺骗攻击,从而缓存并获取敏感的已认证内容。
performing-vlan-hopping-attack
在授权环境中使用交换机欺骗(Switch Spoofing)和双标签(Double Tagging)技术模拟 VLAN 跳转攻击, 测试 VLAN 分段有效性,并验证交换机端口安全配置对二层旁路攻击的抵御能力。
performing-threat-modeling-with-owasp-threat-dragon
使用 OWASP Threat Dragon 创建数据流图,运用 STRIDE 和 LINDDUN 方法论识别威胁,并生成威胁模型报告用于安全设计审查。
performing-threat-landscape-assessment-for-sector
通过分析威胁行为者定向攻击模式、常见攻击向量和行业特定漏洞,开展行业特定威胁态势评估,为组织风险管理提供决策依据
performing-threat-intelligence-sharing-with-misp
使用 PyMISP 在 MISP 平台上创建、丰富和共享威胁情报事件,包括 IOC 管理、情报源集成、STIX 导出及社区共享工作流
performing-threat-hunting-with-yara-rules
使用 YARA 模式匹配规则在文件系统和内存转储中狩猎恶意软件、可疑文件和入侵指标。 涵盖规则编写、yara-python 扫描以及与威胁情报源的集成。
performing-threat-hunting-with-elastic-siem
使用 KQL/EQL 查询、检测规则和 Timeline 调查在 Elastic Security SIEM 中执行主动威胁狩猎, 识别绕过自动检测的威胁。适用于 SOC 团队针对特定 ATT&CK 技术进行狩猎、调查异常行为, 或使用 Elasticsearch 和 Kibana Security 验证检测覆盖缺口。
performing-threat-emulation-with-atomic-red-team
使用 atomic-operator Python 框架执行 Atomic Red Team 测试,进行 MITRE ATT&CK 技术验证。 从 YAML 原子测试加载测试定义、运行攻击模拟并验证检测覆盖率。适用于测试 SIEM 检测规则、 验证 EDR 覆盖率或开展紫队演练。