API - API Scraping
Id | d944d564-b6fa-470d-b5ab-41b341878c5e |
Rulename | API - API Scraping |
Description | 42Crunch API protection against API scraping |
Severity | High |
Tactics | Reconnaissance Collection |
Required data connectors | 42CrunchAPIProtection |
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 API Protection/Analytic Rules/APIAPIScaping.yaml |
Version | 1.0.0 |
Arm template | d944d564-b6fa-470d-b5ab-41b341878c5e.json |
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_7" and URI_Path_s has "/api/properties?page=" and Status_d == 200;
let rateLimitCount = (toscalar(firstRec | count));
let recCount = iff((rateLimitCount > 100), 1, 0);
firstRec | top recCount by Timestamp_t desc;
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_7" and URI_Path_s has "/api/properties?page=" and Status_d == 200;
let rateLimitCount = (toscalar(firstRec | count));
let recCount = iff((rateLimitCount > 100), 1, 0);
firstRec | top recCount by Timestamp_t desc;
eventGroupingSettings:
aggregationKind: SingleAlert
triggerThreshold: 0
customDetails:
queryFrequency: 5m
requiredDataConnectors:
- connectorId: 42CrunchAPIProtection
dataTypes:
- apifirewall_log_1_CL
id: d944d564-b6fa-470d-b5ab-41b341878c5e
version: 1.0.0
name: API - API Scraping
kind: Scheduled
status: Available
relevantTechniques:
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APIAPIScaping.yaml
queryPeriod: 5m
severity: High
triggerOperator: gt
tactics:
- Reconnaissance
- Collection
description: |
'42Crunch API protection against API scraping'
entityMappings:
- entityType: IP
fieldMappings:
- identifier: Address
columnName: Source_IP_s
- entityType: Host
fieldMappings:
- identifier: HostName
columnName: Hostname_s
- entityType: Account
fieldMappings:
- identifier: FullName
columnName: Instance_Name_s
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/d944d564-b6fa-470d-b5ab-41b341878c5e')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/d944d564-b6fa-470d-b5ab-41b341878c5e')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "API - API Scraping",
"description": "'42Crunch API protection against API scraping'\n",
"severity": "High",
"enabled": true,
"query": "let firstRec = apifirewall_log_1_CL\n| where TimeGenerated >= ago(5m) \n| 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\n| where Instance_Name_s == \"Instance_7\" and URI_Path_s has \"/api/properties?page=\" and Status_d == 200;\nlet rateLimitCount = (toscalar(firstRec | count));\nlet recCount = iff((rateLimitCount > 100), 1, 0);\nfirstRec | top recCount by Timestamp_t desc;\n",
"queryFrequency": "PT5M",
"queryPeriod": "PT5M",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Reconnaissance",
"Collection"
],
"techniques": null,
"alertRuleTemplateName": "d944d564-b6fa-470d-b5ab-41b341878c5e",
"eventGroupingSettings": {
"aggregationKind": "SingleAlert"
},
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"columnName": "Source_IP_s",
"identifier": "Address"
}
],
"entityType": "IP"
},
{
"fieldMappings": [
{
"columnName": "Hostname_s",
"identifier": "HostName"
}
],
"entityType": "Host"
},
{
"fieldMappings": [
{
"columnName": "Instance_Name_s",
"identifier": "FullName"
}
],
"entityType": "Account"
}
],
"templateVersion": "1.0.0",
"status": "Available",
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/42Crunch API Protection/Analytic Rules/APIAPIScaping.yaml"
}
}
]
}