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 threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure%20Firewall/Analytic%20Rules/SeveralDenyActionsRegistered.yaml
Version1.1.3
Arm templatef8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e.json
Deploy To Azure
let threshold = 2;
union isfuzzy=true(
AZFWApplicationRule
| where Action == "Deny"
| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
| where count_ >= threshold),
(AZFWNetworkRule
| where Action == "Deny"
| extend Fqdn = DestinationIp
| summarize StartTime = min(TimeGenerated), count_ = dcount(DestinationPort), Protocols = make_set(Protocol) by SourceIp, Fqdn, Action
| where count_ >= threshold
| extend Protocol = strcat_array(Protocols, "/")),
(AZFWFlowTrace
| where Action == "Deny"
| extend Fqdn = DestinationIp
| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
| where count_ >= threshold),
(AZFWIdpsSignature
| where Action == "Deny"
| extend Fqdn = DestinationIp
| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
| where count_ >= threshold),
(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]), SourceIp = tostring(srcAddr_a[0]), srcPort = tostring(srcAddr_a[1]), DestinationIp = tostring(destAddr_a[0]), destPort = tostring(destAddr_a[1]), Action = tostring(msg_a[7])
| where Action == "Deny"
| extend Fqdn = iff(DestinationIp matches regex "\\d+\\.\\d+\\.\\d+\\.\\d+","",DestinationIp)
| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
| where count_ >= threshold)
severity: Medium
kind: Scheduled
relevantTechniques:
- T1046
- T1071
- T1210
version: 1.1.3
triggerThreshold: 0
tactics:
- Discovery
- LateralMovement
- CommandAndControl
query: |
  let threshold = 2;
  union isfuzzy=true(
  AZFWApplicationRule
  | where Action == "Deny"
  | summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
  | where count_ >= threshold),
  (AZFWNetworkRule
  | where Action == "Deny"
  | extend Fqdn = DestinationIp
  | summarize StartTime = min(TimeGenerated), count_ = dcount(DestinationPort), Protocols = make_set(Protocol) by SourceIp, Fqdn, Action
  | where count_ >= threshold
  | extend Protocol = strcat_array(Protocols, "/")),
  (AZFWFlowTrace
  | where Action == "Deny"
  | extend Fqdn = DestinationIp
  | summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
  | where count_ >= threshold),
  (AZFWIdpsSignature
  | where Action == "Deny"
  | extend Fqdn = DestinationIp
  | summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
  | where count_ >= threshold),
  (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]), SourceIp = tostring(srcAddr_a[0]), srcPort = tostring(srcAddr_a[1]), DestinationIp = tostring(destAddr_a[0]), destPort = tostring(destAddr_a[1]), Action = tostring(msg_a[7])
  | where Action == "Deny"
  | extend Fqdn = iff(DestinationIp matches regex "\\d+\\.\\d+\\.\\d+\\.\\d+","",DestinationIp)
  | summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol
  | where count_ >= threshold)
customDetails:
  NetworkProtocol: Protocol
name: Several deny actions registered
alertDetailsOverride:
  alertDescriptionFormat: Source IP {{SourceIp}} has triggered multiple deny actions to destination {{Fqdn}} using protocol {{Protocol}}, which may indicate malicious activity such as lateral movement or reconnaissance.
  alertDisplayNameFormat: Multiple Deny Actions Detected from {{SourceIp}} to {{Fqdn}}
entityMappings:
- entityType: IP
  fieldMappings:
  - identifier: Address
    columnName: SourceIp
- entityType: URL
  fieldMappings:
  - identifier: Url
    columnName: Fqdn
triggerOperator: gt
requiredDataConnectors:
- dataTypes:
  - AzureDiagnostics
  - AZFWApplicationRule
  - AZFWNetworkRule
  - AZFWFlowTrace
  - AZFWIdpsSignature
  connectorId: AzureFirewall
queryFrequency: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure%20Firewall/Analytic%20Rules/SeveralDenyActionsRegistered.yaml
status: Available
queryPeriod: 1h
id: f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e
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.'
{
  "$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/f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDescriptionFormat": "Source IP {{SourceIp}} has triggered multiple deny actions to destination {{Fqdn}} using protocol {{Protocol}}, which may indicate malicious activity such as lateral movement or reconnaissance.",
          "alertDisplayNameFormat": "Multiple Deny Actions Detected from {{SourceIp}} to {{Fqdn}}"
        },
        "alertRuleTemplateName": "f8dad4e9-3f19-4d70-ab7f-8f19ccd43a3e",
        "customDetails": {
          "NetworkProtocol": "Protocol"
        },
        "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",
        "displayName": "Several deny actions registered",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "SourceIp",
                "identifier": "Address"
              }
            ]
          },
          {
            "entityType": "URL",
            "fieldMappings": [
              {
                "columnName": "Fqdn",
                "identifier": "Url"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Azure%20Firewall/Analytic%20Rules/SeveralDenyActionsRegistered.yaml",
        "query": "let threshold = 2;\nunion isfuzzy=true(\nAZFWApplicationRule\n| where Action == \"Deny\"\n| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol\n| where count_ >= threshold),\n(AZFWNetworkRule\n| where Action == \"Deny\"\n| extend Fqdn = DestinationIp\n| summarize StartTime = min(TimeGenerated), count_ = dcount(DestinationPort), Protocols = make_set(Protocol) by SourceIp, Fqdn, Action\n| where count_ >= threshold\n| extend Protocol = strcat_array(Protocols, \"/\")),\n(AZFWFlowTrace\n| where Action == \"Deny\"\n| extend Fqdn = DestinationIp\n| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol\n| where count_ >= threshold),\n(AZFWIdpsSignature\n| where Action == \"Deny\"\n| extend Fqdn = DestinationIp\n| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol\n| where count_ >= threshold),\n(AzureDiagnostics\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]), SourceIp = tostring(srcAddr_a[0]), srcPort = tostring(srcAddr_a[1]), DestinationIp = tostring(destAddr_a[0]), destPort = tostring(destAddr_a[1]), Action = tostring(msg_a[7])\n| where Action == \"Deny\"\n| extend Fqdn = iff(DestinationIp matches regex \"\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+\",\"\",DestinationIp)\n| summarize StartTime = min(TimeGenerated), count() by SourceIp, Fqdn, Action, Protocol\n| where count_ >= threshold)\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "CommandAndControl",
          "Discovery",
          "LateralMovement"
        ],
        "techniques": [
          "T1046",
          "T1071",
          "T1210"
        ],
        "templateVersion": "1.1.3",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}