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.
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.
| Question | Diagram | Sample page |
|---|---|---|
| What can go wrong, and where? | Data flow diagram with trust boundaries + STRIDE | STRIDE Threat Model DFD |
| Does our login / token protocol leak anything? | UML sequence diagram | OAuth 2.0 / OIDC Sequence |
| If one server falls, what else can the attacker reach? | Network segmentation (topology) diagram | Network Segmentation Diagram |
| Which attack is cheapest, so what do we fix first? | Attack tree (AND/OR) | Attack Tree Diagram |
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.