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 - SQLi Detection

Back
Idbdb2cd63-99f2-472e-b1b9-acba473b6744
RulenameApp Gateway WAF - SQLi Detection
DescriptionIdentifies 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/
SeverityHigh
TacticsDefenseEvasion
Execution
InitialAccess
PrivilegeEscalation
TechniquesT1211
T1059
T1190
T0890
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-SQLiDetection.yaml
Version1.0.2
Arm templatebdb2cd63-99f2-472e-b1b9-acba473b6744.json
Deploy To Azure
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