{
  "$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/2a4b6c8d-1e3f-5a7b-9c0d-4e6f8a2b1c3d')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/2a4b6c8d-1e3f-5a7b-9c0d-4e6f8a2b1c3d')]",
      "properties": {
        "alertRuleTemplateName": "2a4b6c8d-1e3f-5a7b-9c0d-4e6f8a2b1c3d",
        "customDetails": null,
        "description": "An Entra ID (Azure AD) app registration or service principal has a certificate\ncredential using a classical algorithm (RSA or elliptic-curve) that is vulnerable\nto Shor's algorithm. These certificates authenticate workloads and service-to-service\nflows -- a compromised cert allows impersonation of the application identity.\nRotate to a PQ-hybrid certificate or shorten the validity window.\n",
        "displayName": "Quantum-vulnerable certificate on Entra app registration",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "ResourceName",
                "identifier": "Name"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/QCryptonPQCScanner/Analytic%20Rules/QuantumVulnerableEntraCert.yaml",
        "query": "PQReadiness_CL\n| where TimeGenerated > ago(1d)\n| where AssetKind in (\"entra-app-cert\", \"entra-sp-credential\")\n| where QuantumPosture == \"vulnerable\"\n| extend AppId = extract(@'\"appId\":\"([^\"]+)\"', 1, Metadata)\n| project TimeGenerated, ResourceName, AssetIdentifier, Algorithm, KeySize, PostureReason, RiskScore, ExpiresOn, AppId\n| order by RiskScore desc\n",
        "queryFrequency": "P1D",
        "queryPeriod": "P1D",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CredentialAccess"
        ],
        "techniques": [
          "T1552"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
