{
  "type": "workflow_collections",
  "macros": [],
  "exported_tags": [
    "Microsoft",
    "microsoft-management-activity-v2",
    "use-case"
  ],
  "data": [
    {
      "@type": "WorkflowCollection",
      "name": "SOC Use Cases - Microsoft Management Activity v2",
      "description": "Audit-driven detections over the Office 365 Management Activity feed: pull the SharePoint and Exchange audit records since a time and raise one alert when they include suspicious sharing or mailbox rule events.",
      "visible": true,
      "image": null,
      "uuid": "63a9d3ff-648d-563e-95c4-b00a3bcc2dbd",
      "recordTags": [
        "microsoft-management-activity-v2",
        "Microsoft",
        "use-case"
      ],
      "workflows": [
        {
          "@type": "Workflow",
          "name": "Audit - Suspicious sharing and mailbox rule events",
          "aliasName": null,
          "tag": "",
          "recordTags": [],
          "description": "Pull the Audit.SharePoint and Audit.Exchange records since a time (each paged in 24-hour windows). Keep the records whose operation creates or extends access (SharingSet, AnonymousLinkCreated, SecureLinkCreated, SharingInvitationCreated) or changes a mailbox rule (New-InboxRule, Set-InboxRule, UpdateInboxRules). When any remain, log one alert with the operations and the actors. A clean window ends without an alert.",
          "isActive": false,
          "debug": false,
          "singleRecordExecution": false,
          "remoteExecutableFlag": 0,
          "parameters": [
            "since"
          ],
          "synchronous": false,
          "triggerStep": "/api/3/workflow_steps/3f2c1096-9638-5386-8fa7-7d9e5d3b4e61",
          "steps": [
            {
              "@type": "WorkflowStep",
              "name": "Start",
              "description": null,
              "arguments": {
                "inputVariables": [
                  {
                    "name": "since"
                  }
                ],
                "title": "Audit - Suspicious sharing and rule events",
                "resources": [
                  "alerts"
                ],
                "route": "488a7c66-78a0-5b0e-975c-5d1653e7f467",
                "step_variables": {
                  "input": {
                    "params": {
                      "since": "{{vars.request.data[\"since\"]}}"
                    },
                    "records": "{{vars.input.records}}"
                  }
                },
                "triggerOnSource": true,
                "triggerOnReplicate": false,
                "noRecordExecution": true,
                "singleRecordExecution": false,
                "__triggerLimit": true,
                "executeButtonText": "Execute",
                "showToasterMessage": {
                  "visible": false,
                  "messageVisible": true
                },
                "displayConditions": {
                  "alerts": {
                    "sort": [],
                    "limit": 30,
                    "logic": "AND",
                    "filters": []
                  }
                }
              },
              "status": null,
              "top": "120",
              "left": "200",
              "stepType": "/api/3/workflow_step_types/f414d039-bb0d-4e59-9c39-a8f1e880b18a",
              "group": null,
              "uuid": "3f2c1096-9638-5386-8fa7-7d9e5d3b4e61"
            },
            {
              "@type": "WorkflowStep",
              "name": "Pull SharePoint Events",
              "description": null,
              "arguments": {
                "connector": "microsoft-management-activity-v2",
                "operation": "pull_audit_events",
                "config": "",
                "params": {
                  "content_type": "Audit.SharePoint",
                  "since": "{{ vars.input.params.since }}",
                  "limit": 5000
                },
                "version": "2.0.1",
                "name": "Microsoft Management Activity v2",
                "operationTitle": "Pull Audit Events Since",
                "step_variables": [],
                "pickFromTenant": false
              },
              "status": null,
              "top": "250",
              "left": "200",
              "stepType": "/api/3/workflow_step_types/0bfed618-0316-11e7-93ae-92361f002671",
              "group": null,
              "uuid": "318f84f2-b56c-5eaf-a0df-2a0957694dd5"
            },
            {
              "@type": "WorkflowStep",
              "name": "Pull Exchange Events",
              "description": null,
              "arguments": {
                "connector": "microsoft-management-activity-v2",
                "operation": "pull_audit_events",
                "config": "",
                "params": {
                  "content_type": "Audit.Exchange",
                  "since": "{{ vars.input.params.since }}",
                  "limit": 5000
                },
                "version": "2.0.1",
                "name": "Microsoft Management Activity v2",
                "operationTitle": "Pull Audit Events Since",
                "step_variables": [],
                "pickFromTenant": false
              },
              "status": null,
              "top": "380",
              "left": "200",
              "stepType": "/api/3/workflow_step_types/0bfed618-0316-11e7-93ae-92361f002671",
              "group": null,
              "uuid": "6c03fb5d-bade-5e01-9cb4-59f35a5908ae"
            },
            {
              "@type": "WorkflowStep",
              "name": "Find Suspicious Events",
              "description": null,
              "arguments": {
                "suspicious_count": "{{ (vars.steps.Pull_SharePoint_Events.data.records + vars.steps.Pull_Exchange_Events.data.records) | selectattr('Operation', 'in', ['SharingSet', 'AnonymousLinkCreated', 'SecureLinkCreated', 'SharingInvitationCreated', 'New-InboxRule', 'Set-InboxRule', 'UpdateInboxRules']) | list | length }}",
                "suspicious_ops": "{{ (vars.steps.Pull_SharePoint_Events.data.records + vars.steps.Pull_Exchange_Events.data.records) | selectattr('Operation', 'in', ['SharingSet', 'AnonymousLinkCreated', 'SecureLinkCreated', 'SharingInvitationCreated', 'New-InboxRule', 'Set-InboxRule', 'UpdateInboxRules']) | map(attribute='Operation') | unique | join(', ') }}",
                "suspicious_actors": "{{ (vars.steps.Pull_SharePoint_Events.data.records + vars.steps.Pull_Exchange_Events.data.records) | selectattr('Operation', 'in', ['SharingSet', 'AnonymousLinkCreated', 'SecureLinkCreated', 'SharingInvitationCreated', 'New-InboxRule', 'Set-InboxRule', 'UpdateInboxRules']) | map(attribute='UserId') | unique | join(', ') }}"
              },
              "status": null,
              "top": "510",
              "left": "200",
              "stepType": "/api/3/workflow_step_types/04d0cf46-b6a8-42c4-8683-60a7eaa69e8f",
              "group": null,
              "uuid": "c1f11163-a670-57c4-ac47-c8feb7ab792b"
            },
            {
              "@type": "WorkflowStep",
              "name": "Any Suspicious",
              "description": null,
              "arguments": {
                "conditions": [
                  {
                    "option": "suspicious events found",
                    "condition": "{{ vars.suspicious_count | int > 0 }}",
                    "step_iri": "/api/3/workflow_steps/9af84fde-eb9e-5750-a64f-a6df308d4c3a",
                    "step_name": "Log Suspicious Events"
                  },
                  {
                    "option": "Else",
                    "default": true,
                    "step_iri": "/api/3/workflow_steps/632eced1-e8aa-5093-aec3-be9bd14d74c6",
                    "step_name": "End"
                  }
                ]
              },
              "status": null,
              "top": "640",
              "left": "200",
              "stepType": "/api/3/workflow_step_types/12254cf5-5db7-4b1a-8cb1-3af081924b28",
              "group": null,
              "uuid": "277f3a1e-553f-5530-897e-5a8a54e3cba6"
            },
            {
              "@type": "WorkflowStep",
              "name": "Log Suspicious Events",
              "description": null,
              "arguments": {
                "resource": {
                  "name": "Suspicious sharing or mailbox rule activity since {{ vars.input.params.since }}",
                  "description": "{{ vars.suspicious_count }} suspicious audit events since {{ vars.input.params.since }}. Operations: {{ vars.suspicious_ops }}. Actors: {{ vars.suspicious_actors }}. Review the SharePoint and Exchange audit records for these actors before any remediation."
                },
                "collection": "/api/3/alerts"
              },
              "status": null,
              "top": "770",
              "left": "200",
              "stepType": "/api/3/workflow_step_types/2597053c-e718-44b4-8394-4d40fe26d357",
              "group": null,
              "uuid": "9af84fde-eb9e-5750-a64f-a6df308d4c3a"
            },
            {
              "@type": "WorkflowStep",
              "name": "End",
              "description": null,
              "arguments": {
                "connector": "cyops_utilities",
                "operation": "no_op",
                "config": "",
                "params": {},
                "version": "3.7.3",
                "name": "Utilities",
                "operationTitle": "Utils: No Operation",
                "step_variables": [],
                "pickFromTenant": false
              },
              "status": null,
              "top": "900",
              "left": "540",
              "stepType": "/api/3/workflow_step_types/0bfed618-0316-11e7-93ae-92361f002671",
              "group": null,
              "uuid": "632eced1-e8aa-5093-aec3-be9bd14d74c6"
            }
          ],
          "routes": [
            {
              "@type": "WorkflowRoute",
              "name": "Start -> Pull SharePoint Events",
              "targetStep": "/api/3/workflow_steps/318f84f2-b56c-5eaf-a0df-2a0957694dd5",
              "sourceStep": "/api/3/workflow_steps/3f2c1096-9638-5386-8fa7-7d9e5d3b4e61",
              "label": null,
              "isExecuted": false,
              "group": null,
              "uuid": "9d275dca-f53c-5e32-abd5-4e2017e4cee3"
            },
            {
              "@type": "WorkflowRoute",
              "name": "Pull SharePoint Events -> Pull Exchange Events",
              "targetStep": "/api/3/workflow_steps/6c03fb5d-bade-5e01-9cb4-59f35a5908ae",
              "sourceStep": "/api/3/workflow_steps/318f84f2-b56c-5eaf-a0df-2a0957694dd5",
              "label": null,
              "isExecuted": false,
              "group": null,
              "uuid": "b0df60bd-f4ab-537d-b8b6-263fa551d9c1"
            },
            {
              "@type": "WorkflowRoute",
              "name": "Pull Exchange Events -> Find Suspicious Events",
              "targetStep": "/api/3/workflow_steps/c1f11163-a670-57c4-ac47-c8feb7ab792b",
              "sourceStep": "/api/3/workflow_steps/6c03fb5d-bade-5e01-9cb4-59f35a5908ae",
              "label": null,
              "isExecuted": false,
              "group": null,
              "uuid": "67b84210-efeb-588e-b9ff-d8093938365c"
            },
            {
              "@type": "WorkflowRoute",
              "name": "Find Suspicious Events -> Any Suspicious",
              "targetStep": "/api/3/workflow_steps/277f3a1e-553f-5530-897e-5a8a54e3cba6",
              "sourceStep": "/api/3/workflow_steps/c1f11163-a670-57c4-ac47-c8feb7ab792b",
              "label": null,
              "isExecuted": false,
              "group": null,
              "uuid": "d250b763-2b26-57e9-b6b3-88c06876555f"
            },
            {
              "@type": "WorkflowRoute",
              "name": "Any Suspicious -> Log Suspicious Events",
              "targetStep": "/api/3/workflow_steps/9af84fde-eb9e-5750-a64f-a6df308d4c3a",
              "sourceStep": "/api/3/workflow_steps/277f3a1e-553f-5530-897e-5a8a54e3cba6",
              "label": "suspicious events found",
              "isExecuted": false,
              "group": null,
              "uuid": "7fe358a9-ff95-5e53-855e-0f51cb67a664"
            },
            {
              "@type": "WorkflowRoute",
              "name": "Any Suspicious -> End",
              "targetStep": "/api/3/workflow_steps/632eced1-e8aa-5093-aec3-be9bd14d74c6",
              "sourceStep": "/api/3/workflow_steps/277f3a1e-553f-5530-897e-5a8a54e3cba6",
              "label": "Else",
              "isExecuted": false,
              "group": null,
              "uuid": "34451413-b702-53c4-9ddc-bbf37e4109b2"
            },
            {
              "@type": "WorkflowRoute",
              "name": "Log Suspicious Events -> End",
              "targetStep": "/api/3/workflow_steps/632eced1-e8aa-5093-aec3-be9bd14d74c6",
              "sourceStep": "/api/3/workflow_steps/9af84fde-eb9e-5750-a64f-a6df308d4c3a",
              "label": null,
              "isExecuted": false,
              "group": null,
              "uuid": "e426e1a5-a43d-5e27-9bb3-17bc7cad6b38"
            }
          ],
          "groups": [],
          "priority": "/api/3/picklists/9e8d41e4-8ada-4a2c-bd02-07f62c6d0a00",
          "isEditable": true,
          "uuid": "844135d4-0984-5403-beed-b0c2d6427f62",
          "isPrivate": false
        }
      ]
    }
  ]
}
