Front Door Premium WAF - XSS Detection
Id | b7643904-5081-4920-917e-a559ddc3448f |
Rulename | Front Door Premium WAF - XSS Detection |
Description | Identifies a match for XSS attack in the Front Door Premium WAF logs. The Threshold value in the query can be changed as per your infrastructure’s requirement. References: https://owasp.org/www-project-top-ten/2017/A7_2017-Cross-Site_Scripting_(XSS) |
Severity | High |
Tactics | InitialAccess Execution |
Techniques | T1189 T1203 T0853 |
Required data connectors | WAF |
Kind | Scheduled |
Query frequency | 6h |
Query period | 6h |
Trigger threshold | 0 |
Trigger operator | gt |
Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AzureWAF/AFD-Premium-WAF-XSSDetection.yaml |
Version | 1.0.0 |
Arm template | b7643904-5081-4920-917e-a559ddc3448f.json |
let Threshold = 1;
AzureDiagnostics
| where Category == "FrontDoorWebApplicationFirewallLog"
| where action_s == "AnomalyScoring"
| where details_msg_s contains "XSS"
| parse details_data_s with MessageText "Matched Data:" MatchedData "AND " * "table_name FROM " TableName " " *
| project trackingReference_s, host_s, requestUri_s, TimeGenerated, clientIP_s, details_matches_s, details_msg_s, details_data_s, TableName, MatchedData
| join kind = inner(
AzureDiagnostics
| where Category == "FrontDoorWebApplicationFirewallLog"
| where action_s == "Block") on trackingReference_s
| summarize URI_s = make_set(requestUri_s), Table = make_set(TableName), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TrackingReference = make_set(trackingReference_s), Matched_Data = make_set(MatchedData), Detail_Data = make_set(details_data_s), Detail_Message = make_set(details_msg_s), Total_TrackingReference = dcount(trackingReference_s) by clientIP_s, host_s, action_s
| where Total_TrackingReference >= Threshold
name: Front Door Premium WAF - XSS Detection
query: |
let Threshold = 1;
AzureDiagnostics
| where Category == "FrontDoorWebApplicationFirewallLog"
| where action_s == "AnomalyScoring"
| where details_msg_s contains "XSS"
| parse details_data_s with MessageText "Matched Data:" MatchedData "AND " * "table_name FROM " TableName " " *
| project trackingReference_s, host_s, requestUri_s, TimeGenerated, clientIP_s, details_matches_s, details_msg_s, details_data_s, TableName, MatchedData
| join kind = inner(
AzureDiagnostics
| where Category == "FrontDoorWebApplicationFirewallLog"
| where action_s == "Block") on trackingReference_s
| summarize URI_s = make_set(requestUri_s), Table = make_set(TableName), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TrackingReference = make_set(trackingReference_s), Matched_Data = make_set(MatchedData), Detail_Data = make_set(details_data_s), Detail_Message = make_set(details_msg_s), Total_TrackingReference = dcount(trackingReference_s) by clientIP_s, host_s, action_s
| where Total_TrackingReference >= Threshold
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AzureWAF/AFD-Premium-WAF-XSSDetection.yaml
queryFrequency: 6h
triggerThreshold: 0
requiredDataConnectors:
- dataTypes:
- AzureDiagnostics
connectorId: WAF
version: 1.0.0
queryPeriod: 6h
id: b7643904-5081-4920-917e-a559ddc3448f
triggerOperator: gt
entityMappings:
- fieldMappings:
- identifier: Url
columnName: URI_s
entityType: URL
- fieldMappings:
- identifier: Address
columnName: clientIP_s
entityType: IP
tags:
- Cross Site Scripting
relevantTechniques:
- T1189
- T1203
- T0853
severity: High
description: |
'Identifies a match for XSS attack in the Front Door Premium WAF logs. The Threshold value in the query can be changed as per your infrastructure's requirement.
References: https://owasp.org/www-project-top-ten/2017/A7_2017-Cross-Site_Scripting_(XSS)'
kind: Scheduled
tactics:
- InitialAccess
- Execution
{
"$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/b7643904-5081-4920-917e-a559ddc3448f')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/b7643904-5081-4920-917e-a559ddc3448f')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2022-11-01",
"properties": {
"displayName": "Front Door Premium WAF - XSS Detection",
"description": "'Identifies a match for XSS attack in the Front Door Premium WAF logs. The Threshold value in the query can be changed as per your infrastructure's requirement.\n References: https://owasp.org/www-project-top-ten/2017/A7_2017-Cross-Site_Scripting_(XSS)'\n",
"severity": "High",
"enabled": true,
"query": "let Threshold = 1;\nAzureDiagnostics\n| where Category == \"FrontDoorWebApplicationFirewallLog\"\n| where action_s == \"AnomalyScoring\"\n| where details_msg_s contains \"XSS\"\n| parse details_data_s with MessageText \"Matched Data:\" MatchedData \"AND \" * \"table_name FROM \" TableName \" \" *\n| project trackingReference_s, host_s, requestUri_s, TimeGenerated, clientIP_s, details_matches_s, details_msg_s, details_data_s, TableName, MatchedData\n| join kind = inner(\nAzureDiagnostics\n| where Category == \"FrontDoorWebApplicationFirewallLog\"\n| where action_s == \"Block\") on trackingReference_s\n| summarize URI_s = make_set(requestUri_s), Table = make_set(TableName), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TrackingReference = make_set(trackingReference_s), Matched_Data = make_set(MatchedData), Detail_Data = make_set(details_data_s), Detail_Message = make_set(details_msg_s), Total_TrackingReference = dcount(trackingReference_s) by clientIP_s, host_s, action_s\n| where Total_TrackingReference >= Threshold\n",
"queryFrequency": "PT6H",
"queryPeriod": "PT6H",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"InitialAccess",
"Execution"
],
"techniques": [
"T1189",
"T1203",
"T0853"
],
"alertRuleTemplateName": "b7643904-5081-4920-917e-a559ddc3448f",
"customDetails": null,
"entityMappings": [
{
"fieldMappings": [
{
"identifier": "Url",
"columnName": "URI_s"
}
],
"entityType": "URL"
},
{
"fieldMappings": [
{
"identifier": "Address",
"columnName": "clientIP_s"
}
],
"entityType": "IP"
}
],
"templateVersion": "1.0.0",
"tags": [
"Cross Site Scripting"
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Detections/AzureWAF/AFD-Premium-WAF-XSSDetection.yaml"
}
}
]
}