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
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
Version1.0.1
Arm template7bdc10d6-aa24-4ca9-9a93-802cd8761354.json
Deploy To Azure
let firstRec = apifirewall_log_1_CL
| where TimeGenerated >= ago(5m) 
| project-away Non_blocking_mode_b, Source_Port_d, Destination_Port_d, Query_s, API_ID_g, Request_Header_s, Response_Header_s, Errors_s, Type, UUID_g
| where Instance_Name_s == "Instance_6" and URI_Path_s has "/api/login?user=" and Status_d in (200, 403);
let ipAddressCount = toscalar(firstRec | summarize by Source_IP_s | count);
let secondRec = firstRec | summarize arg_max(Source_IP_s, *) by Source_IP_s;
let recCount = iff((toscalar(secondRec | count) > 3), ipAddressCount, 0);
secondRec | take recCount
query: |
  let firstRec = apifirewall_log_1_CL
  | where TimeGenerated >= ago(5m) 
  | project-away Non_blocking_mode_b, Source_Port_d, Destination_Port_d, Query_s, API_ID_g, Request_Header_s, Response_Header_s, Errors_s, Type, UUID_g
  | where Instance_Name_s == "Instance_6" and URI_Path_s has "/api/login?user=" and Status_d in (200, 403);
  let ipAddressCount = toscalar(firstRec | summarize by Source_IP_s | count);
  let secondRec = firstRec | summarize arg_max(Source_IP_s, *) by Source_IP_s;
  let recCount = iff((toscalar(secondRec | count) > 3), ipAddressCount, 0);
  secondRec | take recCount  
entityMappings:
- fieldMappings:
  - identifier: Address
    columnName: Source_IP_s
  entityType: IP
- fieldMappings:
  - identifier: HostName
    columnName: Hostname_s
  entityType: Host
- fieldMappings:
  - identifier: FullName
    columnName: Instance_Name_s
  entityType: Account
triggerOperator: gt
eventGroupingSettings:
  aggregationKind: SingleAlert
description: |
    '42Crunch API protection against suspicious login'
tactics:
- CredentialAccess
- InitialAccess
severity: High
queryFrequency: 5m
kind: Scheduled
name: API - Suspicious Login
triggerThreshold: 0
status: Available
customDetails: 
id: 7bdc10d6-aa24-4ca9-9a93-802cd8761354
requiredDataConnectors:
- connectorId: 42CrunchAPIProtection
  dataTypes:
  - apifirewall_log_1_CL
relevantTechniques:
- T1110
- T1190
version: 1.0.1
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APISuspiciousLogin.yaml
queryPeriod: 5m