Skip to content

Working with Data Flow Diagrams

Eric Fitzgerald edited this page Nov 12, 2025 · 5 revisions

Working with Data Flow Diagrams

Comprehensive guide to creating and editing data flow diagrams (DFDs) in TMI.

Overview

Data flow diagrams are visual representations of how data moves through your system. They help identify trust boundaries, data flows, and potential threat surfaces.

Diagram Basics

What is a Data Flow Diagram?

A DFD shows:

  • Components that process or store data
  • Data flows between components
  • Trust boundaries that separate security zones
  • External entities that interact with the system

When to Use DFDs

  • Threat modeling applications and systems
  • Security architecture reviews
  • Identifying attack surfaces
  • Documenting data handling

Creating a Diagram

Starting a New Diagram

  1. Open your threat model
  2. Click "New Diagram" or "Add Diagram"
  3. Give it a descriptive name
  4. Start adding components

Diagram Types

Consider creating different diagram types:

  • Context Diagram: High-level system overview
  • Level 0: Major system components
  • Level 1+: Detailed subsystem views
  • Sequence Diagrams: Time-based interactions (future feature)

Component Types

Process

Represents a component that transforms or processes data.

Visual: Rectangle

Examples:

  • Web Server
  • Authentication Service
  • Payment Processor
  • Data Transformer

Properties:

  • Name: Identifies the process
  • Description: What it does
  • Type: Process type (if applicable)

Data Store

Represents where data is stored.

Visual: Parallel horizontal lines

Examples:

  • Database
  • File System
  • Cache
  • Message Queue
  • Log Storage

Properties:

  • Name: Store identifier
  • Description: What data is stored
  • Type: Storage type

External Entity

Represents external users or systems.

Visual: Square/Rectangle

Examples:

  • End Users
  • Third-party APIs
  • External Services
  • Administrators

Properties:

  • Name: Entity name
  • Description: What/who it represents
  • Type: User, System, Service

Data Flow

Represents data moving between components.

Visual: Arrow

Examples:

  • API Request
  • Database Query
  • File Transfer
  • Event Message

Properties:

  • Label: What data flows
  • Direction: One-way or bidirectional
  • Protocol: HTTP, HTTPS, gRPC, etc.

Trust Boundary

Represents security or trust zone boundaries.

Visual: Dashed line or box

Examples:

  • Internet to DMZ
  • DMZ to Internal Network
  • Application tier to Data tier
  • Authenticated vs Unauthenticated

Properties:

  • Name: Boundary identifier
  • Description: What the boundary separates

Adding Components

Using the Toolbar

  1. Select component type from toolbar
  2. Click on canvas where you want to place it
  3. Enter name (double-click to edit)
  4. Add properties in the properties panel

Drag and Drop

Some implementations support:

  • Dragging from component palette
  • Dropping on canvas
  • Automatic connection

Connecting Components

Creating Data Flows

  1. Select the data flow tool
  2. Click on source component
  3. Click on destination component
  4. Label the flow with data description

Flow Direction

  • One-way: Single arrow
  • Bidirectional: Double arrow or two separate flows
  • Multiple flows: Create separate flow for each data type

Labeling Flows

Be specific about what data flows:

Good labels:

  • "Customer PII (name, email, address)"
  • "Authentication Token (JWT)"
  • "Credit Card Data (PAN, CVV)"
  • "Database Query (SQL)"

Poor labels:

  • "Data"
  • "Request"
  • "Info"

Trust Boundaries

Why Trust Boundaries Matter

Trust boundaries mark where:

  • Security context changes
  • Authentication is required
  • Data sensitivity changes
  • Threat landscape differs

Common Trust Boundaries

  • Internet to DMZ: Public to semi-trusted
  • DMZ to Internal: Semi-trusted to trusted
  • Process isolation: Between different security contexts
  • Network segmentation: Between network zones

Adding Trust Boundaries

  1. Select boundary tool
  2. Draw boundary around related components
  3. Label the boundary
  4. Document what it represents

Best Practices

