Back
Id16da3a2a-af29-48a0-8606-d467c180fe18
RulenameFront Door Premium WAF - SQLi Detection
DescriptionIdentifies a SQL Injection match on a request blocked by the managed anomaly-score threshold rule in Prevention mode. The match contributes to the aggregate anomaly score but does not establish that SQL Injection alone caused the block. 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%20Web%20Application%20Firewall%20%28WAF%29/Analytic%20Rules/AFD-Premium-WAF-SQLiDetection.yaml
Version1.0.3
Arm template16da3a2a-af29-48a0-8606-d467c180fe18.json
Deploy To Azure
let Threshold = 1;
AzureDiagnostics
| where Category =~ "FrontDoorWebApplicationFirewallLog"
| where action_s =~ "AnomalyScoring"
| where details_msg_s has "SQL Injection"
| parse details_data_s with MessageText "Matched Data:" MatchedData "AND " * "table_name FROM " TableName " " *
| project policy_s, trackingReference_s, host_s, requestUri_s, TimeGenerated, clientIP_s, details_matches_s, details_msg_s, details_data_s, TableName, MatchedData
| join kind = inner(
AzureDiagnostics
| where Category =~ "FrontDoorWebApplicationFirewallLog"
| where action_s =~ "Block"
| where policyMode_s =~ "Prevention"
| where ruleName_s contains "949110") on policy_s, trackingReference_s
| summarize URI_s = make_set(requestUri_s,100), Table = make_set(TableName,100), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TrackingReference = make_set(trackingReference_s,100), Matched_Data = make_set(MatchedData,100), Detail_Data = make_set(details_data_s,100), Detail_Message = make_set(details_msg_s,100), Total_TrackingReference = dcount(trackingReference_s) by clientIP_s, host_s, action_s
| where Total_TrackingReference >= Threshold
tags:
- SQL Injection
severity: High
requiredDataConnectors:
- connectorId: WAF
  dataTypes:
  - AzureDiagnostics
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure%20Web%20Application%20Firewall%20%28WAF%29/Analytic%20Rules/AFD-Premium-WAF-SQLiDetection.yaml
queryPeriod: 6h
queryFrequency: 6h
entityMappings:
- fieldMappings:
  - identifier: Url
    columnName: URI_s
  entityType: URL
- fieldMappings:
  - identifier: Address
    columnName: clientIP_s
  entityType: IP
kind: Scheduled
relevantTechniques:
- T1211
- T1059
- T1190
- T0890
triggerOperator: gt
status: Available
query: |
  let Threshold = 1;
  AzureDiagnostics
  | where Category =~ "FrontDoorWebApplicationFirewallLog"
  | where action_s =~ "AnomalyScoring"
  | where details_msg_s has "SQL Injection"
  | parse details_data_s with MessageText "Matched Data:" MatchedData "AND " * "table_name FROM " TableName " " *
  | project policy_s, trackingReference_s, host_s, requestUri_s, TimeGenerated, clientIP_s, details_matches_s, details_msg_s, details_data_s, TableName, MatchedData
  | join kind = inner(
  AzureDiagnostics
  | where Category =~ "FrontDoorWebApplicationFirewallLog"
  | where action_s =~ "Block"
  | where policyMode_s =~ "Prevention"
  | where ruleName_s contains "949110") on policy_s, trackingReference_s
  | summarize URI_s = make_set(requestUri_s,100), Table = make_set(TableName,100), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TrackingReference = make_set(trackingReference_s,100), Matched_Data = make_set(MatchedData,100), Detail_Data = make_set(details_data_s,100), Detail_Message = make_set(details_msg_s,100), Total_TrackingReference = dcount(trackingReference_s) by clientIP_s, host_s, action_s
  | where Total_TrackingReference >= Threshold
name: Front Door Premium WAF - SQLi Detection
triggerThreshold: 0
version: 1.0.3
id: 16da3a2a-af29-48a0-8606-d467c180fe18
description: |
  'Identifies a SQL Injection match on a request blocked by the managed anomaly-score threshold rule in Prevention mode. The match contributes to the aggregate anomaly score but does not establish that SQL Injection alone caused the block. The threshold value in the query can be changed as per your infrastructure's requirements.
  References: https://owasp.org/Top10/A03_2021-Injection/'
tactics:
- DefenseEvasion
- Execution
- InitialAccess
- PrivilegeEscalation
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/16da3a2a-af29-48a0-8606-d467c180fe18')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/16da3a2a-af29-48a0-8606-d467c180fe18')]",
      "properties": {
        "alertRuleTemplateName": "16da3a2a-af29-48a0-8606-d467c180fe18",
        "customDetails": null,
        "description": "'Identifies a SQL Injection match on a request blocked by the managed anomaly-score threshold rule in Prevention mode. The match contributes to the aggregate anomaly score but does not establish that SQL Injection alone caused the block. The threshold value in the query can be changed as per your infrastructure's requirements.\nReferences: https://owasp.org/Top10/A03_2021-Injection/'\n",
        "displayName": "Front Door Premium WAF - SQLi Detection",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "URL",
            "fieldMappings": [
              {
                "columnName": "URI_s",
                "identifier": "Url"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "clientIP_s",
                "identifier": "Address"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure%20Web%20Application%20Firewall%20%28WAF%29/Analytic%20Rules/AFD-Premium-WAF-SQLiDetection.yaml",
        "query": "let Threshold = 1;\nAzureDiagnostics\n| where Category =~ \"FrontDoorWebApplicationFirewallLog\"\n| where action_s =~ \"AnomalyScoring\"\n| where details_msg_s has \"SQL Injection\"\n| parse details_data_s with MessageText \"Matched Data:\" MatchedData \"AND \" * \"table_name FROM \" TableName \" \" *\n| project policy_s, trackingReference_s, host_s, requestUri_s, TimeGenerated, clientIP_s, details_matches_s, details_msg_s, details_data_s, TableName, MatchedData\n| join kind = inner(\nAzureDiagnostics\n| where Category =~ \"FrontDoorWebApplicationFirewallLog\"\n| where action_s =~ \"Block\"\n| where policyMode_s =~ \"Prevention\"\n| where ruleName_s contains \"949110\") on policy_s, trackingReference_s\n| summarize URI_s = make_set(requestUri_s,100), Table = make_set(TableName,100), StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TrackingReference = make_set(trackingReference_s,100), Matched_Data = make_set(MatchedData,100), Detail_Data = make_set(details_data_s,100), Detail_Message = make_set(details_msg_s,100), Total_TrackingReference = dcount(trackingReference_s) by clientIP_s, host_s, action_s\n| where Total_TrackingReference >= Threshold\n",
        "queryFrequency": "PT6H",
        "queryPeriod": "PT6H",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion",
          "Execution",
          "InitialAccess",
          "PrivilegeEscalation"
        ],
        "tags": [
          "SQL Injection"
        ],
        "techniques": [
          "T1059",
          "T1190",
          "T1211"
        ],
        "templateVersion": "1.0.3",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}