Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

API - Rate limiting

Back
Idb808063b-07d5-432c-95d0-8900da61cce9
RulenameAPI - Rate limiting
Description42Crunch API protection against rate limiting
SeverityMedium
TacticsImpact
TechniquesT1499
Required data connectors42CrunchAPIProtection
FortyTwoCrunchAPIProtection
KindScheduled
Query frequency5m
Query period5m
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APIRateLimiting.yaml
Version3.0.1
Arm templateb808063b-07d5-432c-95d0-8900da61cce9.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/login" and Status == 429;
let rateLimitCount = (toscalar(firstRec | count));
let recCount = iff((rateLimitCount > 20), 1, 0);
firstRec | top recCount by Timestamp desc;
entityMappings:
- entityType: IP
  fieldMappings:
  - identifier: Address
    columnName: SourceIp
- entityType: Host
  fieldMappings:
  - identifier: HostName
    columnName: Hostname
- entityType: Account
  fieldMappings:
  - identifier: FullName
    columnName: InstanceName
tactics:
- Impact
requiredDataConnectors:
- dataTypes:
  - FortyTwoCrunchAPIProtection
  connectorId: 42CrunchAPIProtection
- dataTypes:
  - FortyTwoCrunchAPIProtection
  connectorId: FortyTwoCrunchAPIProtection
id: b808063b-07d5-432c-95d0-8900da61cce9
severity: Medium
status: Available
customDetails: 
query: |
  let firstRec = FortyTwoCrunchAPIProtection
  | where TimeGenerated >= ago(5m) 
  | project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid
  | where UriPath has "/api/login" and Status == 429;
  let rateLimitCount = (toscalar(firstRec | count));
  let recCount = iff((rateLimitCount > 20), 1, 0);
  firstRec | top recCount by Timestamp desc;  
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APIRateLimiting.yaml
kind: Scheduled
queryPeriod: 5m
version: 3.0.1
name: API - Rate limiting
queryFrequency: 5m
eventGroupingSettings:
  aggregationKind: SingleAlert
relevantTechniques:
- T1499
description: |
    '42Crunch API protection against rate limiting'
triggerThreshold: 0
triggerOperator: gt