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
requiredDataConnectors:
- connectorId: WAF
dataTypes:
- AzureDiagnostics
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-Code-Injection.yaml
triggerThreshold: 0
status: Available
tags:
- Code Injection
relevantTechniques:
- T1548
- T1203
- T1190
- T1548
queryPeriod: 6h
name: App GW WAF - Code Injection
entityMappings:
- entityType: URL
fieldMappings:
- columnName: Uri
identifier: Url
- entityType: IP
fieldMappings:
- columnName: ClientIp
identifier: Address
queryFrequency: 6h
triggerOperator: gt
kind: Scheduled
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'
tactics:
- DefenseEvasion
- Execution
- InitialAccess
- PrivilegeEscalation
severity: High
version: 1.0.3
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
id: 912a18fc-6165-446b-8740-81ae6c3f75ee