{
  "$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/0be1ebaf-36f8-49a6-a3b6-56491ccfda7f')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/0be1ebaf-36f8-49a6-a3b6-56491ccfda7f')]",
      "properties": {
        "alertRuleTemplateName": "0be1ebaf-36f8-49a6-a3b6-56491ccfda7f",
        "customDetails": null,
        "description": "An enrollment token was generated for onboarding a new device.\n",
        "displayName": "CTE - Enrollment Token Generated",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountName",
                "identifier": "Name"
              },
              {
                "columnName": "UPNSuffix",
                "identifier": "UPNSuffix"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Cybereinforce/Analytic%20Rules/EnrollmentTokenGenerated.yaml",
        "query": "CybereinforceCTE_CL\n| where EventType == \"token.generated\"\n| extend AccountName = tostring(split(Actor, \"@\")[0]), UPNSuffix = tostring(split(Actor, \"@\")[1])\n| project TimeGenerated, TenantId, Actor, AccountName, UPNSuffix, Severity, Category, Source\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Informational",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Persistence"
        ],
        "techniques": [
          "T1098"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
