App GW WAF - Code Injection
| Id | 912a18fc-6165-446b-8740-81ae6c3f75ee |
| Rulename | App GW WAF - Code Injection |
| Description | Identifies a match for a Code Injection based 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/Code_Injection |
| Severity | High |
| Tactics | DefenseEvasion Execution InitialAccess PrivilegeEscalation |
| Techniques | T1548 T1203 T1190 T1548 |
| 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-Code-Injection.yaml |
| Version | 1.0.3 |
| Arm template | 912a18fc-6165-446b-8740-81ae6c3f75ee.json |
let Threshold = 3;
AGWFirewallLogs
| where Action == "Matched"
| where Message has "Injection" or Message has "File Inclusion"
| project TransactionId, Hostname, RequestUri, TimeGenerated, ClientIp, Message, DetailedMessage, DetailedData
| join kind = inner(
AGWFirewallLogs
| where Action == "Blocked") on TransactionId
| extend Uri = strcat(Hostname,RequestUri)
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(TransactionId,100), Message = make_set(Message,100), Detail_Message = make_set(DetailedMessage,100), Detail_Data = make_set(DetailedData,100), Total_TransactionId = dcount(TransactionId) by ClientIp, Uri, Action
| where Total_TransactionId >= Threshold
description: |
'Identifies a match for a Code Injection based 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/Code_Injection'
version: 1.0.3
triggerThreshold: 0
tactics:
- DefenseEvasion
- Execution
- InitialAccess
- PrivilegeEscalation
queryPeriod: 6h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-Code-Injection.yaml
triggerOperator: gt
status: Available
id: 912a18fc-6165-446b-8740-81ae6c3f75ee
name: App GW WAF - Code Injection
queryFrequency: 6h
severity: High
kind: Scheduled
entityMappings:
- fieldMappings:
- columnName: Uri
identifier: Url
entityType: URL
- fieldMappings:
- columnName: ClientIp
identifier: Address
entityType: IP
relevantTechniques:
- T1548
- T1203
- T1190
- T1548
query: |
let Threshold = 3;
AGWFirewallLogs
| where Action == "Matched"
| where Message has "Injection" or Message has "File Inclusion"
| project TransactionId, Hostname, RequestUri, TimeGenerated, ClientIp, Message, DetailedMessage, DetailedData
| join kind = inner(
AGWFirewallLogs
| where Action == "Blocked") on TransactionId
| extend Uri = strcat(Hostname,RequestUri)
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(TransactionId,100), Message = make_set(Message,100), Detail_Message = make_set(DetailedMessage,100), Detail_Data = make_set(DetailedData,100), Total_TransactionId = dcount(TransactionId) by ClientIp, Uri, Action
| where Total_TransactionId >= Threshold
tags:
- Code Injection
requiredDataConnectors:
- dataTypes:
- AzureDiagnostics
connectorId: WAF