{
  "$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/479bc6ef-ecb3-496f-9a2a-38c9635d77d3')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/479bc6ef-ecb3-496f-9a2a-38c9635d77d3')]",
      "properties": {
        "alertRuleTemplateName": "479bc6ef-ecb3-496f-9a2a-38c9635d77d3",
        "customDetails": null,
        "description": "Detects internet-facing API endpoints with no authentication that handle\nsensitive data classifications (PII, Financial, PHI, Confidential).\nUses StratoSecure_ApiInventory_CL from Phase 6 API inventory discovery.\n",
        "displayName": "Unauthenticated API Endpoint with Sensitive Data",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "CloudApplication",
            "fieldMappings": [
              {
                "columnName": "ApplicationId",
                "identifier": "AppId"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/StratoSecure/Analytic%20Rules/S9_UnauthenticatedAPI_Internet.yaml",
        "query": "let sensitiveDataClasses = dynamic([\"PII\", \"Financial\", \"PHI\", \"Confidential\"]);\nStratoSecure_ApiInventory_CL\n    | where TimeGenerated >= ago(6h)\n    | where InternetExposure == true\n    | where AuthType =~ \"none\" or isempty(AuthType)\n    | where DataClassification has_any (sensitiveDataClasses)\n    | summarize EndpointCount = count(), Endpoints = make_set(Path, 50),\n        Methods = make_set(Method), DataClasses = make_set(DataClassification),\n        EndTime = max(TimeGenerated)\n        by ApplicationId = ServiceName, StraTenantId\n    | project TimeGenerated = EndTime, ApplicationId, StraTenantId,\n        EndpointCount, Endpoints, Methods, DataClasses\n",
        "queryFrequency": "PT6H",
        "queryPeriod": "PT375M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess"
        ],
        "techniques": [
          "T1190"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
