SECURITY ENGINEERING · PART 8 · WRITING SECURE CODE · DESIGN · 110 OF 229

Attack Trees, PASTA and OWASP Threat Dragon

STRIDE finds categories of threat; attack trees explore how a specific goal could be reached. This episode covers attack trees (a goal at the root, branches of AND and OR steps, leaves you can cost or rate), when to use them, the heavier PASTA and VAST methods and when they fit, threat modeling as code with pytm, diagramming with OWASP Threat Dragon, and how to choose an approach for your team.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 12

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Attack trees for depth on one goal
  • PASTA, VAST, LINDDUN for specific needs
  • model as code, or draw with Threat Dragon

Notes

Attack trees

An attack tree puts one attacker goal at the root, for example read all customer data. Below it, branches show the ways to reach that goal. An OR node means any one of its children is enough; an AND node means all of them are required together. The leaves are concrete attack steps. You then annotate the leaves with things like cost, required skill, likelihood and whether the step would be detected. The cheapest path from a leaf to the root is the attacker's likely route, and your priority to block.

The structure
  • root: one attacker goal "read all customer data"
  • branches: ways to achieve it
  • OR nodes: any one child works
  • AND nodes: all children are needed
  • leaves: concrete attack steps
  • annotate leaves: cost, skill, likelihood, detectability

A small example

Here is a small one. The goal is to read customer data. One path is to steal credentials, by phishing or by reusing a password from another breach, and then defeat weak multi-factor; because MFA is required as well, that is an AND. Another path is to exploit the API directly, such as an insecure direct object reference on an orders endpoint. You look at the whole tree and ask which leaf is cheapest. Blocking phishing and password reuse, and fixing the object reference, cuts off the easy routes.

Goal: read customer data
  • OR: path A: steal credentials phishing (cheap, common) password reuse (cheap) then: weak MFA (AND) path B: exploit the API IDOR on /orders (cheap if present) auth bypass (harder)
  • block the cheapest leaves first

When to use them

Attack trees are not a replacement for STRIDE; they answer a different question. Use them when you have one critical asset or goal and want to understand it deeply: moving funds, protecting key material, reaching administrator access. They are good for comparing the cost of different attack paths and deciding where a single control buys the most protection, and the picture communicates risk well to non-experts. For broad coverage of a whole system, STRIDE against a diagram is still the better starting point.

Good fit for attack trees
  • one critical asset or goal: funds transfer, key material, admin access
  • comparing the cost of attack paths
  • deciding where a control adds the most value
  • communicating a risk to non-experts (a picture)
  • less good for broad coverage of a whole system (use STRIDE)

PASTA

Recognise two heavier methods. PASTA, the process for attack simulation and threat analysis, is a seven-stage, risk-centric method that starts from business objectives and works through threats, weaknesses, attack simulation and risk. Its strength is tying technical threats to business impact and real attacker behaviour. Its cost is that it is heavy, suited to high-value systems and teams who can invest the time. For most feature work it is more than you need, but know the name and idea.

PASTA, in short
  • Process for Attack Simulation and Threat Analysis
  • seven stages, from business objectives to threat and attack analysis to risk
  • strength: ties threats to business impact and real attacker behaviour
  • cost: heavy; for high-value systems and dedicated teams
  • know the name and the idea

VAST and others

A few more worth knowing. VAST, visual agile and simple threat modeling, is built to scale across many teams and pipelines rather than one deep analysis. LINDDUN is a STRIDE-like method focused specifically on privacy threats, which is increasingly important under data protection law. Trike and OCTAVE are older and more risk-management oriented. You choose by the problem: for privacy, reach for LINDDUN; to scale across an organisation, VAST or templated STRIDE; for depth on one target, an attack tree.

Scaling threat modeling
  • VAST: visual, agile, simple threat modeling, built to scale across many teams and pipelines
  • LINDDUN: a STRIDE-like method focused on privacy threats
  • Trike, OCTAVE: older, risk-management oriented
  • pick by the problem: privacy -> LINDDUN; scale -> VAST or STRIDE templates

Threat modeling as code

One modern approach is threat modeling as code. With a tool like pytm you describe the elements, data flows and trust boundaries in Python, and it generates the diagram, a list of candidate threats and a report. Because the model is code, it lives in the repository, is reviewed in pull requests, and shows a diff when the design changes. Another tool, threatspec, lets you write threats as annotations next to the code they concern. This suits teams who would rather maintain code than a separate diagram.

pytm and friends
  • describe elements, flows and boundaries in Python (pytm)
  • generate: the diagram, a threat list, a report
  • lives in the repo, reviewed in pull requests, diffed when the design changes
  • threatspec: threats as annotations in code
  • fits teams who prefer code to diagrams

Diagramming tools

