Analytic rule catalog
API - Suspicious Login
Back
| Id | 7bdc10d6-aa24-4ca9-9a93-802cd8761354 |
| Rulename | API - Suspicious Login |
| Description | 42Crunch API protection against suspicious login |
| Severity | High |
| Tactics | CredentialAccess InitialAccess |
| Techniques | T1110 T1190 |
| Required data connectors | 42CrunchAPIProtection FortyTwoCrunchAPIProtection |
| Kind | Scheduled |
| Query frequency | 5m |
| Query period | 5m |
| Trigger threshold | 0 |
| Trigger operator | gt |
| Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch%20API%20Protection/Analytic%20Rules/APISuspiciousLogin.yaml |
| Version | 3.0.1 |
| Arm template | 7bdc10d6-aa24-4ca9-9a93-802cd8761354.json |
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
entityMappings:
- entityType: IP
fieldMappings:
- columnName: SourceIp
identifier: Address
- entityType: Host
fieldMappings:
- columnName: Hostname
identifier: HostName
- entityType: Account
fieldMappings:
- columnName: InstanceName
identifier: FullName
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
eventGroupingSettings:
aggregationKind: SingleAlert
id: 7bdc10d6-aa24-4ca9-9a93-802cd8761354
queryFrequency: 5m
status: Available
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch%20API%20Protection/Analytic%20Rules/APISuspiciousLogin.yaml
version: 3.0.1
severity: High
relevantTechniques:
- T1110
- T1190
name: API - Suspicious Login
kind: Scheduled
tactics:
- CredentialAccess
- InitialAccess
requiredDataConnectors:
- dataTypes:
- FortyTwoCrunchAPIProtection
connectorId: 42CrunchAPIProtection
- dataTypes:
- FortyTwoCrunchAPIProtection
connectorId: FortyTwoCrunchAPIProtection
description: |
'42Crunch API protection against suspicious login'
customDetails:
triggerOperator: gt
triggerThreshold: 0
queryPeriod: 5m
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"apiVersion": "2024-01-01-preview",
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/7bdc10d6-aa24-4ca9-9a93-802cd8761354')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/7bdc10d6-aa24-4ca9-9a93-802cd8761354')]",
"properties": {
"alertRuleTemplateName": "7bdc10d6-aa24-4ca9-9a93-802cd8761354",
"customDetails": null,
"description": "'42Crunch API protection against suspicious login'\n",
"displayName": "API - Suspicious Login",
"enabled": true,
"entityMappings": [
{
"entityType": "IP",
"fieldMappings": [
{
"columnName": "SourceIp",
"identifier": "Address"
}
]
},
{
"entityType": "Host",
"fieldMappings": [
{
"columnName": "Hostname",
"identifier": "HostName"
}
]
},
{
"entityType": "Account",
"fieldMappings": [
{
"columnName": "InstanceName",
"identifier": "FullName"
}
]
}
],
"eventGroupingSettings": {
"aggregationKind": "SingleAlert"
},
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch%20API%20Protection/Analytic%20Rules/APISuspiciousLogin.yaml",
"query": "let firstRec = FortyTwoCrunchAPIProtection\n| where TimeGenerated >= ago(5m) \n| project-away NonBlockingMode, SourcePort, DestinationPort, Query, ApiId, RequestHeader, ResponseHeader, Errors, EventType, Uuid\n| where UriPath has \"/api/login?user=\" and Status in (200, 403);\nlet ipAddressCount = toscalar(firstRec | summarize by SourceIp | count);\nlet secondRec = firstRec | summarize arg_max(TimeGenerated, *) by SourceIp;\nlet recCount = iff((toscalar(secondRec | count) > 3), ipAddressCount, 0);\nsecondRec | take recCount\n",
"queryFrequency": "PT5M",
"queryPeriod": "PT5M",
"severity": "High",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"CredentialAccess",
"InitialAccess"
],
"techniques": [
"T1110",
"T1190"
],
"templateVersion": "3.0.1",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}