Skip to content

Commit 5ecdf10

Browse files
committed
updates for NFS EiT
1 parent d960b26 commit 5ecdf10

File tree

5 files changed

+67
-69
lines changed

5 files changed

+67
-69
lines changed
Lines changed: 67 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
---
22
title: How to encrypt data in transit for NFS shares (preview)
3-
description: This article explains how data is encrypted while in transit for NFS shares.
3+
description: This article explains how you can encrypt data in transit for NFS Azure file shares.
44
author: guptasonia
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 05/07/2025
7+
ms.date: 05/20/2025
88
ms.author: kendownie
9-
ms.custom: devx-track-azurepowershell
9+
ms.custom: devx-track-azurepowershell, references_regions
1010
#Customer intent: As a network administrator, I want to securely connect to Azure Files NFS v4.1 volumes using a TLS channel so that I can protect data in transit from interception. By using AZNFS mount helper package for simplified setup, I can ensure data confidentiality without needing complex setups or external authentication systems.
11-
1211
---
1312

14-
# How encryption in transit for NFS Azure file shares works (preview)
15-
16-
17-
18-
13+
# Encryption in transit for NFS Azure file shares (preview)
1914

20-
This article explains how you can encrypt data in transit for NFS Azure file shares (preview).
15+
This article explains how you can encrypt data in transit for NFS Azure file shares.
2116

2217
> [!IMPORTANT]
2318
> - Encryption in transit for Azure file shares NFS v4.1 is currently in **preview**.
@@ -26,9 +21,9 @@ This article explains how you can encrypt data in transit for NFS Azure file sha
2621
Azure Files NFS v4.1 volumes enhance network security by enabling secure TLS connections, protecting data in transit from interception, including MITM attacks.
2722

