Skip to content

Commit 5fc7573

Browse files
azure: fix Grok processor error for firewall network rule logs (elastic#13882)
This change adds an additional pattern to the Grok processor to correctly parse "AzureFirewallNetworkRuleLog" in the "firewall_logs" data stream.
1 parent d8c91a6 commit 5fc7573

12 files changed

+103
-9
lines changed

packages/azure/changelog.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- version: "1.23.2"
2+
changes:
3+
- description: Fix Grok processor error in ingest pipeline for `AzureFirewallNetworkRuleLog` in `azure.firewall_logs`.
4+
type: bugfix
5+
link: https://github.com/elastic/integrations/pull/13882
16
- version: "1.23.1"
27
changes:
38
- description: Map `azure.signinlogs.properties.location.state` field to `geo.region_name` instead of `geo.country_name`.

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-applicationrules-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,4 +489,4 @@
489489
}
490490
}
491491
]
492-
}
492+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-applicationrules-structured-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@
8989
}
9090
}
9191
]
92-
}
92+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-dnsproxy-structured-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@
9090
]
9191
}
9292
]
93-
}
93+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-dnsproxyrules-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,4 @@
248248
]
249249
}
250250
]
251-
}
251+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-natrule-structured-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@
7979
]
8080
}
8181
]
82-
}
82+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-networkrule-structured-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181
]
8282
}
8383
]
84-
}
84+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-networkrules-raw.log

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
{"category":"AzureFirewallNetworkRule","operationName":"AzureFirewallNetworkRuleLog","properties":{"msg":"TCP request from 192.168.0.2:54854 to 175.16.199.1:1521. Action: alert. Signature: 2102649. IDS: SQL service_name buffer overflow attempt. Priority: 1. Classification: Attempted User Privilege Gain"},"resourceId":"/SUBSCRIPTIONS/23103928-B2CF-472A-8CDB-0146E2849129/RESOURCEGROUPS/TEST-FW-RG/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/TEST-FW01","time":"2022-06-08T20:40:56.4525380Z"}
88
{"category":"AzureFirewallNetworkRule","operationName":"AzureFirewallNetworkRuleLog","properties":{"msg":"HTTP request from 192.168.0.2:54314 to ocsp.sca1b.amazontrust.com:80. Url: ocsp.sca1b.amazontrust.com. Action: Deny. ThreatIntel: Bot Networks"},"resourceId":"/SUBSCRIPTIONS/23103928-B2CF-472A-8CDB-0146E2849129/RESOURCEGROUPS/TEST-FW-RG/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/TEST-FW01","time":"2022-06-08T20:40:56.4525380Z"}
99
{"category":"AzureFirewallNetworkRule","operationName":"AzureFirewallNetworkRuleLog","properties":{"msg":"ICMP request from 192.168.0.2: to 175.16.199.1:. Action: alert. Signature: 2100366. IDS: ICMP_INFO PING *NIX. Priority: 3. Classification: Misc activity"},"resourceId":"/SUBSCRIPTIONS/23103928-B2CF-472A-8CDB-0146E2849129/RESOURCEGROUPS/TEST-FW-RG/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/TEST-FW01","time":"2022-06-08T20:40:56.4525380Z"}
10+
{"category":"AzureFirewallNetworkRule","operationName":"AzureFirewallNetworkRuleLog","properties":{"msg":"TCP request from 192.168.0.2:50306 to 89.160.20.156:3389. Action: Allow.. Rule Collection: Permit_RFC1918. Rule: Permit_RFC1918"},"resourceId":"/SUBSCRIPTIONS/23103928-B2CF-472A-8CDB-0146E2849129/RESOURCEGROUPS/TEST-FW-RG/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/TEST-FW01","time":"2025-03-13T07:11:59.992099+00:00"}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-networkrules-raw.log-expected.json

+88-1
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,93 @@
752752
"tags": [
753753
"preserve_original_event"
754754
]
755+
},
756+
{
757+
"@timestamp": "2025-03-13T07:11:59.992Z",
758+
"azure": {
759+
"firewall": {
760+
"action": "Allow.",
761+
"category": "AzureFirewallNetworkRule",
762+
"operation_name": "AzureFirewallNetworkRuleLog"
763+
},
764+
"resource": {
765+
"group": "TEST-FW-RG",
766+
"id": "/SUBSCRIPTIONS/23103928-B2CF-472A-8CDB-0146E2849129/RESOURCEGROUPS/TEST-FW-RG/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/TEST-FW01",
767+
"name": "TEST-FW01",
768+
"provider": "MICROSOFT.NETWORK/AZUREFIREWALLS"
769+
},
770+
"subscription_id": "23103928-B2CF-472A-8CDB-0146E2849129"
771+
},
772+
"cloud": {
773+
"account": {
774+
"id": "23103928-B2CF-472A-8CDB-0146E2849129"
775+
},
776+
"provider": "azure"
777+
},
778+
"destination": {
779+
"address": "89.160.20.156",
780+
"as": {
781+
"number": 29518,
782+
"organization": {
783+
"name": "Bredband2 AB"
784+
}
785+
},
786+
"geo": {
787+
"city_name": "Linköping",
788+
"continent_name": "Europe",
789+
"country_iso_code": "SE",
790+
"country_name": "Sweden",
791+
"location": {
792+
"lat": 58.4167,
793+
"lon": 15.6167
794+
},
795+
"region_iso_code": "SE-E",
796+
"region_name": "Östergötland County"
797+
},
798+
"ip": "89.160.20.156",
799+
"port": 3389
800+
},
801+
"ecs": {
802+
"version": "8.11.0"
803+
},
804+
"event": {
805+
"category": [
806+
"network"
807+
],
808+
"kind": "event",
809+
"original": "{\"category\":\"AzureFirewallNetworkRule\",\"operationName\":\"AzureFirewallNetworkRuleLog\",\"properties\":{\"msg\":\"TCP request from 192.168.0.2:50306 to 89.160.20.156:3389. Action: Allow.. Rule Collection: Permit_RFC1918. Rule: Permit_RFC1918\"},\"resourceId\":\"/SUBSCRIPTIONS/23103928-B2CF-472A-8CDB-0146E2849129/RESOURCEGROUPS/TEST-FW-RG/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/TEST-FW01\",\"time\":\"2025-03-13T07:11:59.992099+00:00\"}",
810+
"type": [
811+
"connection"
812+
]
813+
},
814+
"network": {
815+
"iana_number": "6",
816+
"transport": "tcp"
817+
},
818+
"observer": {
819+
"name": "TEST-FW01",
820+
"product": "Network Firewall",
821+
"type": "firewall",
822+
"vendor": "Azure"
823+
},
824+
"related": {
825+
"ip": [
826+
"192.168.0.2",
827+
"89.160.20.156"
828+
]
829+
},
830+
"rule": {
831+
"name": "Permit_RFC1918",
832+
"ruleset": "Permit_RFC1918"
833+
},
834+
"source": {
835+
"address": "192.168.0.2",
836+
"ip": "192.168.0.2",
837+
"port": 50306
838+
},
839+
"tags": [
840+
"preserve_original_event"
841+
]
755842
}
756843
]
757-
}
844+
}

packages/azure/data_stream/firewall_logs/_dev/test/pipeline/test-sdh3075-raw.log-expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@
9191
]
9292
}
9393
]
94-
}
94+
}

packages/azure/data_stream/firewall_logs/elasticsearch/ingest_pipeline/default.yml

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ processors:
186186
patterns:
187187
- "^%{DATA:azure.firewall.proto} request from %{IPORHOST:source.address}:%{NUMBER:source.port:long} to %{IPORHOST:destination.address}:%{NUMBER:destination.port:long}. Action: %{DATA:azure.firewall.action}. $"
188188
- "^%{DATA:azure.firewall.proto} request from %{IPORHOST:source.address}:%{NUMBER:source.port:long} to %{IPORHOST:destination.address}:%{NUMBER:destination.port:long}. Action: %{DATA:azure.firewall.action}. Policy: %{DATA:azure.firewall.policy}. Rule Collection Group: %{DATA:azure.firewall.rule_collection_group}. Rule Collection: %{DATA:rule.ruleset}. Rule: %{DATA:rule.name}$"
189+
- "^%{DATA:azure.firewall.proto} request from %{IPORHOST:source.address}:%{NUMBER:source.port:long} to %{IPORHOST:destination.address}:%{NUMBER:destination.port:long}. Action: %{DATA:azure.firewall.action}. Rule Collection: %{DATA:rule.ruleset}. Rule: %{DATA:rule.name}$"
189190
- "^%{DATA:azure.firewall.proto} Type=%{DATA:azure.firewall.icmp.request.code} request from %{IPORHOST:source.address} to %{IPORHOST:destination.address}. Action: %{DATA:azure.firewall.action}. $"
190191
- "^%{DATA:azure.firewall.proto} request from %{IPORHOST:source.address}:%{NUMBER:source.port:long} to %{IPORHOST:destination.address}:%{NUMBER:destination.port:long} was DNAT'ed to %{IP:destination.nat.ip}:%{NUMBER:destination.nat.port:long}$"
191192
- "^%{DATA:azure.firewall.proto} request from %{IPORHOST:source.address}:%{NUMBER:source.port:long} to %{IPORHOST:destination.address}:%{NUMBER:destination.port:long} was DNAT'ed to %{IP:destination.nat.ip}:%{NUMBER:destination.nat.port:long}. Policy: %{DATA:azure.firewall.policy}. Rule Collection Group: %{DATA:azure.firewall.rule_collection_group}. Rule Collection: %{DATA:rule.ruleset}. Rule: %{DATA:rule.name}$"

packages/azure/manifest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: azure
22
title: Azure Logs
3-
version: "1.23.1"
3+
version: "1.23.2"
44
description: This Elastic integration collects logs from Azure
55
type: integration
66
icons:

0 commit comments

Comments
 (0)