Attack Flow Styles¶
Styles for attack flow arrows and connections.
Flow Classes¶
| Class | Type | Style |
|---|---|---|
normal-flow |
Standard data flow | Solid arrow |
attack-flow |
Attack vector | Red dashed |
exfil-flow |
Data exfiltration | Orange dashed |
Usage¶
...d2/styles/attackflow.d2
# Normal data flow
client -> server: API Request { class: normal-flow }
# Attack flow
attacker -> server: SQL Injection { class: attack-flow }
# Exfiltration
server -> attacker: Stolen Data { class: exfil-flow }
Color Reference¶
Normal Flow¶
Attack Flow¶
Exfiltration Flow¶
Complete Example¶
...d2/styles/all.d2
direction: right
# Elements
attacker: Attacker { class: external-entity-malicious }
browser: Browser { class: browser }
gateway: Gateway { class: gateway }
agent: Agent { class: agent }
creds: Credentials { class: datastore-sensitive }
# Attack chain
attacker -> browser: 1. Malicious page {
class: attack-flow
style.stroke: "#c62828"
}
browser -> gateway: 2. WebSocket {
class: attack-flow
}
gateway -> agent: 3. Commands {
class: attack-flow
}
agent -> creds: 4. Read {
class: normal-flow
}
creds -> attacker: 5. Exfiltrate {
class: exfil-flow
}
Numbered Attack Steps¶
For attack chain diagrams, number the steps:
# Step annotations
step1: "① Initial Access" { class: threat-box-spoofing }
step2: "② Execution" { class: threat-box-tampering }
step3: "③ Exfiltration" { class: threat-box-info-disclosure }
# Connect to flows
step1 -> attacker -> browser
step2 -> browser -> agent
step3 -> agent -> attacker
Bidirectional Flows¶
For two-way communication:
Flow Labels with Techniques¶
Include MITRE ATT&CK technique IDs: