Attack Tree Diagram

An attack tree puts the attacker's goal at the root and breaks it down into the different ways to achieve it. Branches are either OR (any one child is enough) or AND (all children are needed). This sample decomposes "steal customer PII" for a typical web company. Attack trees are not UML: UML covers software structure and behaviour; attack trees are one of the standard security notations used alongside it.


1. The Diagram

Attack Tree: Steal Customer PII Steal customer PII from production database Exploit app vulnerability OR Use stolen admin credential AND Copy exposed backup AND SQL injection search API SSRF to cloud metadata service Phish admin password Defeat MFA OR Find public storage bucket Backup stored unencrypted MFA fatigue push spam SIM swap SMS codes AND AND Red = leaf (concrete attacker action). Unmarked fan-out = OR; arc = AND.

Reading from the top:

  1. The root is the outcome the business fears: customer PII leaving the production database.
  2. Three OR branches give independent routes: exploit the application, use a stolen admin credential, or copy a backup.
  3. Exploit app vulnerability is itself an OR: SQL injection in the search API or SSRF to the cloud metadata service would each work.
  4. Use stolen admin credential is an AND (yellow arc): the attacker needs the password and must get past MFA.
  5. Defeat MFA is an OR of MFA-fatigue push spam or a SIM swap against SMS codes.
  6. Copy exposed backup needs both a publicly reachable bucket and an unencrypted backup. Fixing either one kills the branch.
  7. Red leaves are concrete attacker actions; each should map to a control (WAF and parameterised queries, IMDSv2, number-matching MFA, bucket policies, encryption).

2. How to Read It

Attack Tree Notation Root goal Sub-goal Leaf step every leaf is something an attacker actually does OR any child suffices AND all children needed Schneier (1999) notation; ADTool and threat-modeling tools use the same AND arc.

Plain fan-out means OR; an arc across the edges means AND. Some tools draw AND as a D-shaped gate instead. Tree layout is top-down; the same tree can be written as an indented outline, which is how many teams keep it in a repository.

3. Variant: Annotated with Attacker Cost

Attack Tree: Steal Customer PII (with cheapest-path costs) Steal customer PII $1.5k = min Exploit app vulnerability $5k Use stolen admin credential $1.5k = sum Copy exposed backup $2k = sum SQL injection $5k SSRF to cloud $8k Phish admin $1k Defeat MFA $0.5k = min Find public $2k Backup stored $0 MFA fatigue $0.5k SIM swap $3k AND AND OR node = cheapest child; AND node = sum of children. Highlighted: the attacker's cheapest path.

Give each leaf a value (estimated attacker cost here; probability, skill or detection risk are also common) and propagate upward: an OR node takes the minimum of its children, an AND node the sum. The cheapest route is not the SQL injection everyone worries about but phishing plus MFA fatigue at about $1.5k. That tells you to buy number-matching MFA or FIDO2 keys before another code scanner.

4. Pros, Cons, and When to Use

Pros

Cons

When to use

When not to use

5. Diagrams-as-Code

Mermaid flowchart (AND/OR shown in the node text, since Mermaid has no arc):

flowchart TD
    G["Steal customer PII (OR)"]
    G --> A["Exploit app vulnerability (OR)"]
    G --> B["Use stolen admin credential (AND)"]
    G --> C["Copy exposed backup (AND)"]
    A --> A1[SQL injection in search API]
    A --> A2[SSRF to cloud metadata service]
    B --> B1[Phish admin password]
    B --> B2["Defeat MFA (OR)"]
    B2 --> B2a[MFA fatigue push spam]
    B2 --> B2b[SIM swap for SMS codes]
    C --> C1[Find public storage bucket]
    C --> C2[Backup stored unencrypted]