Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

App Gateway WAF - XSS Detection

Back
Id1c7ff502-2ad4-4970-9d29-9210c6753138
RulenameApp Gateway WAF - XSS Detection
DescriptionIdentifies 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/
SeverityHigh
TacticsInitialAccess
Execution
TechniquesT1189
T1203
T0853
Required data connectorsWAF
KindScheduled
Query frequency6h
Query period6h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-XSSDetection.yaml
Version1.0.2
Arm template1c7ff502-2ad4-4970-9d29-9210c6753138.json
Deploy To Azure
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