skip to content

How does the Microsoft Threat Modeling Tool turn a diagram you drew into a list of threats?

level: middleimportance: should knowfreq 46%

answer

  1. The template does the thinking, not the tool
  2. Stencils carry properties; rules read properties
  3. Analysis walks interactions, not elements alone
  4. Generic stencil means generic threats only
  5. States and justifications are the real output

basics

~20 s

A template supplies stencils with properties and threat rules. You place stencils and set their properties, and the rule engine walks each interaction between elements, firing every rule whose conditions match and emitting a STRIDE-categorised threat you then triage.

solid answer

~50 s

The tool is template-driven. A template is a stencil set — the element types you can drop on the canvas — where each stencil carries properties, plus a rule library written against those properties. You draw the diagram and answer the properties: is this flow authenticated, is this store encrypted, does this cross a trust boundary. Then the analysis pass walks every interaction, meaning every data flow with its source and target, and fires each rule whose conditions the interaction satisfies. Out comes a generated threat list, each item categorised by STRIDE, with a state you move — not started, needs investigation, not applicable, mitigated — a justification field, and an HTML report at the end. The consequence is that its knowledge is exactly its template: an element type with no stencil gets mapped onto a generic one and produces generic rule output until someone extends the template.

go deeper

for a junior

Recall that you draw a diagram from stencils, fill in each element's properties, and the tool then generates a STRIDE-categorised threat list for you to work through and mark up.

for a middle

Explain the mechanism: template equals stencils plus properties plus rules, and the analysis pass fires matching rules per interaction. Expect to be asked what happens when no stencil fits the component.

for a senior

Demonstrate the triage judgment — collapsing repeated templated lines into the few real design questions, writing justifications that are reusable evidence, and flagging which elements were mapped onto generic stencils.

for a principal

Own the decision of whether your organisation maintains an extended template at all, and who owns it, versus accepting generic output and spending the effort on human review instead.

## The pipeline The Microsoft Threat Modeling Tool does not look at your system. It looks at a graph you drew and at a template, and the template does all the thinking. **Step 1 — the template.** A template bundles two things. First, *stencils*: the element types you are allowed to place, arranged in a hierarchy under the generic data-flow-diagram element types (a generic process, a generic data store, a generic external interactor, a generic data flow). A more specific stencil, say a web application or a database, inherits from its generic parent. Second, each stencil carries *properties* — small enumerated questions about that element — and the template carries a library of *threat rules* written as conditions over those properties. **Step 2 — the drawing, which is also data entry.** Drawing the diagram is only half the work. Every element and flow has a property sheet, and filling it in is what makes the output differ from the default. Marking a flow as carrying no authentication, or a store as unencrypted, or drawing a trust boundary across a flow, changes which rule conditions evaluate true. **Step 3 — the analysis pass.** The tool walks the model *per interaction*: a data flow together with its source element and its target element. For each interaction it evaluates every rule in the template's library; each rule that matches emits a threat instance, with the element names substituted into a templated title and description, and a STRIDE category attached. **Step 4 — triage, which is the part the tool cannot do.** Each generated threat arrives in a state — not started — and you move it to needs investigation, not applicable, or mitigated, adding a justification. Those justifications are the real output: they are the record of what you decided and why. The tool then produces an HTML report of the model, the threats and their states. ## Why the output repeats itself Because the titles are templated per interaction, a model of any size produces the same line over and over with different names in it — a spoofing threat named against every external entity, a tampering or sniffing threat named against every flow. This is not a malfunction; it is what a rule engine that fires per interaction is supposed to do. Read as a *floor* it is useful: it guarantees that no flow in the model went completely unexamined, and it is a serviceable checklist for a team that has never done this before. Read as a *finding list* it is misleading, because thirty instances of one templated line are one design question, not thirty tickets. The reviewer's job is to collapse the repeats into the small number of distinct design decisions behind them, mark the rest not applicable with a reason that says which control already handles them, and then spend the remaining time on the threats the template could never have known about — the business rule, the operational shortcut, the assumption someone inherited. ## The element with no stencil The tool's stencil sets were drawn for particular styles of architecture, and its default vocabulary shows its origins in on-premises, Windows-shaped systems. Model something the template has no stencil for — a managed message topic, a serverless function, a managed identity — and you have three options, all of which have a cost. - **Map it to the nearest generic stencil.** The model still validates and the rules still fire, but only the generic ones. You get spoofing and tampering boilerplate against a generic process and lose everything specific to that component: nobody asks about the topic's subscription authorisation, its retention, its replay behaviour, or who can create a subscriber. - **Map it to a specific but wrong stencil.** Worse than generic, because the generated threats are now confidently about something the system does not contain, and a later reader believes them. - **Extend the template.** Add the stencil, its properties and its rules. This is the correct fix and it is real work: someone must know both the component and the rule syntax, and the extended template becomes a thing your organisation now maintains. The lesson generalises to every rule-driven modeling tool: *the tool knows what its library knows*. Its silence about a component is not evidence that the component is safe; it is evidence that nobody wrote a rule about it. When you take output from this tool into a review, say out loud which elements were mapped onto generic stencils, because that list is precisely where the generated threats are least trustworthy.

  • You mark forty generated threats not applicable. What should the justification field say?
    Name the control or fact that makes it not applicable, not the conclusion. 'Flow is mutual-TLS inside the mesh, cert rotation owned by platform' is reusable evidence; 'N/A' is noise that the next reviewer has to redo. Those justifications are also where a wrong assumption becomes visible later — if the mesh claim turns out to be false, every threat dismissed on it reopens at once, and you can find them because you wrote the reason down.
  • Does drawing a trust boundary change what the tool generates?
    Yes. Boundary crossing is one of the conditions rules are written against, so a flow that crosses a boundary matches rules that an internal flow does not, and elevation-of-privilege and spoofing style rules key on it heavily. This is also why a missing boundary is the most expensive drawing error in this tool: the rules quietly stop firing, and the report looks clean rather than incomplete.
  • Can you make the tool generate threats for a component type it has never heard of?
    Only by extending the template: add the stencil, give it the properties that matter, and write rules against them. Until then the component maps to a generic stencil and receives generic boilerplate, which reads like coverage but is not. Treat template extension as a maintained asset with an owner, because a half-extended template is worse than a plain one — it looks authoritative about components it barely models.

It works like a spell-checker: it flags every word missing from its dictionary and stays silent on the words it has never heard of, which is not the same as approving them.

saying these in an interview costs you the question

  • Believing the tool inspects the running system
  • Treating every generated line as a separate finding
  • Assuming no generated threat means no threat
  • Ignoring element properties and taking defaults
  • Not knowing rules fire per interaction

context