{
  "$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/21818920-85eb-4955-a7cc-f62c731f32ac')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/21818920-85eb-4955-a7cc-f62c731f32ac')]",
      "properties": {
        "alertRuleTemplateName": "21818920-85eb-4955-a7cc-f62c731f32ac",
        "customDetails": null,
        "description": "A device enrollment is on hold, typically due to a license/device-capacity limit being reached.\n",
        "displayName": "CTE - Device Enrolled but On Hold",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "HostName",
                "identifier": "HostName"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Cybereinforce/Analytic%20Rules/DeviceEnrolledButOnHold.yaml",
        "query": "CybereinforceCTE_CL\n| where EventType == \"device.onhold\"\n| extend d = parse_json(Details)\n| extend\n    HostName = iff(isnotempty(tostring(d.hostname)), tostring(d.hostname), strcat(\"cte-device-\", substring(EntityId, 0, 8))),\n    DeviceId = tostring(d.deviceId),\n    DeviceUser = tostring(d.deviceUser),\n    DeviceOs = tostring(d.deviceOs),\n    AppName = \"Cybereinforce\"\n| project TimeGenerated, TenantId, DeviceId, HostName, DeviceUser, DeviceOs, AppName, Actor, Severity, Category, Source\n",
        "queryFrequency": "PT30M",
        "queryPeriod": "PT30M",
        "severity": "Low",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [],
        "techniques": [],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
