Skip to content

Commit fa3f281

Browse files
authored
Merge pull request #232232 from vhorne/fw-new-structured-logs
Add top 10 and flow trace
2 parents 945db51 + fb46ad8 commit fa3f281

File tree

7 files changed

+113
-0
lines changed

7 files changed

+113
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Enable Top 10 flows and Flow trace logs in Azure Firewall
3+
description: Learn how to enable the Top 10 flows and Flow trace logs in Azure Firewall
4+
services: firewall
5+
author: vhorne
6+
ms.service: firewall
7+
ms.topic: how-to
8+
ms.date: 03/27/2023
9+
ms.author: victorh
10+
---
11+
12+
# Enable Top 10 flows (preview) and Flow trace logs (preview) in Azure Firewall
13+
14+
Azure Firewall has two new diagnostics logs you can use to help monitor your firewall:
15+
16+
- Top 10 flows
17+
- Flow trace
18+
19+
## Top 10 flows
20+
21+
The Top 10 flows log (known in the industry as Fat Flows), shows the top connections that are contributing to the highest throughput through the firewall.
22+
23+
### Prerequisites
24+
25+
- Enable [structured logs](firewall-structured-logs.md#enabledisable-structured-logs)
26+
- Use the Azure Resource Specific Table format in [Diagnostic Settings](firewall-diagnostics.md#enable-diagnostic-logging-through-the-azure-portal).
27+
28+
### Enable the log
29+
30+
Enable the log using the following Azure PowerShell commands:
31+
32+
```azurepowershell
33+
Set-AzContext -SubscriptionName <SubscriptionName>
34+
$firewall = Get-AzFirewall- ResourceGroupName <ResourceGroupName> -Name <FirewallName>
35+
$firewall.EnableFatFlowLogging = $true
36+
Set-AzFirewall -AzureFirewall $firewall
37+
```
38+
### Verify the update
39+
40+
There are a few ways to verify the update was successful, but you can navigate to firewall **Overview** and select **JSON view** on the top right corner. Here’s an example:
41+
42+
:::image type="content" source="media/enable-top-ten-and-flow-trace/firewall-log-verification.png" alt-text="Screenshot of JSON showing additional log verification.":::
43+
44+
### Create a diagnostic setting and enable Resource Specific Table
45+
46+
1. In the Diagnostic settings tab, select **Add diagnostic setting**.
47+
2. Type a Diagnostic setting name.
48+
3. Select **Azure Firewall Fat Flow Log** under **Categories** and any other logs you want to be supported in the firewall.
49+
4. In Destination details, select **Send to Log Analytics** workspace
50+
1. Choose your desired Subscription and preconfigured Log Analytics workspace.
51+
1. Enable **Resource specific**.
52+
:::image type="content" source="media/enable-top-ten-and-flow-trace/log-destination-details.png" alt-text="Screenshot showing log destination details.":::
53+
54+
### View and analyze Azure Firewall logs
55+
56+
1. On a firewall resource, navigate to **Logs** under the **Monitoring** tab.
57+
2. Select **Queries**, then load **Azure Firewall Top Flow Logs** by hovering over the option and selecting **Load to editor**.
58+
3. When the query loads, select **Run**.
59+
60+
:::image type="content" source="media/enable-top-ten-and-flow-trace/top-ten-flow-log.png" alt-text="Screenshot showing the Top 10 flow log." lightbox="media/enable-top-ten-and-flow-trace/top-ten-flow-log.png":::
61+
62+
## Flow trace
63+
64+
Currently, the firewall logs show traffic through the firewall in the first attempt of a TCP connection, known as the *syn* packet. However, this doesn't show the full journey of the packet in the TCP handshake. As a result, it's difficult to troubleshoot if a packet is dropped, or asymmetric routing has occurred.
65+
66+
The following additional properties can be added:
67+
- SYN-ACK
68+
- FIN
69+
- FIN-ACK
70+
- RST
71+
- INVALID (flows)
72+
73+
### Prerequisites
74+
75+
- Enable [structured logs](firewall-structured-logs.md#enabledisable-structured-logs)
76+
- Use the Azure Resource Specific Table format in [Diagnostic Settings](firewall-diagnostics.md#enable-diagnostic-logging-through-the-azure-portal).
77+
78+
### Enable the log
79+
80+
Enable the log using the following Azure PowerShell commands:
81+
82+
```azurepowershell
83+
Connect-AzAccount
84+
Select-AzSubscription -Subscription <subscription_id> or <subscription_name>
85+
Register-AzProviderFeature -FeatureName AFWEnableTcpConnectionLogging -ProviderNamespace Microsoft.Network
86+
Register-AzResourceProvider -ProviderNamespace Microsoft.Network
87+
```
88+
### Create a diagnostic setting and enable Resource Specific Table
89+
90+
1. In the Diagnostic settings tab, select **Add diagnostic setting**.
91+
2. Type a Diagnostic setting name.
92+
3. Select **Azure Firewall Fat Flow Log** under **Categories** and any other logs you want to be supported in the firewall.
93+
4. In Destination details, select **Send to Log Analytics** workspace
94+
1. Choose your desired Subscription and preconfigured Log Analytics workspace.
95+
1. Enable **Resource specific**.
96+
:::image type="content" source="media/enable-top-ten-and-flow-trace/log-destination-details.png" alt-text="Screenshot showing log destination details.":::
97+
98+
### View and analyze Azure Firewall Flow trace logs
99+
100+
1. On a firewall resource, navigate to **Logs** under the **Monitoring** tab.
101+
2. Select **Queries**, then load **Azure Firewall flow trace logs** by hovering over the option and selecting **Load to editor**.
102+
3. When the query loads, select **Run**.
103+
104+
:::image type="content" source="media/enable-top-ten-and-flow-trace/trace-flow-logs.png" alt-text="Screenshot showing the Trace flow log." lightbox="media/enable-top-ten-and-flow-trace/trace-flow-logs.png":::
105+
106+
107+
## Next steps
108+
109+
- [Azure Structured Firewall Logs (preview)](firewall-structured-logs.md)

articles/firewall/firewall-structured-logs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ New resource specific tables are now available in Diagnostic setting that allows
4545
- [Application rule aggregation log](/azure/azure-monitor/reference/tables/azfwapplicationruleaggregation) - Contains aggregated Application rule log data for Policy Analytics.
4646
- [Network rule aggregation log](/azure/azure-monitor/reference/tables/azfwnetworkruleaggregation) - Contains aggregated Network rule log data for Policy Analytics.
4747
- [NAT rule aggregation log](/azure/azure-monitor/reference/tables/azfwnatruleaggregation) - Contains aggregated NAT rule log data for Policy Analytics.
48+
- [Top 10 flows log (preview)](/azure/azure-monitor/reference/tables/azfwfatflow) - The Top 10 Flows (Fat Flows) log shows the top connections that are contributing to the highest throughput through the firewall.
49+
- [Flow trace (preview)](/azure/azure-monitor/reference/tables/azfwflowtrace) - Contains flow information, flags, and the time period when the flows were recorded. You'll be able to see full flow information such as SYN, SYN-ACK, FIN, FIN-ACK, RST, INVALID (flows).
4850

4951
## Enable/disable structured logs
5052

83.6 KB
Loading
75 KB
Loading
162 KB
Loading
138 KB
Loading

articles/firewall/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ items:
146146
- name: Monitor diagnostic logs
147147
href: firewall-diagnostics.md
148148
displayName: Azure CLI, az monitor diagnostic-settings create, monitor diagnostic settings
149+
- name: Enable Top 10 flow and Flow trace logs
150+
href: enable-top-ten-and-flow-trace.md
149151
- name: Azure Firewall Workbook
150152
href: firewall-workbook.md
151153
- name: Deploy and configure Firewall Premium

0 commit comments

Comments
 (0)