0Pricing
Cyber Security Academy · Lesson

Data Flow Diagrams and Trust Boundaries

Mapping how data moves and where it crosses trust lines.

Data Flow Diagrams and Trust Boundaries is a free Cyber Security Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Why Diagram First

You cannot find threats in a system you do not understand. A Data Flow Diagram (DFD) is the foundation of threat modeling: it visually maps how data moves through your system.

The diagram makes implicit assumptions explicit. Once you can see where data goes and who touches it, threats become far easier to spot.

The Four DFD Elements

A DFD uses just four building blocks. Keep them simple:

  • External entity — a person or system outside your control (user, third-party API)
  • Process — something that transforms data (a service, a function)
  • Data store — where data rests (database, file, cache)
  • Data flow — the movement of data between elements (an arrow)

Almost any system can be represented with these four shapes.

Standard DFD Notation

DFDs use conventional shapes so anyone can read them:

External entity   ->  rectangle / square
Process           ->  circle (or rounded rectangle)
Data store        ->  two parallel lines (open rectangle)
Data flow         ->  labeled arrow
Trust boundary    ->  dashed line crossing flows

A Simple Web App DFD

Consider a basic web application. Its DFD might look like this in text form:

User (external) --HTTPS request--> Web App (process)
Web App --SQL query--> Database (data store)
Web App --API call--> Payment Provider (external)
Database --results--> Web App
Web App --HTTPS response--> User

What Is a Trust Boundary

A trust boundary is any line in your diagram where the level of trust changes. On one side, data or callers are trusted; on the other, they are not.

Trust boundaries are the most security-relevant feature of a DFD because they mark where:

  • Data should be validated
  • Callers should be authenticated and authorized
  • Privilege levels change

Most vulnerabilities live exactly where data crosses a trust boundary.

Common Trust Boundaries

Once you start looking, trust boundaries are everywhere. Common examples:

  • The internet to your application (untrusted user input arrives)
  • The application to the database
  • Between a low-privilege and high-privilege process
  • Between your system and a third-party API
  • Between a container and the host
  • Across network segments (DMZ to internal)

Each boundary deserves explicit scrutiny.

Drawing Boundaries on the DFD

Add trust boundaries as dashed lines that cut across the data flows they affect. In our web app:

User (external)
  | HTTPS
- - - - - - - - - - - -  <- Trust boundary: internet / app
  v
Web App (process)
  | SQL
- - - - - - - - - - - -  <- Trust boundary: app / database
  v
Database (data store)

Boundaries Tell You Where to Apply STRIDE

Trust boundaries connect this lesson to STRIDE. The data flows that cross a boundary are where you focus your STRIDE analysis.

At the internet-to-app boundary, ask:

  • Spoofing — is the caller authenticated?
  • Tampering — is input validated?
  • Information disclosure — is the channel encrypted?
  • Denial of service — is there rate limiting?

Boundaries turn an abstract framework into concrete questions.

Choosing the Right Granularity

A DFD can be too vague or too detailed. Both fail.

  • Too high level — one box labeled 'the system' hides all the interesting boundaries
  • Too detailed — every function and variable, drowning you in noise

Aim for the level where each major component and trust boundary is visible. Use layered DFDs: a context diagram for the whole system, then drill into complex processes separately.

Validate the Diagram with the Team

A DFD drawn by one person usually contains wrong assumptions. Walk through it with the people who built the system.

Ask probing questions:

  • Is this really the only way data reaches the database?
  • Are there admin or batch paths not shown here?
  • Does anything bypass this authentication step?
  • Are there cached copies of this data elsewhere?

Hidden data flows are a frequent source of missed vulnerabilities.

Keep the Diagram Alive

Systems change, and a stale DFD becomes misleading. An outdated diagram is worse than none because it creates false confidence.

Update the DFD when:

  • A new integration or external dependency is added
  • A new data store appears
  • The trust model changes (a service moves to a new network zone)

Treat the DFD as documentation that lives alongside the system, not a one-time artifact.

Quick Check

Test your understanding of DFDs and trust boundaries.

Recap

You learned to map systems for threat modeling:

  • A DFD uses four elements: external entities, processes, data stores, and data flows
  • Trust boundaries mark where trust changes and where most vulnerabilities live
  • Data flows crossing a boundary are where you focus STRIDE analysis
  • Choose the right granularity and use layered diagrams
  • Validate the DFD with the team and keep it current

Next, you will rank threats with attack trees and prioritize mitigations.

Frequently asked questions

Is the “Data Flow Diagrams and Trust Boundaries” lesson free?

Yes — the full text of “Data Flow Diagrams and Trust Boundaries” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “Data Flow Diagrams and Trust Boundaries”?

Mapping how data moves and where it crosses trust lines. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cyber Security Academy?

No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Data Flow Diagrams and Trust Boundaries” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cyber Security Academy lesson?

Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Threat Modeling Matters
  2. The STRIDE Framework
  3. Data Flow Diagrams and Trust Boundaries
  4. Attack Trees and Prioritizing Risk
← Back to Cyber Security Academy