Back
Id25c86f99-0a91-4b7f-88f3-599a008e5ab8
RulenameAPI - Account Takeover
Description42Crunch API protection against account takeover
SeverityHigh
TacticsCredentialAccess
Discovery
TechniquesT1110
T1087
Required data connectors42CrunchAPIProtection
FortyTwoCrunchAPIProtection
KindScheduled
Query frequency5m
Query period5m
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch%20API%20Protection/Analytic%20Rules/APIAccountTakeover.yaml
Version3.0.1
Arm template25c86f99-0a91-4b7f-88f3-599a008e5ab8.json
Deploy To Azure
let firstRec = FortyTwoCrunchAPIProtection
| where TimeGenerated >= ago(5m) 
| project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid
| where (UriPath has "/api/register" or UriPath has "/api/reset") and Status == 403;
let recCount = iff((toscalar(firstRec | count) >= 20), 1, 0);
firstRec | take recCount
entityMappings:
- fieldMappings:
  - columnName: SourceIp
    identifier: Address
  entityType: IP
- fieldMappings:
  - columnName: Hostname
    identifier: HostName
  entityType: Host
- fieldMappings:
  - columnName: InstanceName
    identifier: FullName
  entityType: Account
requiredDataConnectors:
- dataTypes:
  - FortyTwoCrunchAPIProtection
  connectorId: 42CrunchAPIProtection
- dataTypes:
  - FortyTwoCrunchAPIProtection
  connectorId: FortyTwoCrunchAPIProtection
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch%20API%20Protection/Analytic%20Rules/APIAccountTakeover.yaml
version: 3.0.1
status: Available
relevantTechniques:
- T1110
- T1087
query: |
  let firstRec = FortyTwoCrunchAPIProtection
  | where TimeGenerated >= ago(5m) 
  | project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid
  | where (UriPath has "/api/register" or UriPath has "/api/reset") and Status == 403;
  let recCount = iff((toscalar(firstRec | count) >= 20), 1, 0);
  firstRec | take recCount
tactics:
- CredentialAccess
- Discovery
queryFrequency: 5m
id: 25c86f99-0a91-4b7f-88f3-599a008e5ab8
triggerThreshold: 0
triggerOperator: gt
name: API - Account Takeover
queryPeriod: 5m
severity: High
customDetails: 
kind: Scheduled
eventGroupingSettings:
  aggregationKind: SingleAlert
description: |
  '42Crunch API protection against account takeover'
{
  "$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/25c86f99-0a91-4b7f-88f3-599a008e5ab8')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/25c86f99-0a91-4b7f-88f3-599a008e5ab8')]",
      "properties": {
        "alertRuleTemplateName": "25c86f99-0a91-4b7f-88f3-599a008e5ab8",
        "customDetails": null,
        "description": "'42Crunch API protection against account takeover'\n",
        "displayName": "API - Account Takeover",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "SourceIp",
                "identifier": "Address"
              }
            ]
          },
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "Hostname",
                "identifier": "HostName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "InstanceName",
                "identifier": "FullName"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "SingleAlert"
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch%20API%20Protection/Analytic%20Rules/APIAccountTakeover.yaml",
        "query": "let firstRec = FortyTwoCrunchAPIProtection\n| where TimeGenerated >= ago(5m) \n| project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid\n| where (UriPath has \"/api/register\" or UriPath has \"/api/reset\") and Status == 403;\nlet recCount = iff((toscalar(firstRec | count) >= 20), 1, 0);\nfirstRec | take recCount\n",
        "queryFrequency": "PT5M",
        "queryPeriod": "PT5M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CredentialAccess",
          "Discovery"
        ],
        "techniques": [
          "T1087",
          "T1110"
        ],
        "templateVersion": "3.0.1",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}