|
1 | 1 | --- |
2 | 2 | title: Azure Firewall FTP support |
3 | | -description: By default, Active FTP is disabled on Azure Firewall. You can enable it using PowerShell, CLI, and ARM template. |
4 | | -services: firewall |
| 3 | +description: By default, Active FTP is disabled on Azure Firewall. Enable it by using PowerShell, CLI, or an ARM template. |
5 | 4 | author: duongau |
| 5 | +ms.author: duau |
6 | 6 | ms.service: azure-firewall |
7 | | -ms.custom: devx-track-arm-template, devx-track-azurepowershell, devx-track-azurecli |
8 | 7 | ms.topic: concept-article |
9 | | -ms.date: 06/02/2023 |
10 | | -ms.author: duau |
| 8 | +ms.date: 03/28/2026 |
| 9 | +ms.custom: devx-track-arm-template, devx-track-azurepowershell, devx-track-azurecli |
11 | 10 | # Customer intent: As a network administrator, I want to configure Azure Firewall to support both Active and Passive FTP, so that I can ensure secure and effective FTP communication for my applications. |
12 | 11 | --- |
13 | 12 |
|
14 | 13 | # Azure Firewall FTP support |
15 | 14 |
|
16 | 15 | To support FTP, a firewall must consider the following key aspects: |
17 | 16 | - FTP mode – Active or Passive |
18 | | -- Client/server location - Internet or intranet |
19 | | -- Flow direction - inbound or outbound. |
| 17 | +- Client and server location - Internet or intranet |
| 18 | +- Flow direction - inbound or outbound |
20 | 19 |
|
21 | | -Azure Firewall supports both Active and Passive FTP scenarios. For more information about FTP mode, see [Active FTP vs. Passive FTP, a Definitive Explanation](https://slacksite.com/other/ftp.html). |
| 20 | +Azure Firewall supports both Active and Passive FTP scenarios. For more information about FTP mode, see [Active FTP vs. Passive FTP, a Definitive Explanation](https://slacksite.com/other/ftp.html). |
22 | 21 |
|
23 | | -By default, Passive FTP is enabled and Active FTP support is disabled to protect against FTP bounce attacks using the FTP PORT command. |
| 22 | +By default, Azure Firewall enables Passive FTP and disables Active FTP support to protect against FTP bounce attacks that use the FTP PORT command. |
24 | 23 |
|
25 | | -However, you can enable Active FTP when you deploy using Azure PowerShell, the Azure CLI, or an Azure ARM template. Azure Firewall can support both Active and Passive FTP simultaneously. |
26 | | - |
27 | | -*ActiveFTP* is an Azure Firewall property that can be enabled for: |
28 | | -- all Azure Firewall SKUs |
29 | | -- secure hub and VNet firewalls |
30 | | -- firewalls using policy and classic rules |
| 24 | +However, you can enable Active FTP when you deploy Azure Firewall by using Azure PowerShell, the Azure CLI, or an Azure ARM template. Azure Firewall can support both Active and Passive FTP simultaneously. |
31 | 25 |
|
| 26 | +*ActiveFTP* is an Azure Firewall property that you can enable for: |
| 27 | +- All Azure Firewall SKUs |
| 28 | +- Secure hub and virtual network firewalls |
| 29 | +- Firewalls using policy and classic rules |
32 | 30 |
|
33 | 31 | ## Supported scenarios |
34 | 32 |
|
35 | 33 | The following table shows the configuration required to support various FTP scenarios: |
36 | 34 |
|
37 | 35 | > [!TIP] |
38 | | -> Remember that it may also be necessary to configure firewall rules on the client side to support the connection. |
| 36 | +> Remember that you might also need to configure firewall rules on the client side to support the connection. |
39 | 37 |
|
40 | 38 | > [!NOTE] |
41 | | -> By default, Passive FTP is enabled, and Active FTP needs additional configured on Azure Firewall. For instructions, see next section. |
| 39 | +> - By default, Azure Firewall enables Passive FTP, and Active FTP needs extra configuration. For instructions, see the next section. |
42 | 40 | > |
43 | | -> Most FTP servers do not accept data and control channels from different source IP addresses for security reasons. Hence, FTP sessions via Azure Firewall are required to connect with a single client IP. This implies E-W FTP traffic should never be SNAT’ed with Azure Firewall Private IP and instead use client IP for FTP flows. Likewise for internet FTP traffic, it is recommended to provision Azure Firewall with a single public IP for FTP connectivity. It is recommended to use NAT Gateway to avoid SNAT exhaustion. |
44 | | -
|
45 | | -|Firewall Scenario |Active FTP mode |Passive FTP mode | |
46 | | -|---------|---------|---------| |
47 | | -|VNet-VNet |Network Rules to configure:<br>- Allow From Source VNet to Dest IP port 21<br>- Allow From Dest IP port 20 to Source VNet |Network Rules to configure:<br>- Allow From Source VNet to Dest IP port 21<br>- Allow From Source VNet to Dest IP \<Range of Data Ports>| |
48 | | -|Outbound VNet - Internet<br><br>(FTP client in VNet, server on Internet) |Not supported *|Network Rules to configure:<br>- Allow From Source VNet to Dest IP port 21<br>- Allow From Source VNet to Dest IP \<Range of Data Ports> | |
49 | | -|Inbound DNAT<br><br>(FTP client on Internet, FTP server in VNet) |DNAT rule to configure:<br>- DNAT From Internet Source to VNet IP port 21<br><br>Network rule to configure:<br>- Allow **traffic from** FTP server IP **to** the internet client IP on the active FTP port ranges. | Not supported** | |
| 41 | +> - Most FTP servers don't accept data and control channels from different source IP addresses for security reasons. Hence, FTP sessions via Azure Firewall must connect with a single client IP. This requirement means you should never SNAT E-W FTP traffic with Azure Firewall Private IP. Instead, use the client IP for FTP flows. For internet FTP traffic, provision Azure Firewall with a single public IP for FTP connectivity. Use NAT Gateway to avoid SNAT exhaustion. |
50 | 42 |
|
51 | | -\* Active FTP doesn't work when the FTP client must reach an FTP server on the Internet. Active FTP uses a PORT command from the FTP client that tells the FTP server what IP address and port to use for the data channel. The PORT command uses the private IP address of the client, which can't be changed. Client-side traffic traversing the Azure Firewall is NATed for Internet-based communications, so the PORT command is seen as invalid by the FTP server. This is a general limitation of Active FTP when used with a client-side NAT. |
| 43 | +| Firewall scenario | Active FTP mode | Passive FTP mode | |
| 44 | +| --- | --- | --- | |
| 45 | +| VNet-VNet | Network rules to configure:<br>- Allow from source virtual network to destination IP port 21<br>- Allow from destination IP port 20 to source virtual network | Network rules to configure:<br>- Allow from source virtual network to destination IP port 21<br>- Allow from source virtual network to destination IP \<Range of Data Ports> | |
| 46 | +| Outbound virtual network - Internet<br><br>(FTP client in virtual network, server on Internet) | Not supported <sup>1</sup> | Network rules to configure:<br>- Allow from source virtual network to destination IP port 21<br>- Allow from source virtual network to destination IP \<Range of Data Ports> | |
| 47 | +| Inbound DNAT<br><br>(FTP client on Internet, FTP server in virtual network) | DNAT rule to configure:<br>- DNAT from Internet source to virtual network IP port 21<br><br>Network rule to configure:<br>- Allow **traffic from** FTP server IP **to** the internet client IP on the active FTP port ranges. | Not supported <sup>2</sup> | |
52 | 48 |
|
53 | | -\** Passive FTP over the internet is currently unsupported because the data path traffic (from the internet client via Azure Firewall) can potentially use a different IP address (due to the load balancer). For security reasons, It’s not recommended to change the FTP server settings to accept control and data plane traffic from different source IP addresses. |
| 49 | +<sup>1</sup> Active FTP doesn't work when the FTP client must reach an FTP server on the Internet. Active FTP uses a PORT command from the FTP client that tells the FTP server what IP address and port to use for the data channel. The PORT command uses the private IP address of the client, which can't be changed. Client-side traffic traversing the Azure Firewall is NATed for Internet-based communications, so the PORT command is seen as invalid by the FTP server. This is a general limitation of Active FTP when used with a client-side NAT. |
54 | 50 |
|
| 51 | +<sup>2</sup> Passive FTP over the internet is unsupported because the data path traffic (from the internet client via Azure Firewall) can potentially use a different IP address (due to the load balancer). For security reasons, we don't recommend changing the FTP server settings to accept control and data plane traffic from different source IP addresses. |
55 | 52 |
|
56 | | -## Deploy using Azure PowerShell |
| 53 | +## Deploy by using Azure PowerShell |
57 | 54 |
|
58 | | -To deploy using Azure PowerShell, use the `AllowActiveFTP` parameter. For more information, see [Create a Firewall with Allow Active FTP](/powershell/module/az.network/new-azfirewall#example-16-create-a-firewall-with-allow-active-ftp). |
| 55 | +To deploy by using Azure PowerShell, use the `AllowActiveFTP` parameter. For more information, see [Create a Firewall with Allow Active FTP](/powershell/module/az.network/new-azfirewall#example-16-create-a-firewall-with-allow-active-ftp). |
59 | 56 |
|
60 | 57 | ## Update an existing Azure Firewall by using Azure PowerShell |
61 | 58 |
|
62 | | -To update an existing Azure Firewall by using Azure PowerShell, switch the `AllowActiveFTP` parameter to 'True'. |
| 59 | +To update an existing Azure Firewall by using Azure PowerShell, set the `AllowActiveFTP` parameter to `True`. |
63 | 60 |
|
64 | 61 | ```azurepowershell |
65 | 62 | $rgName = "resourceGroupName" |
66 | 63 | $afwName = "afwName" |
67 | | -$afw = Get-AzFirewall -Name $afwName -ResourceGroupName $rgName |
| 64 | +$afw = Get-AzFirewall ` |
| 65 | + -Name $afwName ` |
| 66 | + -ResourceGroupName $rgName |
68 | 67 | $afw.AllowActiveFTP = $true |
69 | 68 | $afw | Set-AzFirewall |
70 | 69 | ``` |
71 | 70 |
|
72 | | -## Deploy using Azure CLI |
| 71 | +## Deploy by using Azure CLI |
73 | 72 |
|
74 | | -To deploy using the Azure CLI, use the `--allow-active-ftp` parameter. For more information, see [az network firewall create](/cli/azure/network/firewall#az-network-firewall-create-optional-parameters). |
| 73 | +To deploy by using the Azure CLI, use the `--allow-active-ftp` parameter. For more information, see [az network firewall create](/cli/azure/network/firewall#az-network-firewall-create-optional-parameters). |
75 | 74 |
|
76 | | -## Deploy Azure Resource Manager (ARM) template |
| 75 | +## Deploy an Azure Resource Manager template |
77 | 76 |
|
78 | | -To deploy using an ARM template, use the `AdditionalProperties` field: |
| 77 | +To deploy by using an ARM template, use the `AdditionalProperties` field: |
79 | 78 |
|
80 | 79 | ```json |
81 | 80 | "additionalProperties": { |
82 | 81 | "Network.FTP.AllowActiveFTP": "True" |
83 | 82 | }, |
84 | 83 | ``` |
| 84 | + |
85 | 85 | For more information, see [Microsoft.Network azureFirewalls](/azure/templates/microsoft.network/azurefirewalls). |
86 | 86 |
|
87 | 87 | ## Next steps |
|
0 commit comments