01 Your first threat model · Beginner

Generate attack trees from your diagram

Pick threats from the dictionary for the elements of your diagram, and turn them into an attack tree of suggestions to review.

Free Lesson 3 of 5 4 min Updated

In this lesson you will learn

  • How the threat dictionary matches threats to element types
  • When to build one tree, or one per attacker goal
  • Why generated threats start as suggestions

From elements to threats

Every element type has threats that apply to it: an application server can have injection flaws and broken access control, a database can have excessive account privileges. ThreatTree keeps these in a threat dictionary of more than 1,100 threats across more than 170 element types. Generate attack trees lets you pick the ones that apply and builds an attack tree from them.

The result is a draft. Nothing reaches the risk register until a person has reviewed it, which is the next lesson.

Steps

Generating attack trees in ThreatTree: opening Generate attack trees, ticking broken access control, insecure direct object reference and injection on the Expenses API, and generating one tree of suggestions.
Watch: picking three threats on the Expenses API and generating a tree of suggestions.
  1. Open the dialog

    In the DFD editor, click Generate attack trees in the top bar. The dialog lists every element of the diagram with the number of dictionary threats for it. Elements that exchange data with an external entity, or sit at either end of a flow that crosses a trust boundary, are marked Exposed.

  2. Choose how to group the threats

    One tree puts everything you pick into a single tree, grouped by attacker goal. It is the best choice when you build trees a few threats at a time. One tree per attacker goal makes up to five trees: access, data theft, tampering, disruption and accountability.

  3. Pick the threats that apply

    Open an element and tick the threats that are real for your system. Select: Exposed elements ticks every threat on exposed elements at once. Pick a few related threats at a time, so each tree stays readable.

    The Generate attack trees dialog in ThreatTree, with five threats ticked on the Expenses API: injection, broken authentication, broken access control, hardcoded secrets and insecure direct object reference.
    Five threats ticked on the Expenses API, grouped into one tree.
  4. Generate and open the tree

    Click Generate. The result says how many suggested threats were added and links to the new tree. The Attack Trees button in the top bar lists every tree built from this diagram.

    ThreatTree's result message: Added 7 suggested threats in 1 new attack tree, with a link to the tree Threats: Expenses API, Claims database.
    Seven suggested threats in one new tree.

Run it again later. Threats already in a tree for this diagram are locked in the dialog, so you can come back and build more trees without duplicates.

Practice

Try it

Open your diagram, click Generate attack trees and pick three to five threats on the element users reach first. Generate one tree, then open it from the link in the result.

Open My Forests

Quiz

Check what you learned

Three quick questions. Your answers stay in this browser.

1 Where do generated threats come from?
2 Do generated threats go straight into the risk register?
3 You have already built a tree from some threats. What happens to them next time you open Generate attack trees?