For drawing, the best-known free tool is OWASP Threat Dragon: open source, it lets you draw data flow diagrams and suggests STRIDE threats for each element. The Microsoft Threat Modeling Tool is another free, STRIDE-based option. Commercial platforms such as IriusRisk and SD Elements integrate with issue trackers and pipelines and scale across teams. And a photograph of a whiteboard attached to the ticket is a completely valid tool. The goal is a shared understanding, not a beautiful diagram.

Drawing tools
  • OWASP Threat Dragon: free, open source, draws DFDs and suggests STRIDE threats
  • Microsoft Threat Modeling Tool: Windows, STRIDE-based
  • IriusRisk, SD Elements: commercial, integrate with Jira and pipelines
  • or a whiteboard photo in the ticket: completely valid

Choosing an approach

So how do you choose? For most features, STRIDE on a one-page diagram in an hour is the right default. For one critical goal, draw an attack tree. For a privacy-heavy system, use LINDDUN. For a large organisation with many teams, VAST or templated STRIDE with tooling. For a code-first team, pytm. For a high-value system with a dedicated team, PASTA. The principle is to start simple and add rigour only where the risk justifies the extra effort. A simple model that gets done beats a perfect one that does not.

A simple guide
  • most features: STRIDE on a one-page DFD
  • one critical goal: an attack tree
  • privacy-heavy: LINDDUN
  • large org: VAST or templated STRIDE
  • code-first team: pytm
  • high-value: PASTA
  • start simple; add rigour where risk justifies it

Common mistakes

Mistakes. Always reaching for the heaviest method, so threat modeling becomes a project and stops happening. Using an attack tree to try to cover a whole system, where STRIDE fits better. Producing beautiful diagrams but never tracking the mitigations, which is the only output that matters. Buying an expensive tool and expecting it to create the habit. Ignoring privacy threats because the method only looked at security. And a model that is drawn once and never updated as the system changes.

Avoid these
  • always using the heaviest method available
  • an attack tree for whole- system coverage
  • beautiful diagrams, no mitigations tracked
  • buying a tool instead of building the habit
  • privacy threats ignored (no LINDDUN or equivalent)
  • a model that never updates

Say it like this

In the interview: STRIDE for breadth across a design, so every category is considered. An attack tree for depth on one high-value goal, to compare attack paths by cost and decide where a control buys the most. For privacy I add LINDDUN; to scale across teams, VAST or templated STRIDE with tooling such as Threat Dragon. I like pytm for keeping the model in the repo. The key is matching the method to the risk and keeping it light enough to repeat.

In the interview
  • "STRIDE for breadth across a design; an attack tree for depth on one high-value goal, comparing attack paths by cost. For privacy I add
  • LINDDUN, for scale VAST or templated STRIDE, and I like
  • pytm to keep the model in the repo. I match the method
  • to the risk and keep it light."

Interview questions

Q1What is an attack tree?

A diagram with an attacker goal at the root and branches showing the ways to achieve it. OR nodes mean any child suffices, AND nodes mean all are required, and leaves are concrete steps that can be annotated with cost, skill and likelihood to find the easiest path.

Q2What is the difference between STRIDE and attack trees?

STRIDE provides breadth, ensuring every category of threat against a design is considered. Attack trees provide depth, exploring all the ways a single high-value goal could be reached and comparing their cost. They are complementary.

Q3What is PASTA threat modeling?

The Process for Attack Simulation and Threat Analysis: a seven-stage, risk-centric method that starts from business objectives and works through technical scope, threat and vulnerability analysis, attack simulation and risk. It is thorough but heavy, suited to high-value systems.

Q4What is LINDDUN?

A threat modeling methodology focused on privacy, analogous to STRIDE but with categories such as linkability, identifiability and non-compliance. It is used to find privacy threats that security-focused methods may miss.

Q5What is threat modeling as code?

Describing a system's elements, data flows and trust boundaries in code, for example with pytm in Python, so the model generates diagrams and threat lists, lives in version control, is reviewed in pull requests and is diffed when the design changes.

Q6What is OWASP Threat Dragon?

A free, open-source threat modeling tool for drawing data flow diagrams and recording threats, with suggestions based on STRIDE. It is a common starting point for teams who want tooling without commercial cost.

Q7How do you choose a threat modeling method?

Match it to the question and team: STRIDE on a diagram for most features, attack trees for one critical goal, LINDDUN for privacy, VAST or templated STRIDE to scale across teams, pytm for code-first teams, and PASTA for high-value systems with dedicated effort.

Q8What is the difference between an AND node and an OR node in an attack tree?

An OR node is satisfied if any one of its child steps succeeds, representing alternative routes. An AND node requires all of its child steps together, representing conditions that must all hold. This distinction drives which combinations of controls break a path.