Security Diagrams

STRIDE Threat Model DFDsecurityAn online shop's data flow diagram with trust boundaries, six numbered STRIDE threats and a… OAuth 2.0 / OIDC SequencesecurityOpenID Connect sign-in with the authorization code flow and PKCE, plus an alt fragment for stolen-code and… Network Segmentation DiagramsecurityDMZ, app, data and management zones with port-level rules, an egress proxy and a NIST zero-trust variant. Attack Tree DiagramsecurityThe goal "steal customer PII" decomposed into AND/OR steps, then costed to find the cheapest attack path.

Security reviews need diagrams that answer specific questions: where untrusted data enters, how a protocol hands out secrets, what an attacker can reach after the first foothold, and which attack is cheapest. This section has one worked sample for each, drawn the way a security architect would present it in a design review.


Which Diagram for Which Question

Four Diagrams, Four Security Questions Security design review one system, four views STRIDE DFD What can go wrong where? OAuth / OIDC sequence Is the auth protocol right? Segmentation diagram What can reach what? Attack tree What is the cheapest attack?

Only one of these is UML. The OAuth/OIDC page is a UML 2.5 sequence diagram. The other three are not UML: UML covers software structure and behaviour; data flow diagrams, network topology diagrams and attack trees are the other standard notations used alongside it for security work.

They work best together. The STRIDE DFD finds threats element by element. The attack tree ranks them from the attacker's side. The segmentation diagram shows how far a successful attack spreads. The sequence diagram checks that a protocol does every validation step in the right order.

QuestionDiagramSample page
What can go wrong, and where?Data flow diagram with trust boundaries + STRIDESTRIDE Threat Model DFD
Does our login / token protocol leak anything?UML sequence diagramOAuth 2.0 / OIDC Sequence
If one server falls, what else can the attacker reach?Network segmentation (topology) diagramNetwork Segmentation Diagram
Which attack is cheapest, so what do we fix first?Attack tree (AND/OR)Attack Tree Diagram

Conventions on These Pages

All diagrams use the same palette: blue boxes for ordinary components, yellow for trust boundaries, firewalls and the elements that matter most, green for successful or zero-trust paths and red for untrusted networks, attacker actions and error paths. Every page also gives the main diagram as code (Mermaid, PlantUML or Graphviz) so you can keep it next to the source and update it in pull requests, plus pros, cons and guidance on when a different diagram would serve better.

A good habit: number every threat, rule or attacker step on the diagram and reference those numbers in tickets and tests. A diagram that nobody can trace to a control is decoration; one with numbers becomes the checklist for the next review.