{
  "$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/1e6a8802-9129-44d4-a4f9-c6010b5725e8')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/1e6a8802-9129-44d4-a4f9-c6010b5725e8')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDisplayNameFormat": "FortiNDR {{AlertSeverity}} Alert on {{IncidentDevice}} ({{EventCount}} events)",
          "alertSeverityColumnName": "AlertSeverity"
        },
        "alertRuleTemplateName": "1e6a8802-9129-44d4-a4f9-c6010b5725e8",
        "customDetails": {
          "EventCount": "EventCount",
          "EventDescriptions": "Descriptions",
          "EventTypes": "EventTypes"
        },
        "description": "'Triggers an alert for High, Medium, or Low severity FortiNDR events grouped by target device and alert severity.'\n",
        "displayName": "FortiNDR Cloud - Security Event Detected",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "IncidentDevice",
                "identifier": "Address"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Fortinet%20FortiNDR%20Cloud/Analytic%20Rules/FortiNDR_Events_Detected.yaml",
        "query": "Fortinet_FortiNDR_Cloud\n| extend AlertSeverity = case(Type == 'FncEventsDetections_CL' and de_severity in~ ('high', 'critical'), 'High', Type == 'FncEventsSuricata_CL' and su_sig_severity <= 2, 'High', Type == 'FncEventsObservation_CL' and ob_confidence in~ ('high', 'critical'), 'High', Type == 'FncEventsDetections_CL' and de_severity in~ ('medium', 'moderate'), 'Medium', Type == 'FncEventsSuricata_CL' and su_sig_severity == 3, 'Medium', Type == 'FncEventsObservation_CL' and ob_confidence in~ ('medium', 'moderate'), 'Medium', 'Low')\n| extend IncidentDevice = coalesce(de_device_ip, su_src_ip, ob_src_ip)\n| extend Description = coalesce(de_rule_name, su_sig_name, ob_observation_title)\n| summarize EventCount = count(), Descriptions = strcat_array(make_set(Description), '; '), EventTypes = strcat_array(make_set(Type), ', '), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by IncidentDevice, AlertSeverity\n",
        "queryFrequency": "PT5M",
        "queryPeriod": "PT5M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CommandAndControl",
          "Discovery",
          "Execution",
          "Exfiltration",
          "Impact",
          "InitialAccess",
          "LateralMovement"
        ],
        "techniques": [
          "T1021",
          "T1041",
          "T1046",
          "T1059",
          "T1071",
          "T1190",
          "T1486",
          "T1568"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
