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
Idc6258d51-7b82-4942-8293-94c1dcf91595
RulenameAPI - Rate limiting
Description42Crunch API protection against first-time access
SeverityLow
TacticsDiscovery
InitialAccess
TechniquesT1087
T1190
Required data connectors42CrunchAPIProtection
FortyTwoCrunchAPIProtection
KindScheduled
Query frequency1d
Query period7d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APIFirstTimeAccess.yaml
Version3.0.1
Arm templatec6258d51-7b82-4942-8293-94c1dcf91595.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" |
top 1 by Timestamp desc;
let ipAddress = toscalar(firstRec | summarize by SourceIp);
let secondRec = FortyTwoCrunchAPIProtection
| where TimeGenerated >= ago(7d) 
| project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid
| where UriPath has "/api/login" and SourceIp == ipAddress;
let recCount = iff((toscalar(secondRec | count) > 1), 0, 1);
secondRec | take recCount
status: Available
queryFrequency: 1d
queryPeriod: 7d
triggerOperator: gt
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" |
  top 1 by Timestamp desc;
  let ipAddress = toscalar(firstRec | summarize by SourceIp);
  let secondRec = FortyTwoCrunchAPIProtection
  | where TimeGenerated >= ago(7d) 
  | project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid
  | where UriPath has "/api/login" and SourceIp == ipAddress;
  let recCount = iff((toscalar(secondRec | count) > 1), 0, 1);
  secondRec | take recCount  
eventGroupingSettings:
  aggregationKind: SingleAlert
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APIFirstTimeAccess.yaml
tactics:
- Discovery
- InitialAccess
triggerThreshold: 0
entityMappings:
- entityType: IP
  fieldMappings:
  - identifier: Address
    columnName: SourceIp
- entityType: Host
  fieldMappings:
  - identifier: HostName
    columnName: Hostname
- entityType: Account
  fieldMappings:
  - identifier: FullName
    columnName: InstanceName
requiredDataConnectors:
- connectorId: 42CrunchAPIProtection
  dataTypes:
  - FortyTwoCrunchAPIProtection
- connectorId: FortyTwoCrunchAPIProtection
  dataTypes:
  - FortyTwoCrunchAPIProtection
kind: Scheduled
relevantTechniques:
- T1087
- T1190
customDetails: 
description: |
    '42Crunch API protection against first-time access'
name: API - Rate limiting
version: 3.0.1
id: c6258d51-7b82-4942-8293-94c1dcf91595
severity: Low