Detection rules › Kusto

API - Kiterunner detection

Status
available
Severity
medium
Time window
5m
Source
github.com/Azure/Azure-Sentinel

'42Crunch API protection against Kiterunner enumeration'

MITRE ATT&CK coverage

Rule body kusto

id: 421b38ec-4295-4aed-8299-c92e268ad663
name: API - Kiterunner detection
description: |
  '42Crunch API protection against Kiterunner enumeration'
severity: Medium
requiredDataConnectors:
  - connectorId: 42CrunchAPIProtection
    dataTypes:
      - FortyTwoCrunchAPIProtection
  - connectorId: FortyTwoCrunchAPIProtection
    dataTypes:
      - FortyTwoCrunchAPIProtection
queryFrequency: 5m
queryPeriod: 5m
triggerOperator: gt
triggerThreshold: 0
eventGroupingSettings:
  aggregationKind: SingleAlert
status: Available  
tactics:
  - Reconnaissance
  - Discovery
relevantTechniques:
  - T1595
  - T1580
  - T1083
query: |
  let discoveryRecords = FortyTwoCrunchAPIProtection
  | where TimeGenerated >= ago(5m) 
  | project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid 
  | where Status == 404 and ErrorMessage startswith "path not defined in OAS";
  let discoveryCnt = (toscalar(discoveryRecords | count));
  let recCount = iff((discoveryCnt > 500), 1, 0);
  discoveryRecords | top recCount by Timestamp desc
customDetails:
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: SourceIp
  - entityType: Host
    fieldMappings:
      - identifier: HostName
        columnName: Hostname
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: InstanceName
version: 3.0.1
kind: Scheduled

Stages and Predicates

Parameters

let recCount = iff((discoveryCnt > 500), 1, 0);

Let binding: discoveryCnt

let discoveryCnt = (toscalar(discoveryRecords | count));

Derived from discoveryRecords.

The stages below define let discoveryRecords (the rule's main pipeline source).

Stage 1: source

FortyTwoCrunchAPIProtection

Stage 2: where

| where TimeGenerated >= ago(5m)

Stage 3: project-away

| project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid

Stage 4: where

| where Status == 404 and ErrorMessage startswith "path not defined in OAS"

The stages below run on discoveryRecords (the outer pipeline).

Stage 5: top

discoveryRecords
| top recCount by Timestamp desc

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ErrorMessagestarts_with
  • path not defined in OAS
Statuseq
  • 404 transforms: cased