2823
Using [Stunnel](https://www.stunnel.org/), an open-source TLS wrapper, Azure Files encrypts the TCP stream between the NFS client and Azure Files with strong encryption using AES-GCM, without needing Kerberos. This ensures data confidentiality while eliminating the need for complex setups or external authentication systems like Active Directory.
29-
30-
The AZNFS utility package simplifies encrypted mounts by installing and setting up Stunnel on the client. Available on packages.microsoft.com, AZNFS creates a local secure endpoint that transparently forwards NFS client requests over an encrypted connection. The key architectural components include:
31-
24+
25+
The [AZNFS](https://github.com/Azure/AZNFS-mount) utility package simplifies encrypted mounts by installing and setting up Stunnel on the client. Available on packages.microsoft.com, AZNFS creates a local secure endpoint that transparently forwards NFS client requests over an encrypted connection. The key architectural components include:
26+
3227
- **AZNFS Mount Helper**: A client utility package that abstracts the complexity of establishing secure tunnels for NFSv4.1 traffic.
3328

3429
- **Stunnel Process**: Per-storage-account client process that listens for NFS client traffic on a local port and forwards it securely over TLS to the Azure Files NFS server.
@@ -37,49 +32,55 @@ The AZNFS utility package simplifies encrypted mounts by installing and setting
3732

3833
## Supported regions
3934

40-
All regions supported by Azure Premium Files now support encryption in transit, with the exception of Korea Central, West Europe, Japan West, China North3, Israel Central, and Austria East.
41-
35+
All regions supported by Azure Premium Files now support encryption in transit, with the exception of Korea Central, West Europe, Japan West, China North 3, and Israel Central.
4236

43-
## Enforce encryption in transit
44-
45-
By enabling the **Secure transfer required** setting on the storage account, you can ensure that all the mounts to the NFS volumes in the storage account are encrypted.
46-
47-
48-
:::image type="content" source="./media/eit-for-nfs-shares/storage-account-settings.png" alt-text="Diagram showing the Powershell screen to test if EiT is applied." lightbox="./media/eit-for-nfs-shares/storage-account-settings.png":::
49-
50-
However, for users who prefer to maintain flexibility between TLS and non-TLS connections on the same storage account, the 'Secure transfer' setting must remain OFF.
51-
5237
## Register for preview
5338

5439
To enable encryption in transit for your NFS shares, you must register for the preview feature.
5540

5641

5742
### [Portal](#tab/azure-portal)
5843

59-
Azure Portal support for this feature isn't currently available. In the meantime, you can enroll in the preview using either Azure PowerShell or Azure CLI.
44+
Register through the Azure portal by searching for "Encryption in transit for Azure NFS file shares" under Preview Features.
45+
46+
:::image type="content" source="./media/encryption-in-transit-nfs-shares/portal-registration-encryption-in-transit.png" alt-text="Diagram showing the Azure portal screen to test if EiT is applied." lightbox="./media/encryption-in-transit-nfs-shares/portal-registration-encryption-in-transit.png":::
47+
6048

49+
For more information, see [Set up preview features in Azure subscription](/azure/azure-resource-manager/management/preview-features?tabs=azure-portal).
6150

6251

6352
### [PowerShell](#tab/azure-powershell)
6453

65-
- Register through PowerShell using [Get-AzProviderFeature](/powershell/module/az.resources/register-azproviderfeature)
54+
Register through PowerShell using [Register-AzProviderFeature](/powershell/module/az.resources/register-azproviderfeature)
6655

67-
`$ Register-AzProviderFeature -FeatureName "AllowEncryptionInTransitNFS4" -ProviderNamespace "Microsoft.Storage"`
56+
57+
`Register-AzProviderFeature -FeatureName "AllowEncryptionInTransitNFS4" -ProviderNamespace "Microsoft.Storage"`
6858

6959
### [Azure CLI](#tab/azure-cli)
7060

71-
- Register through Azure CLI using [az feature register](/cli/azure/feature)
61+
Register through Azure CLI using [az feature register](/cli/azure/feature)
7262

73-
`$ az feature register --name AllowEncryptionInTransitNFS4 --namespace Microsoft.Storage`
63+
`az feature register --name AllowEncryptionInTransitNFS4 --namespace Microsoft.Storage`
64+
7465
---
66+
67+
68+
## Enforce encryption in transit
69+
70+
By enabling the **Secure transfer required** setting on the storage account, you can ensure that all the mounts to the NFS volumes in the storage account are encrypted.
71+
72+
:::image type="content" source="./media/encryption-in-transit-nfs-shares/storage-account-settings.png" alt-text="Screenshot showing how to enable Secure transfer on a storage account." lightbox="./media/encryption-in-transit-nfs-shares/storage-account-settings.png":::
73+
74+
However, for users who prefer to maintain flexibility between TLS and non-TLS connections on the same storage account, the **Secure transfer** setting must remain OFF.
7575

7676
## How to encrypt data in transit for NFS shares (preview)
7777

7878
Follow these steps to encrypt data in transit:
7979

8080
1. Ensure the required AZNFS mount helper package is installed on the client.
81-
2. Mount the NFS file share with TLS encryption.
82-
3. Verify that the encryption of data succeeded.
81+
1. Mount the NFS file share with TLS encryption.
82+
1. Verify that the encryption of data succeeded.
83+
8384
### Step 1: Check AZNFS mount helper package installation
8485

8586
To check if the AZNFS mount helper package is installed on your client, run the following command:
@@ -90,52 +91,51 @@ If the package is installed, you'll see the message `AZNFS mounthelper is instal
9091

9192
### [Ubuntu/Debian](#tab/Ubuntu)
9293
```bash
93-
curl -sSL -O <https://packages.microsoft.com/config/$(source> /etc/os-release && echo "$ID/$VERSION_ID")/packages-microsoft-prod.deb
94-
sudo dpkg -i packages-microsoft-prod.deb
95-
rm packages-microsoft-prod.deb
96-
sudo apt-get update
94+
curl -sSL -O https://packages.microsoft.com/config/$(source /etc/os-release && echo "$ID/$VERSION_ID")/packages-microsoft-prod.deb
95+
sudo dpkg -i packages-microsoft-prod.deb
96+
rm packages-microsoft-prod.deb
97+
sudo apt-get update
9798
sudo apt-get install aznfs
9899
```
99100

100101
### [RHEL/CentOS](#tab/RHEL)
101102
```bash
102-
curl -sSL -O <https://packages.microsoft.com/config/$(source> /etc/os-release && echo "$ID/${VERSION_ID%%.\*}")/packages-microsoft-prod.rpm
103-
sudo rpm -i packages-microsoft-prod.rpm
104-
rm packages-microsoft-prod.rpm
105-
sudo yum update
103+
curl -sSL -O https://packages.microsoft.com/config/$(source /etc/os-release && echo "$ID/${VERSION_ID%%.*}")/packages-microsoft-prod.rpm
104+
sudo rpm -i packages-microsoft-prod.rpm
105+
rm packages-microsoft-prod.rpm
106+
sudo yum update
106107
sudo yum install aznfs
107108
```
108109

109110
### [SUSE](#tab/SUSE)
110111
```bash
111-
curl -sSL -O <https://packages.microsoft.com/config/$(source> /etc/os-release && echo "$ID/${VERSION_ID%%.\*}")/packages-microsoft-prod.rpm
112-
sudo rpm -i packages-microsoft-prod.rpm
113-
rm packages-microsoft-prod.rpm
114-
sudo zypper refresh
112+
curl -sSL -O https://packages.microsoft.com/config/$(source /etc/os-release && echo "$ID/${VERSION_ID%%.*}")/packages-microsoft-prod.rpm
113+
sudo rpm -i packages-microsoft-prod.rpm
114+
rm packages-microsoft-prod.rpm
115+
sudo zypper refresh
115116
sudo zypper install aznfs
116117
```
117118

118119
### [Alma Linux](#tab/Alma)
119120
```bash
120-
curl -sSL -O <https://packages.microsoft.com/config/$(source> /etc/os-release && echo "alma/${VERSION_ID%%.\*}")/packages-microsoft-prod.rpm
121-
sudo rpm -i packages-microsoft-prod.rpm
122-
rm packages-microsoft-prod.rpm
123-
sudo yum update
124-
sudo yum install -y aznfs
121+
curl -sSL -O https://packages.microsoft.com/config/$(source /etc/os-release && echo "alma/${VERSION_ID%%.*}")/packages-microsoft-prod.rpm
122+
sudo rpm -i packages-microsoft-prod.rpm
123+
rm packages-microsoft-prod.rpm
124+
sudo yum update
125+
sudo yum install -y aznfs
125126
```
126127

127128
### [Oracle Linux](#tab/Oracle)
128129
```bash
129-
curl -sSL -O <https://packages.microsoft.com/config/$(source> /etc/os-release && echo "rhel/${VERSION_ID%%.\*}")/packages-microsoft-prod.rpm
130-
sudo rpm -i packages-microsoft-prod.rpm
131-
rm packages-microsoft-prod.rpm
132-
sudo yum update
130+
curl -sSL -O https://packages.microsoft.com/config/$(source /etc/os-release && echo "rhel/${VERSION_ID%%.*}")/packages-microsoft-prod.rpm
131+
sudo rpm -i packages-microsoft-prod.rpm
132+
rm packages-microsoft-prod.rpm
133+
sudo yum update
133134
sudo yum install -y aznfs
134135
```
135136
---
136137

137138
> [!IMPORTANT]
138-
139139
>
140140
> AZNFS supported Linux distributions are:
141141
>
@@ -147,44 +147,43 @@ sudo yum install -y aznfs
147147
> - Oracle Linux
148148
> - Alma Linux
149149
150-
151-
152150
### Step 2: Mount the NFS file share
153151

154-
155-
156152
To mount the NFS file share **with TLS encryption**:
157-
158153

159154
1. Create a directory on your client.
155+
160156
```bash
161157
sudo mkdir -p /mount/<storage-account-name>/<share-name>
162158
```
163-
2. Mount the NFS share by using the following cmdlet. Replace `<storage-account-name>` with the name of your storage account and replace `<share-name>` with the name of your file share.
159+
160+
1. Mount the NFS share by using the following cmdlet. Replace `<storage-account-name>` with the name of your storage account and replace `<share-name>` with the name of your file share.
164161

165162
```bash
166163
sudo mount -t aznfs <storage-account-name>.file.core.windows.net:/<storage-account-name>/<share-name> /mount/<storage-account-name>/<share-name> -o vers=4,minorversion=1,sec=sys,nconnect=4
167164
```
168165

169-
170-
171166
To mount the NFS share **without TLS encryption**:
167+
172168
```bash
173169
sudo mount -t aznfs <storage-account-name>.file.core.windows.net:/<storage-account-name>/<share-name> /mount/<storage-account-name>/<share-name> -o vers=4,minorversion=1,sec=sys,nconnect=4,notls
174170
```
175-
> [!NOTE]
176-
> Before running the mount command, ensure that the environment variable AZURE_ENDPOINT_OVERRIDE is set. This is required when mounting file shares in non-public Azure cloud regions or when using custom DNS configurations.
177-
> For example, for Azure China Cloud: `export AZURE_ENDPOINT_OVERRIDE="chinacloudapi.cn"`
178171

172+
To have the share **mounted automatically on reboot**, create an entry in the `/etc/fstab` file by adding the following line:
179173

174+
```
175+
<storage-account-name>.file.core.windows.net:/<storage-account-name>/<container-name> /nfsdata aznfs defaults,sec=sys,vers=4.1,nolock,proto=tcp,nofail,_netdev   0 2
176+
```
180177

178+
> [!NOTE]
179+
> Before running the mount command, ensure that the environment variable AZURE_ENDPOINT_OVERRIDE is set. This is required when mounting file shares in non-public Azure cloud regions or when using custom DNS configurations.
180+
> For example, for Azure China Cloud: `export AZURE_ENDPOINT_OVERRIDE="chinacloudapi.cn"`
181181
182182
### Step 3: Verify that the in-transit data encryption succeeded
183183

184184
Run the command `df -Th`.
185185

186-
187-
:::image type="content" source="./media/eit-for-nfs-shares/powershell-capture.png" alt-text="Diagram showing the Powershell screen to test if EiT is applied." lightbox="./media/eit-for-nfs-shares/powershell-capture.png":::
186+
:::image type="content" source="./media/encryption-in-transit-nfs-shares/powershell-capture.png" alt-text="Diagram showing the Powershell screen to test if EiT is applied." lightbox="./media/encryption-in-transit-nfs-shares/powershell-capture.png":::
188187

189188
It indicates that the client is connected through the local port 127.0.0.1, not an external network. The **stunnel** process listens on 127.0.0.1 (localhost) for incoming NFS traffic from the NFS client. Stunnel then **intercepts** this traffic and securely forwards it over **TLS** to the Azure Files NFS server on Azure.
190189

@@ -196,7 +195,7 @@ sudo tcpdump -i any port 2049 -w nfs_traffic.pcap
196195
```
197196
When you open the capture in Wireshark, the payload will appear as "Application Data" instead of readable text.
198197

199-
:::image type="content" source="./media/eit-for-nfs-shares/wireshark-capture.png" alt-text="Diagram showing the Wireshark screen to test if EiT is applied." lightbox="./media/eit-for-nfs-shares/wireshark-capture.png":::
198+
:::image type="content" source="./media/encryption-in-transit-nfs-shares/wireshark-capture.png" alt-text="Diagram showing the Wireshark screen to test if EiT is applied." lightbox="./media/encryption-in-transit-nfs-shares/wireshark-capture.png":::
200199

201200
> [!NOTE]
202201
> All traffic from a virtual machine to the same server endpoint uses a single connection. The AZNFS mount helper ensures that you can't mix TLS and non-TLS configurations when mounting shares to that server. This rule applies to shares from the same storage account and different storage accounts that resolve to the same IP address.
@@ -205,7 +204,6 @@ When you open the capture in Wireshark, the payload will appear as "Application
205204

206205
A **non-TLS (notls) mount** operation might fail if a previous **TLS-encrypted** mount to the same server was terminated before completing successfully. Although the *aznfswatchdog* service automatically cleans up stale entries after a timeout, attempting a new non-TLS mount before cleanup completes can fail.
207206

208-
209207
To resolve this issue, remount the share using the clean option, which immediately clears any stale entries:
210208
```bash
211209
sudo mount -t aznfs <storage-account-name>.file.core.windows.net:/<storage-account-name>/<share-name> /mount/<storage-account-name>/<share-name> -o vers=4,minorversion=1,sec=sys,nconnect=4,notls,clean
@@ -217,4 +215,4 @@ If mounting issues continue, check the log files for more troubleshooting detail
217215

218216
## See also
219217

220-
- [Azure Storage encryption for data at rest | Microsoft Learn](/azure/storage/common/storage-service-encryption)
218+
- [Azure Storage encryption for data at rest](/azure/storage/common/storage-service-encryption)
90.6 KB
Loading

0 commit comments

Comments
 (0)