|
| 1 | +--- |
| 2 | +title: Azure Firewall Diagnostic logs (legacy) |
| 3 | +description: Diagnostic logs are the original Azure Firewall log queries that output log data in an unstructured or free-form text format. |
| 4 | +services: firewall |
| 5 | +author: vhorne |
| 6 | +ms.service: firewall |
| 7 | +ms.topic: article |
| 8 | +ms.date: 12/04/2023 |
| 9 | +ms.author: victorh |
| 10 | +--- |
| 11 | + |
| 12 | +# Azure Firewall diagnostic logs (legacy) |
| 13 | + |
| 14 | +Diagnostic logs are the original Azure Firewall log queries that output log data in an unstructured or free-form text format. |
| 15 | + |
| 16 | +The following log categories are supported in Diagnostic logs: |
| 17 | + |
| 18 | +- Azure Firewall application rule |
| 19 | +- Azure Firewall network rule |
| 20 | +- Azure Firewall DNS proxy |
| 21 | + |
| 22 | +## Application rule log |
| 23 | + |
| 24 | +The Application rule log is saved to a storage account, streamed to Event hubs and/or sent to Azure Monitor logs only if you've enabled it for each Azure Firewall. Each new connection that matches one of your configured application rules results in a log for the accepted/denied connection. The data is logged in JSON format, as shown in the following examples: |
| 25 | + |
| 26 | + ``` |
| 27 | + Category: application rule logs. |
| 28 | + Time: log timestamp. |
| 29 | + Properties: currently contains the full message. |
| 30 | + note: this field will be parsed to specific fields in the future, while maintaining backward compatibility with the existing properties field. |
| 31 | + ``` |
| 32 | + |
| 33 | + ```json |
| 34 | + { |
| 35 | + "category": "AzureFirewallApplicationRule", |
| 36 | + "time": "2018-04-16T23:45:04.8295030Z", |
| 37 | + "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}", |
| 38 | + "operationName": "AzureFirewallApplicationRuleLog", |
| 39 | + "properties": { |
| 40 | + "msg": "HTTPS request from 10.1.0.5:55640 to mydestination.com:443. Action: Allow. Rule Collection: collection1000. Rule: rule1002" |
| 41 | + } |
| 42 | + } |
| 43 | + ``` |
| 44 | + |
| 45 | + ```json |
| 46 | + { |
| 47 | + "category": "AzureFirewallApplicationRule", |
| 48 | + "time": "2018-04-16T23:45:04.8295030Z", |
| 49 | + "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}", |
| 50 | + "operationName": "AzureFirewallApplicationRuleLog", |
| 51 | + "properties": { |
| 52 | + "msg": "HTTPS request from 10.11.2.4:53344 to www.bing.com:443. Action: Allow. Rule Collection: ExampleRuleCollection. Rule: ExampleRule. Web Category: SearchEnginesAndPortals" |
| 53 | + } |
| 54 | + } |
| 55 | + ``` |
| 56 | + |
| 57 | +## Network rule log |
| 58 | + |
| 59 | +The Network rule log is saved to a storage account, streamed to Event hubs and/or sent to Azure Monitor logs only if you've enabled it for each Azure Firewall. Each new connection that matches one of your configured network rules results in a log for the accepted/denied connection. The data is logged in JSON format, as shown in the following example: |
| 60 | + |
| 61 | + ``` |
| 62 | + Category: network rule logs. |
| 63 | + Time: log timestamp. |
| 64 | + Properties: currently contains the full message. |
| 65 | + note: this field will be parsed to specific fields in the future, while maintaining backward compatibility with the existing properties field. |
| 66 | + ``` |
| 67 | + |
| 68 | + ```json |
| 69 | + { |
| 70 | + "category": "AzureFirewallNetworkRule", |
| 71 | + "time": "2018-06-14T23:44:11.0590400Z", |
| 72 | + "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}", |
| 73 | + "operationName": "AzureFirewallNetworkRuleLog", |
| 74 | + "properties": { |
| 75 | + "msg": "TCP request from 111.35.136.173:12518 to 13.78.143.217:2323. Action: Deny" |
| 76 | + } |
| 77 | + } |
| 78 | + |
| 79 | + ``` |
| 80 | + |
| 81 | +## DNS proxy log |
| 82 | + |
| 83 | +The DNS proxy log is saved to a storage account, streamed to Event hubs, and/or sent to Azure Monitor logs only if you’ve enabled it for each Azure Firewall. This log tracks DNS messages to a DNS server configured using DNS proxy. The data is logged in JSON format, as shown in the following examples: |
| 84 | + |
| 85 | + |
| 86 | + ``` |
| 87 | + Category: DNS proxy logs. |
| 88 | + Time: log timestamp. |
| 89 | + Properties: currently contains the full message. |
| 90 | + note: this field will be parsed to specific fields in the future, while maintaining backward compatibility with the existing properties field. |
| 91 | + ``` |
| 92 | + |
| 93 | + Success: |
| 94 | + ```json |
| 95 | + { |
| 96 | + "category": "AzureFirewallDnsProxy", |
| 97 | + "time": "2020-09-02T19:12:33.751Z", |
| 98 | + "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}", |
| 99 | + "operationName": "AzureFirewallDnsProxyLog", |
| 100 | + "properties": { |
| 101 | + "msg": "DNS Request: 11.5.0.7:48197 – 15676 AAA IN md-l1l1pg5lcmkq.blob.core.windows.net. udp 55 false 512 NOERROR - 0 2.000301956s" |
| 102 | + } |
| 103 | + } |
| 104 | + ``` |
| 105 | + |
| 106 | + Failed: |
| 107 | + |
| 108 | + ```json |
| 109 | + { |
| 110 | + "category": "AzureFirewallDnsProxy", |
| 111 | + "time": "2020-09-02T19:12:33.751Z", |
| 112 | + "resourceId": "/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS/{resourceName}", |
| 113 | + "operationName": "AzureFirewallDnsProxyLog", |
| 114 | + "properties": { |
| 115 | + "msg": " Error: 2 time.windows.com.reddog.microsoft.com. A: read udp 10.0.1.5:49126->168.63.129.160:53: i/o timeout” |
| 116 | + } |
| 117 | + } |
| 118 | + ``` |
| 119 | + |
| 120 | + msg format: |
| 121 | + |
| 122 | + `[client’s IP address]:[client’s port] – [query ID] [type of the request] [class of the request] [name of the request] [protocol used] [request size in bytes] [EDNS0 DO (DNSSEC OK) bit set in the query] [EDNS0 buffer size advertised in the query] [response CODE] [response flags] [response size] [response duration]` |
| 123 | + |
| 124 | +## Storage |
| 125 | + |
| 126 | +You have three options for storing your logs: |
| 127 | + |
| 128 | +* **Storage account**: Storage accounts are best used for logs when logs are stored for a longer duration and reviewed when needed. |
| 129 | +* **Event hubs**: Event hubs are a great option for integrating with other security information and event management (SEIM) tools to get alerts on your resources. |
| 130 | +* **Azure Monitor logs**: Azure Monitor logs is best used for general real-time monitoring of your application or looking at trends. |
| 131 | + |
| 132 | +## Enable diagnostic logs |
| 133 | + |
| 134 | +To learn how to enable the diagnostic logging using the Azure portal, see [Monitor Azure Firewall logs (legacy) and metrics](firewall-diagnostics.md). |
| 135 | + |
| 136 | +## Next steps |
| 137 | + |
| 138 | +- [Azure Firewall metrics and alerts](metrics.md) |
0 commit comments