{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/017031f6-be1d-4c68-b4d3-182fa84378cc')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/017031f6-be1d-4c68-b4d3-182fa84378cc')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDescriptionFormat": "Vaikora-O365 classified this message as {{ActionName}} with confidence {{Confidence}}. The message was quarantined from the recipient mailbox.",
          "alertDisplayNameFormat": "Vaikora-O365 {{ActionName}} on {{RecipientAddress}}"
        },
        "alertRuleTemplateName": "017031f6-be1d-4c68-b4d3-182fa84378cc",
        "customDetails": null,
        "description": "Identifies high-confidence phishing or suspected-threat quarantine events from Vaikora for O365. Fires when the classifier returns action_id 4 (Suspected) or 5 (Phishing) with confidence above 0.8 on a Microsoft 365 mailbox.\n",
        "displayName": "Vaikora - High score quarantine",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "MailMessage",
            "fieldMappings": [
              {
                "columnName": "RecipientAddress",
                "identifier": "Recipient"
              },
              {
                "columnName": "EmailId",
                "identifier": "NetworkMessageId"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "SenderAddress",
                "identifier": "FullName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "RecipientAddress",
                "identifier": "FullName"
              }
            ]
          },
          {
            "entityType": "DNS",
            "fieldMappings": [
              {
                "columnName": "SenderDomain",
                "identifier": "DomainName"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Vaikora-O365/Analytic%20Rules/Vaikora%20-%20High%20score%20quarantine.yaml",
        "query": "VaikoraO365_Quarantine_CL\n| where TimeGenerated >= ago(15m)\n| where ActionId_d in (4, 5)\n| where Confidence_d >= 0.8\n| extend\n    EmailId          = EmailId_s,\n    TenantId         = TenantId_s,\n    ActionId         = ActionId_d,\n    ActionName       = ActionName_s,\n    Confidence       = Confidence_d,\n    RiskScore        = RiskScore_d,\n    SubCategory      = SubCategory_s,\n    Reasoning        = Reasoning_s,\n    SourceMailbox    = SourceMailbox_s,\n    SenderAddress    = SenderAddress_s,\n    SenderDomain     = SenderDomain_s,\n    Subject          = Subject_s,\n    RecipientAddress = RecipientAddress_s,\n    ModelVersion     = ModelVersion_s\n| project\n    TimeGenerated, EmailId, TenantId, ActionId, ActionName, Confidence, RiskScore,\n    SubCategory, Reasoning, SourceMailbox, SenderAddress, SenderDomain, Subject,\n    RecipientAddress, ModelVersion\n| order by TimeGenerated desc\n",
        "queryFrequency": "PT15M",
        "queryPeriod": "PT15M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [
          "T1566.001",
          "T1566.002"
        ],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Collection",
          "CredentialAccess",
          "Exfiltration",
          "InitialAccess"
        ],
        "techniques": [
          "T1566"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
