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

API - Suspicious Login

Back
Id7bdc10d6-aa24-4ca9-9a93-802cd8761354
RulenameAPI - Suspicious Login
Description42Crunch API protection against suspicious login
SeverityHigh
TacticsCredentialAccess
InitialAccess
TechniquesT1110
T1190
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/APISuspiciousLogin.yaml
Version3.0.1
Arm template7bdc10d6-aa24-4ca9-9a93-802cd8761354.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?user=" and Status in (200, 403);
let ipAddressCount = toscalar(firstRec | summarize by SourceIp | count);
let secondRec = firstRec | summarize arg_max(TimeGenerated, *) by SourceIp;
let recCount = iff((toscalar(secondRec | count) > 3), ipAddressCount, 0);
secondRec | take recCount
triggerOperator: gt
kind: Scheduled
description: |
    '42Crunch API protection against suspicious login'
customDetails: 
version: 3.0.1
id: 7bdc10d6-aa24-4ca9-9a93-802cd8761354
name: API - Suspicious Login
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APISuspiciousLogin.yaml
eventGroupingSettings:
  aggregationKind: SingleAlert
queryFrequency: 5m
status: Available
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?user=" and Status in (200, 403);
  let ipAddressCount = toscalar(firstRec | summarize by SourceIp | count);
  let secondRec = firstRec | summarize arg_max(TimeGenerated, *) by SourceIp;
  let recCount = iff((toscalar(secondRec | count) > 3), ipAddressCount, 0);
  secondRec | take recCount  
triggerThreshold: 0
queryPeriod: 5m
requiredDataConnectors:
- connectorId: 42CrunchAPIProtection
  dataTypes:
  - FortyTwoCrunchAPIProtection
- connectorId: FortyTwoCrunchAPIProtection
  dataTypes:
  - FortyTwoCrunchAPIProtection
relevantTechniques:
- T1110
- T1190
entityMappings:
- fieldMappings:
  - identifier: Address
    columnName: SourceIp
  entityType: IP
- fieldMappings:
  - identifier: HostName
    columnName: Hostname
  entityType: Host
- fieldMappings:
  - identifier: FullName
    columnName: InstanceName
  entityType: Account
severity: High
tactics:
- CredentialAccess
- InitialAccess