| name | implementing-threat-modeling-with-mitre-attack |
| description | 使用 MITRE ATT&CK 框架实施威胁建模,将对手 TTP 映射到组织资产, 评估检测覆盖缺口,并优化防御投资。 适用于 SOC 团队需要将检测工程与威胁态势对齐、对新环境开展威胁评估, 或为安全工具采购提供决策依据时。
|
| domain | cybersecurity |
| subdomain | soc-operations |
| tags | ["soc","mitre-attack","threat-modeling","ttp","detection-coverage","attack-navigator","risk-assessment"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
使用 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 组织数据库研究针对您所在行业的对手组织:
import requests
import json
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 techniques:
tech = techniques[target]
ext_refs = tech.get(, [])
ref ext_refs:
ref.get() == :
group_data[].append(ref[])
financial_actors = [, , , , ]
actor financial_actors:
actor groups:
()
()
步骤 2:构建威胁行为者 TTP 画像
为优先威胁行为者创建 ATT&CK Navigator 层:
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",
, , , , ]
layer = create_attack_layer(, fin7_techniques, )
(, ) f:
json.dump(layer, f, indent=)
步骤 3:映射当前检测覆盖率
导出已映射到 ATT&CK 的当前检测规则:
--- 从 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
创建检测覆盖率层:
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
}
}
layer
步骤 4:执行缺口分析
将威胁行为者 TTP 叠加到检测覆盖率上:
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":
}
gap_details = []
tech_id gaps:
gap_details.append({
: tech_id,
: tech_id.split()[] [, , ] ,
:
})
{
: (threat_techniques),
: (covered),
: (gaps),
: ((covered)/(threat_techniques)*, ),
: (gap_details, key= x: x[])
}
result = gap_analysis(fin7_techniques, current_coverage)
步骤 5:创建优先级修复计划
构建检测工程路线图:
threat_model_remediation_plan:
assessed_date: 2024-03-15
primary_threats:
- FIN7(金融行业)
- APT38(朝鲜金融)
- Lazarus Group(破坏性攻击)
current_coverage: 64%
target_coverage: 80%
priority_1_gaps:
- 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:
- technique: T1055
name:
步骤 6:通过对手仿真验证
使用 MITRE Caldera 或 Atomic Red Team 测试覆盖率:
Invoke-AtomicTest T1566.001
Invoke-AtomicTest T1059.001 -TestNumbers 1,2,3
Invoke-AtomicTest T1053.005
Invoke-AtomicTest T1547.001
Invoke-AtomicTest T1003 -TestNumbers 1,2
记录仿真结果以验证威胁模型准确性。
核心概念
| 术语 | 定义 |
|---|
| 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%