{
  "$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/0199390c-e96d-4119-b25c-83257f3c4738')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/0199390c-e96d-4119-b25c-83257f3c4738')]",
      "properties": {
        "alertRuleTemplateName": "0199390c-e96d-4119-b25c-83257f3c4738",
        "customDetails": null,
        "description": "Identifies more than five failed Pulumi Cloud login attempts (user-login-failed events) from a single IP address within a one-hour window. This may indicate a brute force attack or an attempt to use compromised credentials.\n",
        "displayName": "Pulumi Cloud - Excessive authentication failures",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "SourceIP_s",
                "identifier": "Address"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/PulumiCloudAuditLogs/Analytic%20Rules/AuthenticationFailures.yaml",
        "query": "PulumiAuditLogs_CL\n| where Event_s == \"user-login-failed\"\n| summarize FailCount = count(), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated) by SourceIP_s\n| where FailCount > 5\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CredentialAccess"
        ],
        "techniques": [
          "T1110"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
