App GW WAF - Path Traversal Attack
| Id | b6c3a8a6-d22c-4882-9c57-abc01690938b | 
| Rulename | App GW WAF - Path Traversal Attack | 
| Description | Identifies a match for a Path Traversal 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/Path_Traversal  | 
| Severity | High | 
| Tactics | DefenseEvasion Execution InitialAccess PrivilegeEscalation Discovery  | 
| Techniques | T1548 T1203 T1190 T1548 T1087  | 
| 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-Path-Traversal-Attack.yaml | 
| Version | 1.0.3 | 
| Arm template | b6c3a8a6-d22c-4882-9c57-abc01690938b.json | 
let Threshold = 3;  
AGWFirewallLogs
| where Action == "Matched"
| where Message has "Path Traversal Attack"
| 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
kind: Scheduled
entityMappings:
- entityType: URL
  fieldMappings:
  - columnName: Uri
    identifier: Url
- entityType: IP
  fieldMappings:
  - columnName: ClientIp
    identifier: Address
description: |
  'Identifies a match for a Path Traversal 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/Path_Traversal'  
severity: High
queryFrequency: 6h
triggerThreshold: 0
relevantTechniques:
- T1548
- T1203
- T1190
- T1548
- T1087
tags:
- Path Traversal
status: Available
tactics:
- DefenseEvasion
- Execution
- InitialAccess
- PrivilegeEscalation
- Discovery
name: App GW WAF - Path Traversal Attack
id: b6c3a8a6-d22c-4882-9c57-abc01690938b
query: |
  let Threshold = 3;  
  AGWFirewallLogs
  | where Action == "Matched"
  | where Message has "Path Traversal Attack"
  | 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:
- dataTypes:
  - AzureDiagnostics
  connectorId: WAF
version: 1.0.3
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-Path-Traversal-Attack.yaml
queryPeriod: 6h
{
  "$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/b6c3a8a6-d22c-4882-9c57-abc01690938b')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/b6c3a8a6-d22c-4882-9c57-abc01690938b')]",
      "properties": {
        "alertRuleTemplateName": "b6c3a8a6-d22c-4882-9c57-abc01690938b",
        "customDetails": null,
        "description": "'Identifies a match for a Path Traversal based attack in the App Gateway WAF logs. The threshold value in the query can be changed as per your infrastructure's requirements.\nReferences: https://owasp.org/www-community/attacks/Path_Traversal'\n",
        "displayName": "App GW WAF - Path Traversal Attack",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "URL",
            "fieldMappings": [
              {
                "columnName": "Uri",
                "identifier": "Url"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "ClientIp",
                "identifier": "Address"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-Path-Traversal-Attack.yaml",
        "query": "let Threshold = 3;  \nAGWFirewallLogs\n| where Action == \"Matched\"\n| where Message has \"Path Traversal Attack\"\n| project TransactionId, Hostname, RequestUri, TimeGenerated, ClientIp, Message, DetailedMessage, DetailedData\n| join kind = inner(\nAGWFirewallLogs\n| where Action == \"Blocked\") on TransactionId\n| extend Uri = strcat(Hostname,RequestUri)\n| 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\n| where Total_TransactionId >= Threshold\n",
        "queryFrequency": "PT6H",
        "queryPeriod": "PT6H",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion",
          "Discovery",
          "Execution",
          "InitialAccess",
          "PrivilegeEscalation"
        ],
        "tags": [
          "Path Traversal"
        ],
        "techniques": [
          "T1087",
          "T1190",
          "T1203",
          "T1548"
        ],
        "templateVersion": "1.0.3",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}