<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="@bpmnkit/core" exporterVersion="0.0.23" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.9.0">
  <bpmn:error id="Error_CONTAINMENT_FAILED" name="CONTAINMENT_FAILED" errorCode="CONTAINMENT_FAILED"/>
  <bpmn:process id="security-alert-triage" name="Security Alert Triage" isExecutable="true">
    <bpmn:extensionElements>
      <zeebe:versionTag value="1.0.0"/>
    </bpmn:extensionElements>
    <bpmn:startEvent id="alert-received" name="Security alert received">
      <bpmn:outgoing>Flow_alert-received_enrich-alert</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:serviceTask id="enrich-alert" name="Enrich with threat intel">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="threat-intel-enrich"/>
        <zeebe:ioMapping>
          <zeebe:output source="=reputation" target="reputationScore"/>
          <zeebe:output source="=criticality" target="assetCriticality"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_alert-received_enrich-alert</bpmn:incoming>
      <bpmn:outgoing>Flow_enrich-alert_score-alert</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:scriptTask id="score-alert" name="Score alert">
      <bpmn:extensionElements>
        <zeebe:script expression="=reputationScore * assetCriticality" resultVariable="riskScore"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_enrich-alert_score-alert</bpmn:incoming>
      <bpmn:outgoing>Flow_score-alert_real-threat</bpmn:outgoing>
    </bpmn:scriptTask>
    <bpmn:exclusiveGateway id="real-threat" name="Risk score ≥ 20?" default="Flow_real-threat_contain">
      <bpmn:incoming>Flow_score-alert_real-threat</bpmn:incoming>
      <bpmn:outgoing>Flow_real-threat_close-alert</bpmn:outgoing>
      <bpmn:outgoing>Flow_real-threat_contain</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="close-alert" name="Close as false positive">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="siem-alert-close"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_real-threat_close-alert</bpmn:incoming>
      <bpmn:outgoing>Flow_close-alert_alert-closed</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="alert-closed" name="Closed as false positive">
      <bpmn:incoming>Flow_close-alert_alert-closed</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:subProcess id="contain" name="Contain threat">
      <bpmn:incoming>Flow_real-threat_contain</bpmn:incoming>
      <bpmn:outgoing>Flow_contain_case-merge</bpmn:outgoing>
      <bpmn:startEvent id="contain-start">
        <bpmn:outgoing>Flow_contain-start_isolate-host</bpmn:outgoing>
      </bpmn:startEvent>
      <bpmn:serviceTask id="isolate-host" name="Isolate host">
        <bpmn:extensionElements>
          <zeebe:taskDefinition type="edr-host-isolate"/>
          <zeebe:ioMapping>
            <zeebe:output source="=isolated" target="hostIsolated"/>
          </zeebe:ioMapping>
        </bpmn:extensionElements>
        <bpmn:incoming>Flow_contain-start_isolate-host</bpmn:incoming>
        <bpmn:outgoing>Flow_isolate-host_isolation-ok</bpmn:outgoing>
      </bpmn:serviceTask>
      <bpmn:exclusiveGateway id="isolation-ok" name="Isolated?" default="Flow_isolation-ok_containment-failed">
        <bpmn:incoming>Flow_isolate-host_isolation-ok</bpmn:incoming>
        <bpmn:outgoing>Flow_isolation-ok_reset-credentials</bpmn:outgoing>
        <bpmn:outgoing>Flow_isolation-ok_containment-failed</bpmn:outgoing>
      </bpmn:exclusiveGateway>
      <bpmn:serviceTask id="reset-credentials" name="Reset credentials">
        <bpmn:extensionElements>
          <zeebe:taskDefinition type="iam-credentials-reset"/>
        </bpmn:extensionElements>
        <bpmn:incoming>Flow_isolation-ok_reset-credentials</bpmn:incoming>
        <bpmn:outgoing>Flow_reset-credentials_contained</bpmn:outgoing>
      </bpmn:serviceTask>
      <bpmn:endEvent id="contained">
        <bpmn:incoming>Flow_reset-credentials_contained</bpmn:incoming>
      </bpmn:endEvent>
      <bpmn:endEvent id="containment-failed">
        <bpmn:incoming>Flow_isolation-ok_containment-failed</bpmn:incoming>
        <bpmn:errorEventDefinition errorRef="Error_CONTAINMENT_FAILED"/>
      </bpmn:endEvent>
      <bpmn:sequenceFlow id="Flow_contain-start_isolate-host" sourceRef="contain-start" targetRef="isolate-host"/>
      <bpmn:sequenceFlow id="Flow_isolate-host_isolation-ok" sourceRef="isolate-host" targetRef="isolation-ok"/>
      <bpmn:sequenceFlow id="Flow_isolation-ok_reset-credentials" sourceRef="isolation-ok" targetRef="reset-credentials" name="yes">
        <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=hostIsolated</bpmn:conditionExpression>
      </bpmn:sequenceFlow>
      <bpmn:sequenceFlow id="Flow_reset-credentials_contained" sourceRef="reset-credentials" targetRef="contained"/>
      <bpmn:sequenceFlow id="Flow_isolation-ok_containment-failed" sourceRef="isolation-ok" targetRef="containment-failed" name="no"/>
    </bpmn:subProcess>
    <bpmn:boundaryEvent id="on-containment-failed" name="Containment failed" attachedToRef="contain">
      <bpmn:outgoing>Flow_on-containment-failed_manual-containment</bpmn:outgoing>
      <bpmn:errorEventDefinition errorRef="Error_CONTAINMENT_FAILED"/>
    </bpmn:boundaryEvent>
    <bpmn:userTask id="manual-containment" name="Contain manually">
      <bpmn:extensionElements>
        <zeebe:userTask/>
        <zeebe:assignmentDefinition candidateGroups="soc-tier2"/>
        <zeebe:priorityDefinition priority="95"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_on-containment-failed_manual-containment</bpmn:incoming>
      <bpmn:outgoing>Flow_manual-containment_case-merge</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:exclusiveGateway id="case-merge">
      <bpmn:incoming>Flow_manual-containment_case-merge</bpmn:incoming>
      <bpmn:incoming>Flow_contain_case-merge</bpmn:incoming>
      <bpmn:outgoing>Flow_case-merge_open-case</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="open-case" name="Open incident case">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="case-create"/>
        <zeebe:ioMapping>
          <zeebe:output source="=caseId" target="caseId"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_case-merge_open-case</bpmn:incoming>
      <bpmn:outgoing>Flow_open-case_case-opened</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="case-opened" name="Case opened">
      <bpmn:incoming>Flow_open-case_case-opened</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_alert-received_enrich-alert" sourceRef="alert-received" targetRef="enrich-alert"/>
    <bpmn:sequenceFlow id="Flow_enrich-alert_score-alert" sourceRef="enrich-alert" targetRef="score-alert"/>
    <bpmn:sequenceFlow id="Flow_score-alert_real-threat" sourceRef="score-alert" targetRef="real-threat"/>
    <bpmn:sequenceFlow id="Flow_real-threat_close-alert" sourceRef="real-threat" targetRef="close-alert" name="false-positive">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=riskScore &lt; 20</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_close-alert_alert-closed" sourceRef="close-alert" targetRef="alert-closed"/>
    <bpmn:sequenceFlow id="Flow_real-threat_contain" sourceRef="real-threat" targetRef="contain" name="threat"/>
    <bpmn:sequenceFlow id="Flow_on-containment-failed_manual-containment" sourceRef="on-containment-failed" targetRef="manual-containment"/>
    <bpmn:sequenceFlow id="Flow_manual-containment_case-merge" sourceRef="manual-containment" targetRef="case-merge"/>
    <bpmn:sequenceFlow id="Flow_contain_case-merge" sourceRef="contain" targetRef="case-merge"/>
    <bpmn:sequenceFlow id="Flow_case-merge_open-case" sourceRef="case-merge" targetRef="open-case"/>
    <bpmn:sequenceFlow id="Flow_open-case_case-opened" sourceRef="open-case" targetRef="case-opened"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="security-alert-triage_di">
    <bpmndi:BPMNPlane id="security-alert-triage_di_plane" bpmnElement="security-alert-triage">
      <bpmndi:BPMNShape id="alert-received_di" bpmnElement="alert-received">
        <dc:Bounds x="83" y="186" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="20" y="226" width="161" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="enrich-alert_di" bpmnElement="enrich-alert">
        <dc:Bounds x="219" y="164" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="score-alert_di" bpmnElement="score-alert">
        <dc:Bounds x="419" y="164" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="real-threat_di" bpmnElement="real-threat">
        <dc:Bounds x="619" y="179" width="50" height="50"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="588" y="233" width="112" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="close-alert_di" bpmnElement="close-alert">
        <dc:Bounds x="1130" y="628" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="alert-closed_di" bpmnElement="alert-closed">
        <dc:Bounds x="1723" y="650" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1657" y="690" width="168" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="contain_di" bpmnElement="contain" isExpanded="true">
        <dc:Bounds x="769" y="20" width="822" height="368"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="on-containment-failed_di" bpmnElement="on-containment-failed">
        <dc:Bounds x="1162" y="370" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1117" y="410" width="126" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="manual-containment_di" bpmnElement="manual-containment">
        <dc:Bounds x="1691" y="468" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="case-merge_di" bpmnElement="case-merge">
        <dc:Bounds x="1891" y="179" width="50" height="50"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="open-case_di" bpmnElement="open-case">
        <dc:Bounds x="2041" y="164" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="case-opened_di" bpmnElement="case-opened">
        <dc:Bounds x="2241" y="186" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="2220" y="226" width="77" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="contain-start_di" bpmnElement="contain-start">
        <dc:Bounds x="819" y="120" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="isolate-host_di" bpmnElement="isolate-host">
        <dc:Bounds x="955" y="98" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="isolation-ok_di" bpmnElement="isolation-ok">
        <dc:Bounds x="1155" y="113" width="50" height="50"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1148" y="167" width="63" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="reset-credentials_di" bpmnElement="reset-credentials">
        <dc:Bounds x="1305" y="258" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="contained_di" bpmnElement="contained">
        <dc:Bounds x="1505" y="280" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="containment-failed_di" bpmnElement="containment-failed">
        <dc:Bounds x="1337" y="120" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_alert-received_enrich-alert_di" bpmnElement="Flow_alert-received_enrich-alert">
        <di:waypoint x="119" y="204"/>
        <di:waypoint x="219" y="204"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_enrich-alert_score-alert_di" bpmnElement="Flow_enrich-alert_score-alert">
        <di:waypoint x="319" y="204"/>
        <di:waypoint x="419" y="204"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_score-alert_real-threat_di" bpmnElement="Flow_score-alert_real-threat">
        <di:waypoint x="519" y="204"/>
        <di:waypoint x="619" y="204"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_real-threat_close-alert_di" bpmnElement="Flow_real-threat_close-alert">
        <di:waypoint x="644" y="229"/>
        <di:waypoint x="644" y="668"/>
        <di:waypoint x="1130" y="668"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="838" y="644" width="98" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_close-alert_alert-closed_di" bpmnElement="Flow_close-alert_alert-closed">
        <di:waypoint x="1230" y="668"/>
        <di:waypoint x="1723" y="668"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_real-threat_contain_di" bpmnElement="Flow_real-threat_contain">
        <di:waypoint x="669" y="204"/>
        <di:waypoint x="769" y="204"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="698" y="180" width="42" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_on-containment-failed_manual-containment_di" bpmnElement="Flow_on-containment-failed_manual-containment">
        <di:waypoint x="1180" y="406"/>
        <di:waypoint x="1180" y="508"/>
        <di:waypoint x="1691" y="508"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_manual-containment_case-merge_di" bpmnElement="Flow_manual-containment_case-merge">
        <di:waypoint x="1741" y="468"/>
        <di:waypoint x="1741" y="204"/>
        <di:waypoint x="1891" y="204"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_contain_case-merge_di" bpmnElement="Flow_contain_case-merge">
        <di:waypoint x="1180" y="20"/>
        <di:waypoint x="1180" y="-20"/>
        <di:waypoint x="1916" y="-20"/>
        <di:waypoint x="1916" y="179"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_case-merge_open-case_di" bpmnElement="Flow_case-merge_open-case">
        <di:waypoint x="1941" y="204"/>
        <di:waypoint x="2041" y="204"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_open-case_case-opened_di" bpmnElement="Flow_open-case_case-opened">
        <di:waypoint x="2141" y="204"/>
        <di:waypoint x="2241" y="204"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_contain-start_isolate-host_di" bpmnElement="Flow_contain-start_isolate-host">
        <di:waypoint x="855" y="138"/>
        <di:waypoint x="955" y="138"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_isolate-host_isolation-ok_di" bpmnElement="Flow_isolate-host_isolation-ok">
        <di:waypoint x="1055" y="138"/>
        <di:waypoint x="1155" y="138"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_isolation-ok_reset-credentials_di" bpmnElement="Flow_isolation-ok_reset-credentials">
        <di:waypoint x="1180" y="163"/>
        <di:waypoint x="1180" y="298"/>
        <di:waypoint x="1305" y="298"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1156" y="224" width="40" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_reset-credentials_contained_di" bpmnElement="Flow_reset-credentials_contained">
        <di:waypoint x="1405" y="298"/>
        <di:waypoint x="1505" y="298"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_isolation-ok_containment-failed_di" bpmnElement="Flow_isolation-ok_containment-failed">
        <di:waypoint x="1205" y="138"/>
        <di:waypoint x="1337" y="138"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1251" y="114" width="40" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