Start Simple

  • Begin with high-level view
  • Add detail incrementally
  • Create multiple diagrams for complex systems

Clear Naming

  • Use descriptive, consistent names
  • Avoid abbreviations unless well-known
  • Include role/function in name

Show All Data Flows

  • Document all data movement
  • Include error flows
  • Show authentication/authorization flows

Mark Trust Boundaries

  • Identify all security zone changes
  • Show where authentication occurs
  • Mark where data sensitivity changes

Keep Diagrams Focused

  • One diagram per system/subsystem
  • Don't overcrowd a single diagram
  • Link related diagrams

Use Consistent Style

  • Similar components get similar shapes
  • Consistent naming conventions
  • Uniform level of detail

Editing Diagrams

Selecting Components

  • Click to select
  • Shift+Click for multiple selection
  • Drag box to select multiple

Moving Components

  • Drag selected component
  • Arrow keys for precise movement
  • Snap to grid (if enabled)

Resizing Components

  • Drag corner handles to resize
  • Maintain aspect ratio
  • Size to fit label

Deleting Components

  • Select component
  • Press Delete key
  • Or right-click → Delete

Copying Components

  • Select component
  • Ctrl/Cmd+C to copy
  • Ctrl/Cmd+V to paste

Linking Threats to Diagrams

Why Link Threats?

  • Visual representation of threat locations
  • Easy identification of affected components
  • Better understanding of threat context

Creating Links

  1. Create or edit a threat
  2. Find "Linked Components" section
  3. Select diagram components affected by threat
  4. Save

Visual Indicators

Linked components may show:

  • Highlight or badge
  • Risk level indicator
  • Count of linked threats

Example Diagrams

Example 1: Simple Web Application

[User] --HTTPS--> [Web Server]
                      |
                  HTTP/DB
                      ↓
                 [Database]

Trust boundary: Between User and Web Server

Example 2: Microservices Architecture

[Mobile App] ────┐
                 │
[Web App] ───────┼──HTTPS──> [API Gateway] ──> [Auth Service]
                 │                   │
[Admin UI] ──────┘                   ├──> [User Service] ──> [User DB]
                                     │
                                     └──> [Order Service] ──> [Order DB]

Trust boundaries:

  • Internet to API Gateway
  • API Gateway to internal services

Example 3: Payment Processing

[Customer] --credit card--> [Web App] ════════════╗
                                ║ Trust Boundary  ║
    ╔═══════════════════════════╝                 ║
    ║                                              ║
    ║ [Payment Service] --tokenize--> [Tokenizer] ║
    ║         |                                    ║
    ║     process                                  ║
    ║         ↓                                    ║
    ║ [Payment Gateway] <--external-->             ║
    ╚══════════════════════════════════════════════╝

Collaboration on Diagrams

Real-Time Editing

  • Multiple users can edit simultaneously
  • See collaborator cursors
  • Changes appear immediately
  • Automatic conflict resolution

Collaboration Best Practices

  • Communicate: Let others know before major changes
  • Small changes: Make incremental updates
  • Review together: Use for design sessions
  • Save often: Though auto-save handles this

Exporting Diagrams

Export Formats (Future Features)

Potential export options:

  • PNG image
  • SVG vector
  • PDF document
  • JSON data

Embedding in Documentation

  • Screenshot for presentations
  • Link directly in threat model notes
  • Reference in external documentation

Tips for Effective Diagrams

Focus on Data

  • Emphasize data flows over implementation details
  • Show what data moves, not how
  • Include data classification/sensitivity

Identify Assets

  • Highlight valuable data stores
  • Show where credentials are handled
  • Mark PII and sensitive data

Show Authentication Points

  • Where authentication occurs
  • Where authorization is checked
  • Session management points

Document Assumptions

  • Use notes to document what's included/excluded
  • Clarify trust assumptions
  • Note out-of-scope items

Next Steps

Related Topics

Home

Releases


Getting Started

Deployment

Operation

Troubleshooting

Development

Integrations

Tools

API Reference

Reference

Clone this wiki locally