Attack Trees and Prioritizing Risk
Ranking threats and choosing mitigations.
Attack Trees and Prioritizing Risk is a free Cyber Security Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What an Attack Tree Is
An attack tree is a diagram that models how an attacker could achieve a goal. The goal sits at the root, and the branches show the different paths and sub-steps required to reach it.
Where STRIDE enumerates threat types, attack trees explore the concrete paths an attacker might take. They are excellent for reasoning about a specific high-value target.
Root Goals and Sub-Goals
The root node is the attacker's ultimate objective, such as 'steal customer payment data.' Child nodes are the sub-goals or methods that achieve the parent.
You build the tree by repeatedly asking: 'How could an attacker accomplish this node?' Each answer becomes a child, and you keep decomposing until you reach concrete, actionable leaf actions.
AND vs OR Nodes
Attack trees use two logical relationships between a node and its children:
- OR nodes — any one child is enough to achieve the parent (alternative paths)
- AND nodes — all children must be achieved together (required steps)
This distinction matters enormously: an OR node means an attacker only needs the easiest path, while an AND node forces them to clear every step.
A Sample Attack Tree
Here is a text attack tree for stealing payment data:
GOAL: Steal customer payment data
OR
+-- Compromise the database directly
| AND
| +-- Gain network access to DB
| +-- Obtain DB credentials
+-- Steal data in transit
| +-- Intercept unencrypted traffic
+-- Compromise an admin account
OR
+-- Phish an admin
+-- Brute force weak passwordAnnotating Nodes with Attributes
Attack trees become powerful when you annotate leaf nodes with attributes that help prioritize:
- Cost to the attacker
- Difficulty or required skill
- Detectability (will it trip an alarm?)
- Likelihood of success
You then propagate these up the tree. For an OR node, the attacker picks the cheapest/easiest child, revealing your weakest link.
Risk = Likelihood x Impact
To prioritize, you need a risk score. The classic formula combines two factors:
Risk = Likelihood x Impact
Likelihood: how probable is this attack to succeed?
Impact: how bad is the damage if it does?
Example:
High likelihood (3) x High impact (3) = 9 -> top priority
Low likelihood (1) x High impact (3) = 3 -> monitorThe DREAD Scoring Model
DREAD is a structured way to score threats across five dimensions. Each is rated, then combined into a priority score:
- Damage — how bad is the impact?
- Reproducibility — how reliably can it be repeated?
- Exploitability — how easy to pull off?
- Affected users — how many are impacted?
- Discoverability — how easy to find?
DREAD is somewhat subjective, so use consistent rating definitions across your team.
Building a Risk Matrix
A risk matrix plots likelihood against impact to give an at-a-glance priority view:
Impact
High | Medium | High | Critical |
Med | Low | Medium | High |
Low | Low | Low | Medium |
+--------+--------+----------+
Low Med High
Likelihood
Address Critical and High cells first.Choosing Mitigations
Once threats are ranked, decide how to handle each. The four options are the same as in STRIDE mitigation:
- Mitigate — add controls to lower likelihood or impact
- Eliminate — remove the risky feature entirely
- Transfer — offload via insurance or a third party
- Accept — formally document tolerating a low risk
Spend your limited budget on the highest-risk items first; do not gold-plate low-risk threats.
Cost-Benefit of Controls
A mitigation only makes sense if its cost is justified by the risk it reduces. A control that costs more than the asset it protects is a poor investment.
For each candidate control, weigh:
- How much does the control reduce risk?
- How much does it cost to build and operate?
- Does it introduce friction or new risks?
Prefer controls that block multiple attack paths at once, such as MFA closing many account-takeover branches.
Tracking and Revisiting Risk
Prioritization is not a one-time exercise. Track each identified threat in a risk register with its score, chosen response, owner, and status.
Revisit the register when:
- A new threat or vulnerability emerges
- The system or its assets change in value
- A mitigation is implemented (re-score the residual risk)
Accepted risks should have an expiry and be re-reviewed, not accepted and forgotten.
Quick Check
Test your understanding of attack trees and risk prioritization.
Recap
You learned to rank threats and choose mitigations:
- Attack trees model paths to an attacker goal, using AND (all required) and OR (any sufficient) nodes
- Annotate nodes with cost, difficulty, and detectability to find the weakest link
- Prioritize with Risk = Likelihood x Impact, DREAD scoring, and a risk matrix
- Choose to mitigate, eliminate, transfer, or accept, weighing cost vs benefit
- Track everything in a risk register and revisit it as the system evolves
This completes the Threat Modeling with STRIDE course.
Frequently asked questions
Is the “Attack Trees and Prioritizing Risk” lesson free?
Yes — the full text of “Attack Trees and Prioritizing Risk” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “Attack Trees and Prioritizing Risk”?
Ranking threats and choosing mitigations. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cyber Security Academy?
No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Attack Trees and Prioritizing Risk” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cyber Security Academy lesson?
Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why Threat Modeling Matters
- The STRIDE Framework
- Data Flow Diagrams and Trust Boundaries
- Attack Trees and Prioritizing Risk