{
  "$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/8a1c4f2d-2b3a-4e5f-9c1d-1a2b3c4d5e6f')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/8a1c4f2d-2b3a-4e5f-9c1d-1a2b3c4d5e6f')]",
      "properties": {
        "alertRuleTemplateName": "8a1c4f2d-2b3a-4e5f-9c1d-1a2b3c4d5e6f",
        "customDetails": null,
        "description": "A key in Azure Key Vault has been classified as quantum-vulnerable (RSA or elliptic-curve).\nThese key types are broken by Shor's algorithm on a sufficiently large fault-tolerant quantum computer.\nRotate to a PQ-hybrid key (ML-KEM, ML-DSA) or plan migration before the harvest-now-decrypt-later\nwindow closes for long-lived data.\n",
        "displayName": "Quantum-vulnerable key detected in Key Vault",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "AzureResource",
            "fieldMappings": [
              {
                "columnName": "ResourceId",
                "identifier": "ResourceId"
              }
            ]
          },
          {
            "entityType": "Url",
            "fieldMappings": [
              {
                "columnName": "AssetIdentifier",
                "identifier": "Url"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/QCryptonPQCScanner/Analytic%20Rules/QuantumVulnerableKVKey.yaml",
        "query": "PQReadiness_CL\n| where TimeGenerated > ago(1h)\n| where AssetKind == \"kv-key\"\n| where QuantumPosture == \"vulnerable\"\n| extend AlgorithmDetail = strcat(Algorithm, iif(isnotnull(KeySize), strcat(\"-\", tostring(KeySize)), \"\"))\n| project TimeGenerated, ResourceId, ResourceName, AssetIdentifier, AlgorithmDetail, PostureReason, RiskScore, SubscriptionId, ResourceGroup\n| order by RiskScore desc\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Impact"
        ],
        "techniques": [
          "T1565"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
