{
  "$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/bd06aa7c-8aef-40f3-bf32-a70b5d48f79e')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/bd06aa7c-8aef-40f3-bf32-a70b5d48f79e')]",
      "properties": {
        "alertRuleTemplateName": "bd06aa7c-8aef-40f3-bf32-a70b5d48f79e",
        "customDetails": null,
        "description": "Tenant-wide blocking-rule/IOC capacity has reached 95% - new rules or IOCs may soon fail to be added. Emitted by the daily tenant health-check job (api/src/functions/tenantHealthChecks.js) when usage newly crosses this threshold, and re-emitted at most once per ~30 days while it remains above threshold.\n",
        "displayName": "CTE - Rule Capacity Critical (95%)",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "CloudApplication",
            "fieldMappings": [
              {
                "columnName": "AppName",
                "identifier": "Name"
              },
              {
                "columnName": "TenantId",
                "identifier": "InstanceName"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Cybereinforce/Analytic%20Rules/RuleCapacityCritical95.yaml",
        "query": "CybereinforceCTE_CL\n| where EventType == \"rule.capacity_critical\"\n| extend d = parse_json(Details)\n| extend AppName = \"Cybereinforce\", RuleCount = toint(d.ruleCount), RuleLimit = toint(d.ruleLimit), UsedPct = todouble(d.usedPct)\n| project TimeGenerated, TenantId, AppName, RuleCount, RuleLimit, UsedPct, Severity, Category, Source\n",
        "queryFrequency": "PT24H",
        "queryPeriod": "P2D",
        "severity": "High",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [],
        "techniques": [],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
