You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- **Verify the disks are encrypted:** To check on the encryption status of a IaaS VM, use the [Get-AzureRmVmDiskEncryptionStatus](/powershell/module/azurerm.compute/get-azurermvmdiskencryptionstatus) cmdlet.
@@ -295,12 +295,16 @@ The following table lists the Resource Manager template parameters for your encr
295
295
| keyVaultSecretUrl | URL of the disk-encryption key that's set up in the key vault. |
296
296
| keyVaultKekUrl | URL of the key encryption key for encrypting the generated disk-encryption key. |
297
297
| vmName | Name of the IaaS VM. |
298
+
298
299
## Enable encryption on a newly added data disk
299
300
You can add a new data disk using [az vm disk attach](../virtual-machines/linux/add-disk.md), or [through the Azure portal](../virtual-machines/linux/attach-disk-portal.md). Before you can encrypt, you need to mount the newly attached data disk first. You must request encryption of the data drive since the drive will be unusable while encryption is in progress.
300
301
301
302
### Enable encryption on a newly added disk with Azure CLI
302
-
The Azure CLI command will automatically provide a new sequence version for you when you run the command to enable encryption.
303
-
-**Encrypt a running VM using a client secret:**
303
+
If the VM was previously encrypted with "All" then the --volume-type parameter should remain All. All includes both OS and data disks. If the VM was previously encrypted with a volume type of "OS", then the --volume-type parameter should be changed to All so that both the OS and the new data disk will be included. If the VM was encrypted with only the volume type of "Data", then it can remain "Data" as demonstrated below. Adding and attaching a new data disk to a VM is not sufficient preparation for encryption. The newly attached disk must also be formatted and properly mounted within the VM prior to enabling encryption. On Linux the disk must be mounted in /etc/fstab with a [persistent block device name](https://docs.microsoft.com/azure/virtual-machines/linux/troubleshoot-device-names-problems).
304
+
305
+
In contrast to Powershell syntax, the CLI does not require the user to provide a unique sequence version when enabling encryption. The CLI automatically generates and uses its own unique sequence version value.
306
+
307
+
-**Encrypt a running VM using a client secret:**
304
308
305
309
```azurecli-interactive
306
310
az vm encryption enable --resource-group "MySecureRg" --name "MySecureVM" --aad-client-id "<my spn created with CLI/my Azure AD ClientID>" --aad-client-secret "My-AAD-client-secret" --disk-encryption-keyvault "MySecureVault" --volume-type "Data"
@@ -316,7 +320,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
316
320
When using Powershell to encrypt a new disk for Linux, a new sequence version needs to be specified. The sequence version has to be unique. The script below generates a GUID for the sequence version.
317
321
318
322
319
-
- **Encrypt a running VM using a client secret:** The script below initializes your variables and runs the Set-AzureRmVMDiskEncryptionExtension cmdlet. The resource group, VM, key vault, AAD app, and client secret should have already been created as prerequisites. Replace MySecureRg, MySecureVM, MySecureVault, My-AAD-client-ID, and My-AAD-client-secret with your values. The -VolumeType parameter is set to data disks and not the OS disk.
323
+
- **Encrypt a running VM using a client secret:** The script below initializes your variables and runs the Set-AzureRmVMDiskEncryptionExtension cmdlet. The resource group, VM, key vault, AAD app, and client secret should have already been created as prerequisites. Replace MySecureRg, MySecureVM, MySecureVault, My-AAD-client-ID, and My-AAD-client-secret with your values. The -VolumeType parameter is set to data disks and not the OS disk. If the VM was previously encrypted with a volume type of "OS" or "All", then the -VolumeType parameter should be changed to All so that both the OS and the new data disk will be included.
320
324
321
325
```azurepowershell-interactive
322
326
$sequenceVersion = [Guid]::NewGuid();
@@ -331,7 +335,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
- **Encrypt a running VM using KEK to wrap the client secret:** Azure Disk Encryption lets you specify an existing key in your key vault to wrap disk encryption secrets that were generated while enabling encryption. When a key encryption key is specified, Azure Disk Encryption uses that key to wrap the encryption secrets before writing to Key Vault. You may need to add the -VolumeType parameter if you're encrypting data disks and not the OS disk.
338
+
- **Encrypt a running VM using KEK to wrap the client secret:** Azure Disk Encryption lets you specify an existing key in your key vault to wrap disk encryption secrets that were generated while enabling encryption. When a key encryption key is specified, Azure Disk Encryption uses that key to wrap the encryption secrets before writing to Key Vault. The -VolumeType parameter is set to data disks and not the OS disk. If the VM was previously encrypted with a volume type of "OS" or "All", then the -VolumeType parameter should be changed to All so that both the OS and the new data disk will be included.
335
339
336
340
```azurepowershell-interactive
337
341
$rgName = 'MySecureRg';
@@ -345,16 +349,15 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
Copy file name to clipboardExpand all lines: articles/security/azure-security-disk-encryption-linux.md
+43-9Lines changed: 43 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.service: security
6
6
ms.subservice: Azure Disk Encryption
7
7
ms.topic: article
8
8
ms.author: mstewart
9
-
ms.date: 09/10/2018
9
+
ms.date: 09/19/2018
10
10
11
11
---
12
12
@@ -146,8 +146,22 @@ The following table lists Resource Manager template parameters for existing or r
146
146
147
147
A batch file example for Linux scale set data disk encryption can be found [here](https://github.com/Azure-Samples/azure-cli-samples/tree/master/disk-encryption/vmss). This example creates a resource group, Linux scale set, mounts a 5-GB data disk, and encrypts the virtual machine scale set.
148
148
149
+
### Register for disk encryption preview using Azure CLI
150
+
151
+
The Azure disk encryption for virtual machine scale sets preview requires you to self-register your subscription with [az feature register](/cli/azure/feature#az_feature_register). You only need to perform the following steps the first time that you use the disk encryption preview feature:
152
+
153
+
```azurecli-interactive
154
+
az feature register --name UnifiedDiskEncryption --namespace Microsoft.Compute
155
+
```
156
+
157
+
It can take up to 10 minutes for the registration request to propagate. You can check on the registration state with [az feature show](/cli/azure/feature#az_feature_show). When the `State` reports *Registered*, re-register the *Mirosoft.Compute* provider with [az provider register](/cli/azure/provider#az_provider_register):
158
+
159
+
```azurecli-interactive
160
+
az provider register --namespace Microsoft.Compute
161
+
```
162
+
149
163
### Encrypt virtual machine scale sets with Azure CLI
150
-
Use the [az vmss encryption enable](/cli/azure/vmss/encryption#az-vmss-encryption-enable) to enable encryption on a Windows virtual machine scale set. If you set the upgrade policy on the scale set to manual, start the encryption with [az vmss update-instances](/cli/azure/vmss#az-vmss-update-instances).
164
+
Use the [az vmss encryption enable](/cli/azure/vmss/encryption#az-vmss-encryption-enable) to enable encryption on a Windows virtual machine scale set. If you set the upgrade policy on the scale set to manual, start the encryption with [az vmss update-instances](/cli/azure/vmss#az-vmss-update-instances). The resource group, VM, and key vault should have already been created as prerequisites.
151
165
152
166
-**Encrypt a running virtual machine scale set**
153
167
```azurecli-interactive
@@ -170,8 +184,23 @@ Use the [az vmss encryption enable](/cli/azure/vmss/encryption#az-vmss-encryptio
170
184
az vmss encryption disable --resource-group "MySecureRG" --name "MySecureVmss"
171
185
```
172
186
187
+
### Register for disk encryption preview using Azure Powershell
188
+
189
+
The Azure disk encryption for virtual machine scale sets preview requires you to self-register your subscription with [Register-AzureRmProviderFeature](/powershell/module/azurerm.resources/register-azurermproviderfeature). You only need to perform the following steps the first time that you use the disk encryption preview feature:
It can take up to 10 minutes for the registration request to propagate. You can check on the registration state with [Get-AzureRmProviderFeature](/powershell/module/AzureRM.Resources/Get-AzureRmProviderFeature). When the `RegistrationState` reports *Registered*, re-register the *Mirosoft.Compute* provider with [Register-AzureRmResourceProvider](/powershell/module/AzureRM.Resources/Register-AzureRmResourceProvider):
### Encrypt virtual machine scale sets with Azure PowerShell
174
-
Use the [Set-AzureRmVmssDiskEncryptionExtension](/powershell/module/azurerm.compute/set-azurermvmssdiskencryptionextension) cmdlet to enable encryption on a Windows virtual machine scale set.
203
+
Use the [Set-AzureRmVmssDiskEncryptionExtension](/powershell/module/azurerm.compute/set-azurermvmssdiskencryptionextension) cmdlet to enable encryption on a Windows virtual machine scale set. The resource group, VM, and key vault should have already been created as prerequisites.
You can add a new data disk using [az vm disk attach](../virtual-machines/linux/add-disk.md), or [through the Azure portal](../virtual-machines/linux/attach-disk-portal.md). Before you can encrypt, you need to mount the newly attached data disk first. You must request encryption of the data drive since the drive will be unusable while encryption is in progress.
306
336
307
337
### Enable encryption on a newly added disk with Azure CLI
308
-
The Azure CLI command will automatically provide a new sequence version for you when you run the command to enable encryption.
309
-
-**Encrypt a running VM:**
338
+
339
+
If the VM was previously encrypted with "All" then the --volume-type parameter should remain All. All includes both OS and data disks. If the VM was previously encrypted with a volume type of "OS", then the --volume-type parameter should be changed to All so that both the OS and the new data disk will be included. If the VM was encrypted with only the volume type of "Data", then it can remain "Data" as demonstrated below. Adding and attaching a new data disk to a VM is not sufficient preparation for encryption. The newly attached disk must also be formatted and properly mounted within the VM prior to enabling encryption. On Linux the disk must be mounted in /etc/fstab with a [persistent block device name](https://docs.microsoft.com/azure/virtual-machines/linux/troubleshoot-device-names-problems).
340
+
341
+
In contrast to Powershell syntax, the CLI does not require the user to provide a unique sequence version when enabling encryption. The CLI automatically generates and uses its own unique sequence version value.
342
+
343
+
-**Encrypt data volumes of a running VM:**
310
344
311
345
```azurecli-interactive
312
346
az vm encryption enable --resource-group "MySecureRg" --name "MySecureVM" --disk-encryption-keyvault "MySecureVault" --volume-type "Data"
313
347
```
314
348
315
-
- **Encrypt a running VM using KEK:**
349
+
- **Encrypt data volumes of a running VM using KEK:**
316
350
317
351
```azurecli-interactive
318
352
az vm encryption enable --resource-group "MySecureRg" --name "MySecureVM" --disk-encryption-keyvault "MySecureVault" --key-encryption-key "MyKEK_URI" --key-encryption-keyvault "MySecureVaultContainingTheKEK" --volume-type "Data"
@@ -322,7 +356,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
322
356
When using Powershell to encrypt a new disk for Linux, a new sequence version needs to be specified. The sequence version has to be unique. The script below generates a GUID for the sequence version.
323
357
324
358
325
-
- **Encrypt a running VM:** The script below initializes your variables and runs the Set-AzureRmVMDiskEncryptionExtension cmdlet. The resource group, VM, and key vault should have already been created as prerequisites. Replace MySecureRg, MySecureVM, and MySecureVault with your values. The -VolumeType parameter is set to data disks and not the OS disk.
359
+
- **Encrypt data volumes of a running VM:** The script below initializes your variables and runs the Set-AzureRmVMDiskEncryptionExtension cmdlet. The resource group, VM, and key vault should have already been created as prerequisites. Replace MySecureRg, MySecureVM, and MySecureVault with your values. Acceptable values for the -VolumeType parameter are All, OS, and Data. If the VM was previously encrypted with a volume type of "OS" or "All", then the -VolumeType parameter should be changed to All so that both the OS and the new data disk will be included.
326
360
327
361
```azurepowershell-interactive
328
362
$sequenceVersion = [Guid]::NewGuid();
@@ -335,7 +369,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
- **Encrypt a running VM using KEK:** You may need to add the -VolumeType parameter if you're encrypting data disks and not the OS disk.
372
+
- **Encrypt data volumes of a running VM using KEK:** Acceptable values for the -VolumeType parameter are All, OS, and Data. If the VM was previously encrypted with a volume type of "OS" or "All", then the -VolumeType parameter should be changed to All so that both the OS and the new data disk will be included.
339
373
340
374
```azurepowershell-interactive
341
375
$rgName = 'MySecureRg';
@@ -347,7 +381,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
0 commit comments