App Gateway WAF - XSS Detection
| Id | 1c7ff502-2ad4-4970-9d29-9210c6753138 |
| Rulename | App Gateway WAF - XSS Detection |
| Description | Identifies a match for an XSS attack in the App Gateway WAF logs. The threshold value in the query can be changed as per your infrastructure’s requirements. References: https://owasp.org/www-community/attacks/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/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-XSSDetection.yaml |
| Version | 1.0.2 |
| Arm template | 1c7ff502-2ad4-4970-9d29-9210c6753138.json |
let Threshold = 3;
AGWFirewallLogs
| where Action == "Matched"
| where Message has "XSS"
| project TransactionId, Hostname, RequestUri, TimeGenerated, ClientIp, Message
| join kind = inner(
AGWFirewallLogs
| where Action == "Blocked"
| extend transactionId_g = tostring(TransactionId)) on TransactionId
| extend Uri = strcat(Hostname,RequestUri)
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(transactionId_g,100), Message = make_set(Message,100), Total_TransactionId = dcount(transactionId_g) by ClientIp, Uri, Action
| where Total_TransactionId >= Threshold
description: |
'Identifies a match for an XSS attack in the App Gateway WAF logs. The threshold value in the query can be changed as per your infrastructure's requirements.
References: https://owasp.org/www-community/attacks/xss/'
version: 1.0.2
triggerThreshold: 0
tactics:
- InitialAccess
- Execution
queryPeriod: 6h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-XSSDetection.yaml
triggerOperator: gt
status: Available
id: 1c7ff502-2ad4-4970-9d29-9210c6753138
name: App Gateway WAF - XSS Detection
queryFrequency: 6h
severity: High
kind: Scheduled
entityMappings:
- fieldMappings:
- columnName: Uri
identifier: Url
entityType: URL
- fieldMappings:
- columnName: ClientIp
identifier: Address
entityType: IP
relevantTechniques:
- T1189
- T1203
- T0853
query: |
let Threshold = 3;
AGWFirewallLogs
| where Action == "Matched"
| where Message has "XSS"
| project TransactionId, Hostname, RequestUri, TimeGenerated, ClientIp, Message
| join kind = inner(
AGWFirewallLogs
| where Action == "Blocked"
| extend transactionId_g = tostring(TransactionId)) on TransactionId
| extend Uri = strcat(Hostname,RequestUri)
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(transactionId_g,100), Message = make_set(Message,100), Total_TransactionId = dcount(transactionId_g) by ClientIp, Uri, Action
| where Total_TransactionId >= Threshold
tags:
- Cross Site Scripting
requiredDataConnectors:
- dataTypes:
- AzureDiagnostics
connectorId: WAF