<mxfile host="app.diagrams.net" agent="ThreatTree" version="24.0.0" type="device">
  <diagram name="DFD Template" id="dfd-template">
    <mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="750" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />

        <!-- Legend -->
        <mxCell id="legend-box" value="Legend" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=#94A3B8;verticalAlign=top;align=left;fontStyle=1;fontSize=12;spacingLeft=6;spacingTop=4;" vertex="1" parent="1">
          <mxGeometry x="20" y="20" width="220" height="180" as="geometry" />
        </mxCell>
        <mxCell id="legend-entity" value="External Entity" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#666666;fontSize=11;" vertex="1" parent="1">
          <mxGeometry x="30" y="50" width="120" height="30" as="geometry" />
        </mxCell>
        <mxCell id="legend-process" value="Process" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DAE8FC;strokeColor=#6C8EBF;fontSize=11;" vertex="1" parent="1">
          <mxGeometry x="30" y="90" width="120" height="30" as="geometry" />
        </mxCell>
        <mxCell id="legend-store" value="Data Store" style="shape=cylinder;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=12;fillColor=#FFF2CC;strokeColor=#D6B656;fontSize=11;" vertex="1" parent="1">
          <mxGeometry x="30" y="130" width="120" height="40" as="geometry" />
        </mxCell>
        <mxCell id="legend-boundary" value="Trust Boundary" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=none;strokeColor=#DC2626;fontColor=#DC2626;fontSize=11;verticalAlign=top;" vertex="1" parent="1">
          <mxGeometry x="30" y="180" width="120" height="10" as="geometry" />
        </mxCell>

        <!-- External entities -->
        <mxCell id="customer" value="Customer&#10;(web browser)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="420" y="40" width="160" height="60" as="geometry" />
        </mxCell>
        <mxCell id="payment" value="Payment Provider&#10;(e.g. Stripe)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="740" y="240" width="160" height="60" as="geometry" />
        </mxCell>

        <!-- Trust boundary -->
        <mxCell id="boundary" value="Trust Boundary: Production VPC" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;fillColor=none;strokeColor=#DC2626;fontColor=#DC2626;fontStyle=1;verticalAlign=top;align=left;spacingLeft=8;spacingTop=6;" vertex="1" parent="1">
          <mxGeometry x="300" y="200" width="380" height="320" as="geometry" />
        </mxCell>

        <!-- Process and data store inside boundary -->
        <mxCell id="webapp" value="Web Application" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DAE8FC;strokeColor=#6C8EBF;" vertex="1" parent="1">
          <mxGeometry x="420" y="260" width="160" height="60" as="geometry" />
        </mxCell>
        <mxCell id="database" value="Customer Database&#10;(PII, order history)" style="shape=cylinder;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#FFF2CC;strokeColor=#D6B656;" vertex="1" parent="1">
          <mxGeometry x="420" y="420" width="160" height="70" as="geometry" />
        </mxCell>

        <!-- Data flows -->
        <mxCell id="e1" value="HTTPS: login / submit order" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;fontSize=11;" edge="1" parent="1" source="customer" target="webapp">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e2" value="SQL: read/write customer data" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;fontSize=11;" edge="1" parent="1" source="webapp" target="database">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e3" value="HTTPS: charge card" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;fontSize=11;" edge="1" parent="1" source="webapp" target="payment">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="e4" value="Webhook: payment confirmation" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;fontSize=11;" edge="1" parent="1" source="payment" target="webapp">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>

        <!-- Instructions note -->
        <mxCell id="note" value="Replace the example entities, processes, and data stores above with your own system. Every data flow crossing the trust-boundary line is a candidate for a STRIDE review." style="text;html=1;fontSize=11;fontColor=#64748B;align=left;verticalAlign=top;whiteSpace=wrap;" vertex="1" parent="1">
          <mxGeometry x="20" y="580" width="440" height="60" as="geometry" />
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
