Course contentsShow
← Software Engineering
Lesson 1081 of 1,93332. Security EngineeringFree lesson

Creating Data Flow Diagrams for Security

Building DFDs to visualize system boundaries, data flows, trust boundaries, and potential attack surfaces.

Creating Data Flow Diagrams for Security

You'll learn: How to build Data Flow Diagrams (DFDs) that reveal where your system is vulnerable to attack by mapping data movement and trust boundaries.

Why DFDs Matter for Security

A Data Flow Diagram is like a blueprint of how information travels through your system. For security purposes, it's not just about showing connections—it's about identifying where attackers might strike. By visualizing data flows, you make implicit security assumptions explicit and surface hidden attack surfaces.

The Core Security Elements in a DFD

When building a security-focused DFD, you include:

1. External Entities: Users, third-party services, or attackers interacting with your system
2. Processes: Running code that transforms or handles data (web servers, APIs, background jobs)
3. Data Stores: Databases, caches, file systems where data persists
4. Data Flows: Arrows showing how data moves between components
5. Trust Boundaries: The critical addition—dashed lines showing where trust changes (e.g., Internet → your network, user space → kernel, client → server)

Building Your DFD

Start with the system boundary: what's inside your control and what's outside? Draw external entities (like web browsers or mobile apps) interacting with your entry points (login API, file upload endpoint).

Then trace each data flow: user credentials flow from browser → web server → authentication service → database. Mark trust boundaries wherever data crosses from untrusted to trusted zones.

The attack surface becomes visible: Every data flow crossing a trust boundary is a potential attack vector. Every process handling untrusted input needs validation. Every data store containing sensitive information needs protection.

Think of trust boundaries like border crossings—they're where you need the strictest security checks because that's where threats enter.

Key Takeaway: Data Flow Diagrams map your system's data movement and highlight trust boundaries, making attack surfaces visible and enabling systematic threat identification.