chore(#223): add Data Flow Diagram section to threat-model template#225
Conversation
atlas-apex
left a comment
There was a problem hiding this comment.
Code Review: PR #225
Commit: a19ae5f60cce6dda32d097b974d0385add5b2254
Summary
Doc-only / template change adding a ## Data Flow Diagram section (Mermaid flowchart LR skeleton with three dashed-subgraph trust boundaries + labelled cross-boundary arrows) to templates/audits/threat-model.md, plus a Step 1 update in .claude/skills/threat-model/SKILL.md pointing the operator at the new DFD as the natural starting artefact for STRIDE.
Checklist Results
- Architecture & Design: Pass (no code change; Mermaid choice already settled in AgDR-0003, correctly cited)
- Code Quality: Pass (template-only)
- Testing: N/A (template change, no logic)
- Security: Pass (no auth/secret/PII surface; this PR strengthens security workflow rigor)
- Performance: N/A
- PR Description & Glossary: Pass (Summary + Testing + Glossary all present; glossary covers DFD, STRIDE, trust boundary, Mermaid flowchart,
stroke-dasharray: 5 5, per-run artefact — substantive, not boilerplate) - Technical Decisions (AgDR):N/A (no new decision; AgDR-0003 already governs Mermaid choice and is cited)
Verification of requested checks
- Mermaid syntax valid — confirmed.
flowchart LR, threesubgraph <id> ["..."]blocks (internet,backend,thirdparty), node IDs with proper shapes (user([...]),web[...],db[(...)]),-->|label|arrow annotations on every cross-boundary flow, threestyle <id> stroke-dasharray: 5 5declarations matching the subgraph IDs. Renders cleanly in GitHub's mermaid pipeline. - DFD precedes Attack surface — confirmed. Section ordering: H1 → frontmatter blurb →
## Data Flow Diagram→## Attack surface→ STRIDE table → priority → OWASP → notes. Operator populates the DFD before deriving the attack surface, as intended. - SKILL.md Step 1 references the DFD section — confirmed. Step 1 opens with "Populate the Data Flow Diagram first in this run's per-run artefact (per
templates/audits/threat-model.md§ Data Flow Diagram)" and explicitly states "The STRIDE walk in Step 2 then iterates the DFD's trust-boundary crossings rather than inventing threats ad-hoc" — exactly the workflow shift the change is meant to enforce. - PR body —
## Summary/## Testing/## Glossaryall present. Glossary is unusually substantive (6 terms, each with reasoning, not just definitions). - Commit format —
chore(#223): add Data Flow Diagram section to threat-model templatematchestype(#NN): description. Body has bulleted what + why + Closes #223. - Leak protection — no private project names in PR body or commit messages.
Issues Found
None blocking on the DFD scope.
Notes (non-blocking)
- Stacked-branch artefact:
gh pr viewreports 9 files / 1552 additions because the branch is stacked onfeature/GH-218-audit-artefact-persistence(PR #222). The DFD-scope diff is correctly limited to the two target files; the other 7 files belong to #222 and will collapse out of this PR's view once #222 merges and #225 rebases. Reviewer of record on those 7 files is whoever reviews #222 — Rex's verdict here is scoped to the DFD change only. - CI red — not caused by this PR: the
markdownlint-cli2check is FAILING (MD032/blanks-around-listsin.claude/skills/launch-check/SKILL.md:358), but the offending line is part of the #222 changes, not the DFD. The merge-gate red-CI rule (.claude/rules/pr-quality.md§ "No Red CI Before Merge") still applies — do not merge #225 until either (a) #222 merges first and #225 is rebased, or (b) the lint failure is fixed in this stack. Raising as an advisory because the cause is upstream of this PR's scope.
Verdict
APPROVED (DFD scope). Hold the merge until the markdown-lint failure is resolved per the rule above — it's not in this PR's diff, but the gate still applies.
Reviewed by Rex (Code Reviewer Agent)
Reviewed commit: a19ae5f60cce6dda32d097b974d0385add5b2254
- Add `## Data Flow Diagram` section to `templates/audits/threat-model.md`
before the existing `## Attack surface` section. Section ships a Mermaid
`flowchart` skeleton with three trust boundaries drawn as dashed
subgraphs (public internet, backend network, third-party service),
realistic node placeholders (external user, web frontend, API,
primary data store, external service), and labelled arrows naming the
data that crosses each boundary (auth tokens, user PII, transaction
records, callbacks).
- Update `.claude/skills/threat-model/SKILL.md` Step 1 ("Map the attack
surface") to instruct the operator to populate the DFD section first
and to drive the Step 2 STRIDE walk from the DFD's trust-boundary
crossings rather than ad-hoc threat brainstorming.
Why: proper STRIDE analysis starts with a DFD identifying trust
boundaries — without one, the threat catalogue is invented per-run
rather than systematically derived. Mermaid was chosen as the diagram
language per AgDR-0003 (templates/architecture/c4-context.md and
container.md already use it), so adopters render the skeleton in any
GitHub markdown view with zero build step.
Closes #223
a19ae5f to
7dc4dfa
Compare
atlas-apex
left a comment
There was a problem hiding this comment.
Re-review after rebase onto post-#222 dev.
Verified:
- New HEAD
7dc4dfa6eefce22cdddd714d8de5f55ddebcde2dcontains identical content to previously-approveda19ae5f: DFD section added before## Attack surfaceintemplates/audits/threat-model.md+ Step 1 reference update in.claude/skills/threat-model/SKILL.md. - No scope creep, no rebase artefacts, no missed conflicts.
- CI green: lychee, markdownlint-cli2, Verify Ticket ID all SUCCESS.
Verdict: APPROVED (posted as comment — gh blocks self-approve on own PR).
Approval marker refreshed at .claude/session/reviews/225-rex.approved with new SHA.
Reviewed by Rex (Code Reviewer Agent)
Reviewed commit: 7dc4dfa6eefce22cdddd714d8de5f55ddebcde2d
…225) - Add `## Data Flow Diagram` section to `templates/audits/threat-model.md` before the existing `## Attack surface` section. Section ships a Mermaid `flowchart` skeleton with three trust boundaries drawn as dashed subgraphs (public internet, backend network, third-party service), realistic node placeholders (external user, web frontend, API, primary data store, external service), and labelled arrows naming the data that crosses each boundary (auth tokens, user PII, transaction records, callbacks). - Update `.claude/skills/threat-model/SKILL.md` Step 1 ("Map the attack surface") to instruct the operator to populate the DFD section first and to drive the Step 2 STRIDE walk from the DFD's trust-boundary crossings rather than ad-hoc threat brainstorming. Why: proper STRIDE analysis starts with a DFD identifying trust boundaries — without one, the threat catalogue is invented per-run rather than systematically derived. Mermaid was chosen as the diagram language per AgDR-0003 (templates/architecture/c4-context.md and container.md already use it), so adopters render the skeleton in any GitHub markdown view with zero build step. Closes #223 Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
Summary
## Data Flow Diagramsection totemplates/audits/threat-model.md(between the H1 and the existing## Attack surface). The section ships a Mermaidflowchart LRskeleton with three trust boundaries drawn as dashedsubgraphblocks (public internet, backend network, third-party service), realistic node placeholders (external user, web frontend, API service, primary data store, external service), and labelled arrows naming the data that crosses each boundary (auth tokens, user PII, transaction records, callbacks)..claude/skills/threat-model/SKILL.mdStep 1 ("Map the attack surface") to instruct the operator to populate the DFD section of the per-run artefact first, and to drive the Step 2 STRIDE walk from the DFD's trust-boundary crossings rather than inventing threats ad-hoc.templates/architecture/c4-context.mdandc4-container.mdalready use it), so adopters render the skeleton in any GitHub markdown view with zero build step.Testing
templates/audits/threat-model.mdin GitHub's rendered preview (or a Mermaid-aware viewer like https://mermaid.live/) and confirm the Mermaid block parses without errors.style <id> stroke-dasharray: 5 5declarations apply to each boundary).auth token, user PII)..claude/skills/threat-model/SKILL.mdand confirm Step 1 now leads with the DFD-population instruction and references the template section by name.Glossary
flowchartstroke-dasharray: 5 5style <node_or_subgraph_id> ...— the convention the apexyardc4-container.mdtemplate already uses for soft (logical) boundaries. Used here to visually distinguish trust boundaries from the system's internal structure./threat-modelwrites via_lib-audit-history.shfor each invocation. Each run gets its own artefact stamped with a timestamp; the trend across runs is visible viaaudit_render_trend. The DFD section lives in this artefact (one DFD per run), not in a global doc, so it captures the system's shape at the SHA the threat model was run against.Closes #223