{
  "$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/4ae9f294-410d-4c11-9072-0d8fcf5162d8')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/4ae9f294-410d-4c11-9072-0d8fcf5162d8')]",
      "properties": {
        "alertRuleTemplateName": "4ae9f294-410d-4c11-9072-0d8fcf5162d8",
        "customDetails": null,
        "description": "Detects applications with open SAST authentication findings that are\nsimultaneously experiencing brute force login attempts in Azure AD.\nCorrelates StratoSecure SAST findings with SigninLogs failure spikes.\n",
        "displayName": "SAST Auth Finding Correlated with Brute Force",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "CloudApplication",
            "fieldMappings": [
              {
                "columnName": "ApplicationId",
                "identifier": "AppId"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/StratoSecure/Analytic%20Rules/S1_SAST_Auth_BruteForce.yaml",
        "query": "let lookback = 1h;\nlet bruteForceThreshold = 20;\nlet AuthFindings = StratoSecure_Findings_CL\n    | where TimeGenerated >= ago(lookback)\n    | where FixStatus =~ \"open\"\n    | where Severity in (\"Critical\", \"High\")\n    | where RuleId has_any (\"auth\", \"jwt\", \"login\", \"session\", \"token\", \"password\", \"credential\")\n    | summarize FindingCount = count(), RuleIds = make_set(RuleId), Repos = make_set(Repository)\n        by ApplicationId, StraTenantId;\nlet BruteForce = SigninLogs\n    | where TimeGenerated >= ago(lookback)\n    | where ResultType != \"0\"\n    | summarize FailedAttempts = count(), DistinctUsers = dcount(UserPrincipalName),\n        IPList = make_set(IPAddress, 20), FirstAttempt = min(TimeGenerated), LastAttempt = max(TimeGenerated)\n        by AppId, AppDisplayName\n    | where FailedAttempts >= bruteForceThreshold;\nAuthFindings\n    | join kind=inner BruteForce on $left.ApplicationId == $right.AppId\n    | project TimeGenerated = LastAttempt, ApplicationId, AppDisplayName, StraTenantId,\n        FindingCount, RuleIds, Repos, FailedAttempts, DistinctUsers, IPList\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT75M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CredentialAccess",
          "InitialAccess"
        ],
        "techniques": [
          "T1078",
          "T1110"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}
