Lesson 2 of 9 · 22m
Data Flow Diagrams People Actually Read
A DFD is a map of data, trust boundaries, and control points — not architecture art. The notation and level of detail that expose real attack surface.
The fastest way to ruin a threat modeling session is to open a cloud architecture diagram full of VPC icons and call it a DFD. Architecture diagrams show what exists. Data flow diagrams show what the attacker can influence: where data enters, where it crosses trust boundaries, where decisions depend on it, and where controls live.
Use four boring shapes
You do not need a taxonomy seminar. Four elements are enough:
[External entity] user, browser, partner system, attacker-controlled client
(Process) API handler, worker, background job, auth service
<Data store> Postgres, Redis, object storage, queue
--> Data flow request, event, file upload, webhook, tokenThen draw trust boundaries as explicit boxes: internet edge, service-to-service network, cloud account, browser sandbox, third-party control plane. The boundary is where assumptions change. Traffic crossing it deserves scrutiny even when it uses TLS.
A password reset fragment might look like this:
Browser --> POST /reset/request --> API --> enqueue email job --> Queue
|-> write reset token hash --> Postgres
Email link --> GET /reset/consume --> API --> verify token hash, expiry, use countThis tiny diagram already exposes the useful questions: is the token high entropy, stored hashed, single-use, rate-limited, bound to the account state, and invalidated after password change?
Trust boundaries beat network boundaries
A request can cross from public internet into your VPC and still be untrusted. Conversely, a background worker inside your network can become attacker-influenced when it consumes a queue populated by user input. Draw the boundary around trust level, not just subnets.
Include the control plane. CI systems, feature flag services, observability pipelines, support impersonation tools, and admin panels are often more sensitive than the user path and are routinely omitted because "they are internal."
Capture labels, not essays
Annotate flows with the facts that matter:
flow: webhook delivery
authentication: HMAC signature in X-Signature-256
data: order id, amount, currency, event timestamp
threats: replay, forgery, out-of-order processing
controls: timestamp skew check, nonce/idempotency key, constant-time compareIf a control does not exist yet, write control: none instead of leaving it blank. Blank means nobody looked.
Field notes
- One page beats ten. Split large systems into feature-level DFDs with links, never a wall-sized diagram.
- Label the protocol and direction of every flow; arrows with no direction are decoration.
- Add failure paths. Retries, dead-letter queues, exports, backups, and support tools often bypass controls in the happy path.
- Keep the diagram in the repo next to the service; a diagram in a wiki nobody owns becomes fiction.
Was this lesson helpful?