App Gateway WAF - SQLi Detection
| Id | bdb2cd63-99f2-472e-b1b9-acba473b6744 |
| Rulename | App Gateway WAF - SQLi Detection |
| Description | Identifies a match for a SQL Injection 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/Top10/A03_2021-Injection/ |
| Severity | High |
| Tactics | DefenseEvasion Execution InitialAccess PrivilegeEscalation |
| Techniques | T1211 T1059 T1190 T0890 |
| 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-SQLiDetection.yaml |
| Version | 1.0.2 |
| Arm template | bdb2cd63-99f2-472e-b1b9-acba473b6744.json |
let Threshold = 3;
AGWFirewallLogs
| where Action == "Matched"
| where Message has "SQL Injection"
| 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 a SQL Injection 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/Top10/A03_2021-Injection/'
version: 1.0.2
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-SQLiDetection.yaml
triggerOperator: gt
status: Available
id: bdb2cd63-99f2-472e-b1b9-acba473b6744
name: App Gateway WAF - SQLi Detection
queryFrequency: 6h
severity: High
kind: Scheduled
entityMappings:
- fieldMappings:
- columnName: Uri
identifier: Url
entityType: URL
- fieldMappings:
- columnName: ClientIp
identifier: Address
entityType: IP
relevantTechniques:
- T1211
- T1059
- T1190
- T0890
query: |
let Threshold = 3;
AGWFirewallLogs
| where Action == "Matched"
| where Message has "SQL Injection"
| 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:
- SQL Injection
requiredDataConnectors:
- dataTypes:
- AzureDiagnostics
connectorId: WAF