Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Several deny actions registered

Back
Idf8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e
RulenameSeveral deny actions registered
DescriptionIdentifies attack pattern when attacker tries to move, or scan, from resource to resource on the network and creates an incident when a source has more than 1 registered deny action in Azure Firewall.
SeverityMedium
TacticsDiscovery
LateralMovement
CommandAndControl
TechniquesT1046
T1071
T1210
Required data connectorsAzureFirewall
KindScheduled
Query frequency1h
Query period1h
Trigger threshold1
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Firewall/Analytic Rules/SeveralDenyActionsRegistered.yaml
Version1.0.2
Arm templatef8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e.json
Deploy To Azure
let threshold = 1;
AzureDiagnostics
    | where OperationName in ("AzureFirewallApplicationRuleLog","AzureFirewallNetworkRuleLog")
    | extend msg_s_replaced0 = replace(@"\s\s",@" ",msg_s)
    | extend msg_s_replaced1 = replace(@"\.\s",@" ",msg_s_replaced0)
    | extend msg_a = split(msg_s_replaced1," ")
    | extend srcAddr_a = split(msg_a[3],":") , destAddr_a = split(msg_a[5],":")
    | extend protocol = tostring(msg_a[0]), srcIp = tostring(srcAddr_a[0]), srcPort = tostring(srcAddr_a[1]), destIp = tostring(destAddr_a[0]), destPort = tostring(destAddr_a[1]), action = tostring(msg_a[7])
    | where action == "Deny"
    | extend url = iff(destIp matches regex "\\d+\\.\\d+\\.\\d+\\.\\d+","",destIp)
    | summarize StartTime = min(TimeGenerated), count() by srcIp, destIp, url, action, protocol
    | where count_ >= ["threshold"]
    | extend timestamp = StartTime, URLCustomEntity = url, IPCustomEntity = srcIp
severity: Medium
triggerThreshold: 1
query: |
  let threshold = 1;
  AzureDiagnostics
      | where OperationName in ("AzureFirewallApplicationRuleLog","AzureFirewallNetworkRuleLog")
      | extend msg_s_replaced0 = replace(@"\s\s",@" ",msg_s)
      | extend msg_s_replaced1 = replace(@"\.\s",@" ",msg_s_replaced0)
      | extend msg_a = split(msg_s_replaced1," ")
      | extend srcAddr_a = split(msg_a[3],":") , destAddr_a = split(msg_a[5],":")
      | extend protocol = tostring(msg_a[0]), srcIp = tostring(srcAddr_a[0]), srcPort = tostring(srcAddr_a[1]), destIp = tostring(destAddr_a[0]), destPort = tostring(destAddr_a[1]), action = tostring(msg_a[7])
      | where action == "Deny"
      | extend url = iff(destIp matches regex "\\d+\\.\\d+\\.\\d+\\.\\d+","",destIp)
      | summarize StartTime = min(TimeGenerated), count() by srcIp, destIp, url, action, protocol
      | where count_ >= ["threshold"]
      | extend timestamp = StartTime, URLCustomEntity = url, IPCustomEntity = srcIp  
queryFrequency: 1h
requiredDataConnectors:
- connectorId: AzureFirewall
  dataTypes:
  - AzureDiagnostics
id: f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e
version: 1.0.2
name: Several deny actions registered
kind: Scheduled
status: Available
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Firewall/Analytic Rules/SeveralDenyActionsRegistered.yaml
queryPeriod: 1h
relevantTechniques:
- T1046
- T1071
- T1210
triggerOperator: gt
tactics:
- Discovery
- LateralMovement
- CommandAndControl
description: |
    'Identifies attack pattern when attacker tries to move, or scan, from resource to resource on the network and creates an incident when a source has more than 1 registered deny action in Azure Firewall.'
entityMappings:
- entityType: IP
  fieldMappings:
  - identifier: Address
    columnName: IPCustomEntity
- entityType: URL
  fieldMappings:
  - identifier: Url
    columnName: URLCustomEntity
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e')]",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e')]",
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
      "kind": "Scheduled",
      "apiVersion": "2022-11-01",
      "properties": {
        "displayName": "Several deny actions registered",
        "description": "'Identifies attack pattern when attacker tries to move, or scan, from resource to resource on the network and creates an incident when a source has more than 1 registered deny action in Azure Firewall.'\n",
        "severity": "Medium",
        "enabled": true,
        "query": "let threshold = 1;\nAzureDiagnostics\n    | where OperationName in (\"AzureFirewallApplicationRuleLog\",\"AzureFirewallNetworkRuleLog\")\n    | extend msg_s_replaced0 = replace(@\"\\s\\s\",@\" \",msg_s)\n    | extend msg_s_replaced1 = replace(@\"\\.\\s\",@\" \",msg_s_replaced0)\n    | extend msg_a = split(msg_s_replaced1,\" \")\n    | extend srcAddr_a = split(msg_a[3],\":\") , destAddr_a = split(msg_a[5],\":\")\n    | extend protocol = tostring(msg_a[0]), srcIp = tostring(srcAddr_a[0]), srcPort = tostring(srcAddr_a[1]), destIp = tostring(destAddr_a[0]), destPort = tostring(destAddr_a[1]), action = tostring(msg_a[7])\n    | where action == \"Deny\"\n    | extend url = iff(destIp matches regex \"\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+\",\"\",destIp)\n    | summarize StartTime = min(TimeGenerated), count() by srcIp, destIp, url, action, protocol\n    | where count_ >= [\"threshold\"]\n    | extend timestamp = StartTime, URLCustomEntity = url, IPCustomEntity = srcIp\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 1,
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Discovery",
          "LateralMovement",
          "CommandAndControl"
        ],
        "techniques": [
          "T1046",
          "T1071",
          "T1210"
        ],
        "alertRuleTemplateName": "f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e",
        "customDetails": null,
        "entityMappings": [
          {
            "fieldMappings": [
              {
                "columnName": "IPCustomEntity",
                "identifier": "Address"
              }
            ],
            "entityType": "IP"
          },
          {
            "fieldMappings": [
              {
                "columnName": "URLCustomEntity",
                "identifier": "Url"
              }
            ],
            "entityType": "URL"
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure Firewall/Analytic Rules/SeveralDenyActionsRegistered.yaml",
        "templateVersion": "1.0.2",
        "status": "Available"
      }
    }
  ]
}