# 威胁建模

威胁建模是一种结构化、可重复的安全工程方法，用于识别、枚举系统可能遭受的攻击并确定其优先级。在设计早期进行最为有益，因为此时代码尚不存在，缺陷可以在编写代码之前修复；但在应用开发的任何阶段使用也有帮助。实践者从对抗性视角对系统进行建模，识别适用的威胁，并确定对这些威胁的应对措施。<sup>[1](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)</sup> 其产出并非单一制品：交付物包括系统模型与图表、威胁清单、缓解措施或假设，以及会议记录，通常汇编为一份威胁模型文档。<sup>[2](https://devguide.owasp.org/en/04-design/01-threat-modeling/07-practical-threat-modeling/)</sup> 该实践是微软安全开发生命周期（SDL）<sup>[3](https://shostack.org/files/essays/uncover)</sup>的组成部分，通常围绕四个问题展开：我们在做什么？哪里可能出错？我们打算怎么应对？我们做得够好吗？<sup>[1](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 核心问题 | 我们在做什么？哪里可能出错？我们打算怎么应对？我们做得够好吗？<sup>[1](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)</sup> |
| 经典分类法 | STRIDE：仿冒、篡改、抵赖、信息泄露、拒绝服务、权限提升<sup>[3](https://shostack.org/files/essays/uncover)</sup> |
| 系统模型 | 包含四种元素类型及信任边界的数据流图<sup>[3](https://shostack.org/files/essays/uncover)</sup> |
| SDL流程 | 绘图、威胁枚举、缓解、验证<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> |
| 会议时长 | 微软建议至少2小时：一小时用于建立共享的架构理解，一小时用于威胁与缓解措施<sup>[5](https://www.microsoft.com/en-us/securityengineering/sdl/practices/secure-by-design)</sup> |
| 实测生产率 | 在一项学生研究中，每名分析师每小时发现1.8个有效威胁（95%置信区间0.94-3.25）<sup>[6](https://lirias.kuleuven.be/retrieve/b8a29c99-0e92-401f-949e-a75fe2e5ce95)</sup> |
| 工具威胁库 | 调查快照：IriusRisk最大，超过200个（旧版目录；2026年对比报告称有700多个组件）；OWASP pytm约100个；微软TMT约50个；Threagile约40个<sup>[7](https://www.honda-ri.de/pubs/pdf/4933.pdf)</sup> |

## 工作原理

其原则是结构化枚举，而非临时起意的头脑风暴。方法可以是资产中心、攻击者中心或软件中心，各有优劣；<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> 微软自身的用法是问“你想阻止哪些攻击？”而非“哪些攻击者？”，并且要求功能团队而非中央专家组来进行建模。<sup>[8](https://www.microsoft.com/en-us/security/blog/2007/09/26/the-trouble-with-threat-modeling/)</sup> 软件中心路线由SDL确立为经典做法，绘制数据流图（DFD），包含四种元素类型：数据流、数据存储、进程和交互方，外加为威胁建模而添加的信任边界。<sup>[3](https://shostack.org/files/essays/uncover)</sup>

枚举之所以系统化，是因为每种元素类型都对应一组来自STRIDE的特征性威胁，其中每个类别违反一种安全属性：仿冒违反认证，篡改违反完整性，抵赖违反不可否认性，信息泄露违反机密性，拒绝服务违反可用性，权限提升违反授权。<sup>[1](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)</sup> 六种威胁均适用于进程；仿冒和抵赖适用于交互方；篡改、信息泄露和拒绝服务适用于数据流和数据存储。逐元素遍历图表，团队便可以声明其已处理了例如针对所有数据流和数据存储的篡改、信息泄露和拒绝服务威胁。<sup>[3](https://shostack.org/files/essays/uncover)</sup>

## 实施方法

SDL方法论分四步运行：绘图、威胁枚举、缓解和验证。<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> 一个最小化的DFD识别进程、数据存储、外部实体、数据流和信任边界，每一次跨越边界都被视为候选威胁。<sup>[9](https://github.com/OWASP/DevSecOpsGuideline/blob/master/current-version/2-Process/2-1-Design/2-1-1-Threat-modeling.md)</sup>

**优先级排序**在理论上是威胁可能性与影响的数学乘积，<sup>[1](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)</sup> 尽管已发表的方法中很少包含可能性因子。<sup>[10](https://www.scitepress.org/Papers/2023/117830/117830.pdf)</sup> DREAD（潜在损害、可复现性、可利用性、受影响用户、可发现性）为每个类别赋予数值，从而可计算平均风险值。<sup>[11](https://insights.sei.cmu.edu/documents/569/2018_019_001_524597.pdf)</sup> Shostack曾告诫，DREAD被加入方法论时并未理解其成本与收益，可能不适用于软件中心的威胁建模。<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> W3C指南指出，威胁模型可以为风险评估提供信息，但其本身并非风险评分活动。<sup>[12](https://www.w3.org/TR/threat-modeling-guide/)</sup>

**缓解**在SDL培训中按偏好顺序遵循四种响应：重新设计、使用标准缓解措施（如ACL）、谨慎使用独特缓解措施，或按政策接受风险。<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> Shostack的通用清单是缓解、消除、转移和接受；<sup>[1](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)</sup> MDN用ERTA助记符归纳响应：消除、减少、转移、接受。<sup>[13](https://developer.mozilla.org/en-US/docs/Web/Security/Threat_modeling)</sup> 验证则使用渗透测试、安全代码审查、自动化扫描和红队演练。<sup>[14](https://learn.microsoft.com/en-gb/training/modules/introduction-to-secure-devops/7-understand-threat-modeling)</sup>

**会议形式**因节奏而异。微软建议预留至少2小时，第一小时用于对架构和场景形成共识，第二小时用于威胁与缓解措施，较大的系统应分解并分别建模。<sup>[5](https://www.microsoft.com/en-us/securityengineering/sdl/practices/secure-by-design)</sup> 对于敏捷团队，Thoughtworks建议与当前工作绑定的15-30分钟白板会议，分三步：解释与探索、识别威胁、排定优先级并修复。<sup>[15](https://martinfowler.com/articles/agile-threat-modelling.html)</sup>

## 起源

结构化威胁枚举有其前身。Edward G. Amoroso的《计算机安全技术基础》（1994年）是通过攻击树实现结构化的早期尝试，<sup>[16](https://adam.shostack.org/resources/early-threat-modeling)</sup> 而SEI的方法综述将攻击树归功于[Bruce Schneier](https://www.edgepedia.org/zh/bruce-schneier)于1999年提出，这一归属所指的时间晚于Amoroso的先驱性工作。<sup>[11](https://insights.sei.cmu.edu/documents/569/2018_019_001_524597.pdf)</sup> Schneier和Adam Shostack的智能卡威胁建模论文《Breaking up is hard to do》在1999年Usenix智能卡技术研讨会上获得最佳论文奖。<sup>[16](https://adam.shostack.org/resources/early-threat-modeling)</sup>

威胁建模方法论已有文献记载，始自一份题为《对我们软件的威胁》的内部文档。<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> 2002年1月，[Bill Gates](https://www.edgepedia.org/zh/bill-gates)宣布可信计算计划，其早期成果之一便是SDL，威胁建模是设计阶段的关键部分。<sup>[17](https://research.cs.wisc.edu/mist/SoftwareSecurityCourse/Chapters/2_3-MicrosoftSDL-ThreatModeling.pdf)</sup> DREAD随《编写安全代码》第二版加入，包含威胁建模的SDL于2004年正式推出。<sup>[18](https://threatmodelingbook.com/files/microsoft/shostack-toorcon-2008-SDL-tm-past-present-future.pdf)</sup> 该方法的已出版版本包括《编写安全代码》、《威胁建模》和《安全开发生命周期》，后者为四种DFD元素各给出了STRIDE威胁树。<sup>[4](https://ceur-ws.org/Vol-413/paper12.pdf)</sup> Adam Shostack 2014年由Wiley出版的《威胁建模：为安全而设计》使微软方法论变得易于掌握，涵盖STRIDE、攻击树、攻击库、LINDDUN和工具。<sup>[19](https://www.wiley.com/en-us/Threat+Modeling%3A+Designing+for+Security-p-9781118810057)</sup> Shostack后来对旧流程的回应是四问题框架、SDL威胁建模工具v3和权限提升卡牌。<sup>[20](https://shostack.org/blog/twenty-years-of-scaling-threat-modeling/)</sup>

## 变体

**STRIDE**通过构建DFD来应用，已演变为STRIDE-per-Element和STRIDE-per-Interaction变体；一项复制实验发现两者之间无统计学显著差异，而按交互的变体被记载为更适合专家使用。<sup>[21](https://ar5iv.labs.arxiv.org/html/2208.01524)</sup>

**PASTA**（攻击模拟与威胁分析流程）是以风险为中心的七阶段框架，使用DFD和攻击树，由Tony UcedaVélez和Marco M. Morana在《以风险为中心的威胁建模》一书中定义，2015年由Wiley出版。<sup>[22](https://www.wiley.com/en-us/Risk+Centric+Threat+Modeling%3A+Process+for+Attack+Simulation+and+Threat+Analysis-p-9780470500965)</sup> **LINDDUN**（可关联性、可识别性、[不可否认性](https://www.edgepedia.org/zh/non-repudiation)、可检测性、信息泄露、不知情、不合规）是一种以隐私为中心的方法，2010年由Mina Deng及其同事在《需求工程》上首次发表；<sup>[23](https://doi.org/10.1007/s00766-010-0115-7)</sup> 它明显受到STRIDE的启发并与之互补，共享相同的基于DFD的系统模型，<sup>[24](https://www.sciencedirect.com/science/article/abs/pii/S016412121400137X)</sup> 并有GO、PRO和MAESTRO三种版本以及隐私增强技术目录。<sup>[25](https://linddun.org/)</sup> **OCTAVE**（业务关键威胁、资产和脆弱性评估）关注组织风险而非技术风险；其1.0版框架由Christopher J. Alberts及其同事于1999年记录，<sup>[26](https://doi.org/10.21236/ada367718)</sup> OCTAVE Allegro随后于2007年由Richard A. Caralli及其同事提出。<sup>[27](https://doi.org/10.21236/ada470450)</sup> **Trike**（2005年）使用参与者-资产-动作矩阵，**VAST**则要求同时具备应用威胁模型和运营威胁模型。<sup>[11](https://insights.sei.cmu.edu/documents/569/2018_019_001_524597.pdf)</sup> 2024年一篇Springer论文对STRIDE、DREAD、VAST、PASTA、OCTAVE和LINDDUN进行了比较分析，供组织在选择时参考。<sup>[28](https://link.springer.com/chapter/10.1007/978-3-031-74443-3_16)</sup>

**工具**的主要差异在于威胁库大小和缓解支持。在调查快照中，IriusRisk拥有最大的威胁库（旧版目录超过200个威胁，不过2026年的一份对比描述其安全内容库有700多个组件，附带预映射的威胁和控制措施<sup>[29](https://cybersectools.com/compare/iriusrisk-threat-modeling-tool-vs-pytm)</sup>）；OWASP pytm覆盖约100个威胁；微软威胁建模工具（TMT）带有约50个预定义的STRIDE威胁；Threagile约40个。TMT、Threat Dragon和OVVL不提供对策建议，而pytm、Threagile和IriusRisk提供简单的缓解建议。<sup>[7](https://www.honda-ri.de/pubs/pdf/4933.pdf)</sup> 在一项开源自动化工具的质量评估中，Threagile得分最高，得益于其YAML系统描述，能够做出比仅基于DFD的工具更细粒度的威胁决策。<sup>[30](https://www.usenix.org/publications/loginonline/analysis-open-source-automated-threat-modeling-tools-and-their)</sup> ThreMoLIA由Felix Viktor Jedrzejewski、Davide Fucci和Oleksandr Adamov于2025年提出，将威胁建模扩展到集成大语言模型的应用。<sup>[31](https://doi.org/10.48550/arxiv.2504.18369)</sup>

## 应用

威胁建模适用于整个开发生命周期。OWASP建议对新功能进行增量建模，而非对现有系统进行完整建模，后者耗时且会产生过时的模型，<sup>[2](https://devguide.owasp.org/en/04-design/01-threat-modeling/07-practical-threat-modeling/)</sup> MDN建议尽早开始，最好在功能定义完成后立即开始，并频繁回顾。<sup>[13](https://developer.mozilla.org/en-US/docs/Web/Security/Threat_modeling)</sup> W3C发布指南，教导规范工作组在标准制定过程中使用威胁建模，并建议威胁模型应作为活文档发布以征求反馈并持续更新。<sup>[12](https://www.w3.org/TR/threat-modeling-guide/)</sup> LINDDUN与GDPR隐私设计要求的契合为隐私威胁建模提供了监管锚点。<sup>[25](https://linddun.org/)</sup>

## 局限与替代方案

**成本与规模。** 一项针对57名硕士生的STRIDE描述性研究测得每小时1.8个有效威胁（仅计识别），计入文档记录后降至每小时0.9个；按此速率，单个分析师对于所研究的最小DFD需要多达7个工作日，最大的则需要多达26个。<sup>[6](https://lirias.kuleuven.be/retrieve/b8a29c99-0e92-401f-949e-a75fe2e5ce95)</sup> 行业实践在很大程度上仍是临时的，基于“白板黑客”方式，依赖于参与者的经验。<sup>[32](https://sion.info/assets/pdf/publications/YskoutICSE2020.pdf)</sup> 进行彻底的建模可能需要数小时到一整个工作日，而合格人员数量有限使得大规模推广困难。<sup>[30](https://www.usenix.org/publications/loginonline/analysis-open-source-automated-threat-modeling-tools-and-their)</sup>

**有效性与盲区。** 一项对109份正式出版文献和灰色文献来源的多声部综述发现，没有直接因果证据（如对照实验）表明威胁建模能改善应用安全，同时指出这一缺失并不等于无效的证据。<sup>[33](https://ieeexplore.ieee.org/document/11392719)</sup> STRIDE表现出中等偏低的假阳性率，但假阴性率中等偏高，<sup>[11](https://insights.sei.cmu.edu/documents/569/2018_019_001_524597.pdf)</sup> 微软告诫STRIDE“不能替代像攻击者一样思考”，可能遗漏设计缺陷。<sup>[5](https://www.microsoft.com/en-us/securityengineering/sdl/practices/secure-by-design)</sup> DFD本身在数据类型、安全架构元素和部署信息方面缺乏表达能力，信任边界解释的模糊性可能导致对策错位。<sup>[34](https://lirias.kuleuven.be/retrieve/a4360b30-a424-4881-bbea-f66738ad14b7/)</sup> [DevSecOps](https://www.edgepedia.org/zh/devsecops)指南列出了更多陷阱：建模太晚、独自进行、将其视为一次性关卡、产生没有负责人的威胁、忽视验证问题。<sup>[9](https://github.com/OWASP/DevSecOpsGuideline/blob/master/current-version/2-Process/2-1-Design/2-1-1-Threat-modeling.md)</sup>

**与验证活动的比较。** [渗透测试](https://www.edgepedia.org/zh/penetration-testing)、代码审查和扫描在微软流程中出现，是作为缓解措施的验证，而非设计期建模的替代品；<sup>[14](https://learn.microsoft.com/en-gb/training/modules/introduction-to-secure-devops/7-understand-threat-modeling)</sup> 尚无直接比较两者有效性的研究发表。

## References

1. [Threat Modeling Cheat Sheet, OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html)
2. [Threat modeling in practice, OWASP Developer Guide](https://devguide.owasp.org/en/04-design/01-threat-modeling/07-practical-threat-modeling/)
3. [Uncover Security Design Flaws Using The STRIDE Approach (MSDN, 2006; Hernan, Lambert, Ostwald, Shostack)](https://shostack.org/files/essays/uncover)
4. [Experiences Threat Modeling at Microsoft (Adam Shostack, 2008)](https://ceur-ws.org/Vol-413/paper12.pdf)
5. [Secure By Design, Perform secure design review and threat modeling (Microsoft)](https://www.microsoft.com/en-us/securityengineering/sdl/practices/secure-by-design)
6. [A descriptive study of Microsoft's threat modeling technique (Scandariato et al.)](https://lirias.kuleuven.be/retrieve/b8a29c99-0e92-401f-949e-a75fe2e5ce95)
7. [Threat Modeling Tools: A Taxonomy](https://www.honda-ri.de/pubs/pdf/4933.pdf)
8. [The Trouble with Threat Modeling (Microsoft Security Blog, 2007)](https://www.microsoft.com/en-us/security/blog/2007/09/26/the-trouble-with-threat-modeling/)
9. [Threat Modeling, OWASP DevSecOps Guideline](https://github.com/OWASP/DevSecOpsGuideline/blob/master/current-version/2-Process/2-1-Design/2-1-1-Threat-modeling.md)
10. [Systematic Literature Review of Threat Modeling Concepts (SciTePress, 2023)](https://www.scitepress.org/Papers/2023/117830/117830.pdf)
11. [Threat Modeling: A Summary of Available Methods (CMU SEI, 2018)](https://insights.sei.cmu.edu/documents/569/2018_019_001_524597.pdf)
12. [Threat Modeling Guide (W3C)](https://www.w3.org/TR/threat-modeling-guide/)
13. [Threat modeling, MDN Web Docs (Security)](https://developer.mozilla.org/en-US/docs/Web/Security/Threat_modeling)
14. [Understand threat modeling, Microsoft Learn (Secure DevOps module)](https://learn.microsoft.com/en-gb/training/modules/introduction-to-secure-devops/7-understand-threat-modeling)
15. [Threat Modeling Guide for Software Teams, Martin Fowler / Thoughtworks](https://martinfowler.com/articles/agile-threat-modelling.html)
16. [Adam's Early Writing on Threat Modeling (Shostack + Associates)](https://adam.shostack.org/resources/early-threat-modeling)
17. [Chapter 6: Microsoft Threat Modeling and Security Development Lifecycle (UW–Madison course text)](https://research.cs.wisc.edu/mist/SoftwareSecurityCourse/Chapters/2_3-MicrosoftSDL-ThreatModeling.pdf)
18. [SDL Threat Modeling: Past, Present, Future (Shostack, Toorcon 2008)](https://threatmodelingbook.com/files/microsoft/shostack-toorcon-2008-SDL-tm-past-present-future.pdf)
19. [Threat Modeling: Designing for Security (Shostack, Wiley, 2014)](https://www.wiley.com/en-us/Threat+Modeling%3A+Designing+for+Security-p-9781118810057)
20. [Twenty Years of Scaling Threat Modeling (Shostack blog, 2026)](https://shostack.org/blog/twenty-years-of-scaling-threat-modeling/)
21. [A replication of a controlled experiment with two STRIDE variants](https://ar5iv.labs.arxiv.org/html/2208.01524)
22. [Risk Centric Threat Modeling: Process for Attack Simulation and Threat Analysis (UcedaVelez & Morana, Wiley, May 2015)](https://www.wiley.com/en-us/Risk+Centric+Threat+Modeling%3A+Process+for+Attack+Simulation+and+Threat+Analysis-p-9780470500965)
23. [Mina Deng and colleagues (2010). A privacy threat analysis framework: supporting the elicitation and fulfillment of privacy requirements. Requirements Engineering.](https://doi.org/10.1007/s00766-010-0115-7)
24. [Empirical evaluation of a privacy-focused threat modeling methodology (Wuyts et al., Journal of Systems and Software)](https://www.sciencedirect.com/science/article/abs/pii/S016412121400137X)
25. [LINDDUN, Privacy Engineering (official portal)](https://linddun.org/)
26. [Christopher J. Alberts and colleagues (1999). Operationally Critical Threat, Asset, and Vulnerability Evaluation (OCTAVE) Framework, Version 1.0. .](https://doi.org/10.21236/ada367718)
27. [Richard A. Caralli and colleagues (2007). Introducing OCTAVE Allegro: Improving the Information Security Risk Assessment Process. .](https://doi.org/10.21236/ada470450)
28. [A Comparative Analysis of Threat Modelling Methods: STRIDE, DREAD, VAST, PASTA, OCTAVE, and LINDDUN (Naik et al., C3AI 2024, Springer)](https://link.springer.com/chapter/10.1007/978-3-031-74443-3_16)
29. [IriusRisk Threat Modeling Tool vs pytm : Side-by-Side Comparison ( 2026 )](https://cybersectools.com/compare/iriusrisk-threat-modeling-tool-vs-pytm)
30. [An Analysis of Open-source Automated Threat Modeling Tools and Their Extensibility from Security into Privacy (USENIX ;login:, 2023)](https://www.usenix.org/publications/loginonline/analysis-open-source-automated-threat-modeling-tools-and-their)
31. [Jedrzejewski, Felix Viktor, Fucci, Davide, Adamov, Oleksandr (2025). ThreMoLIA: Threat Modeling of Large Language Model-Integrated Applications. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2504.18369)
32. [Threat modeling: from infancy to maturity (Yskout, Sion, Tuma, ICSE 2020)](https://sion.info/assets/pdf/publications/YskoutICSE2020.pdf)
33. [A Multivocal Literature Review on the Effectiveness of Security Threat Modeling (IEEE TSE)](https://ieeexplore.ieee.org/document/11392719)
34. [Security Threat Modeling: Are Data Flow Diagrams Enough? (KU Leuven)](https://lirias.kuleuven.be/retrieve/a4360b30-a424-4881-bbea-f66738ad14b7/)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › 标题：Mo至Z

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/threat-modeling

English original: https://www.edgepedia.org/threat-modeling
