Skip to content

Commit f92243e

Browse files
authored
Merge pull request #52619 from mestew/EricADE
Edit Volume Type parameter info for newly added disks
2 parents 1b528e6 + 4613cc7 commit f92243e

4 files changed

+126
-49
lines changed

articles/security/azure-security-disk-encryption-linux-aad.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: security
66
ms.subservice: Azure Disk Encryption
77
ms.topic: article
88
ms.author: mstewart
9-
ms.date: 09/10/2018
9+
ms.date: 09/19/2018
1010

1111
---
1212

@@ -136,10 +136,10 @@ Use the [Set-AzureRmVMDiskEncryptionExtension](/powershell/module/azurerm.comput
136136
137137
```
138138
139-
>[!NOTE]
140-
> The syntax for the value of disk-encryption-keyvault parameter is the full identifier string:
141-
/subscriptions/[subscription-id-guid]/resourceGroups/[resource-group-name]/providers/Microsoft.KeyVault/vaults/[keyvault-name]</br>
142-
> The syntax for the value of the key-encryption-key parameter is the full URI to the KEK as in:
139+
>[!NOTE]
140+
> The syntax for the value of disk-encryption-keyvault parameter is the full identifier string:
141+
/subscriptions/[subscription-id-guid]/resourceGroups/[resource-group-name]/providers/Microsoft.KeyVault/vaults/[keyvault-name]</br> </br>
142+
> The syntax for the value of the key-encryption-key parameter is the full URI to the KEK as in:
143143
https://[keyvault-name].vault.azure.net/keys/[kekname]/[kek-unique-id]
144144
145145
- **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
295295
| keyVaultSecretUrl | URL of the disk-encryption key that's set up in the key vault. |
296296
| keyVaultKekUrl | URL of the key encryption key for encrypting the generated disk-encryption key. |
297297
| vmName | Name of the IaaS VM. |
298+
298299
## Enable encryption on a newly added data disk
299300
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.
300301

301302
### 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:**
304308

305309
```azurecli-interactive
306310
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/
316320
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.
317321
318322
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.
320324
321325
```azurepowershell-interactive
322326
$sequenceVersion = [Guid]::NewGuid();
@@ -331,7 +335,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
331335
332336
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -VolumeType 'data' –SequenceVersion $sequenceVersion;
333337
```
334-
- **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.
335339
336340
```azurepowershell-interactive
337341
$rgName = 'MySecureRg';
@@ -345,16 +349,15 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
345349
$KeyVaultResourceId = $KeyVault.ResourceId;
346350
$keyEncryptionKeyUrl = (Get-AzureKeyVaultKey -VaultName $KeyVaultName -Name $keyEncryptionKeyName).Key.kid;
347351
348-
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $KeyVaultResourceId;
349-
352+
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $KeyVaultResourceId -VolumeType 'data';
350353
```
351354
352-
>[!NOTE]
353-
> The syntax for the value of disk-encryption-keyvault parameter is the full identifier string:
354-
/subscriptions/[subscription-id-guid]/resourceGroups/[resource-group-name]/providers/Microsoft.KeyVault/vaults/[keyvault-name]</br>
355-
> The syntax for the value of the key-encryption-key parameter is the full URI to the KEK as in:
356-
https://[keyvault-name].vault.azure.net/keys/[kekname]/[kek-unique-id]
357355
356+
>[!NOTE]
357+
> The syntax for the value of disk-encryption-keyvault parameter is the full identifier string:
358+
/subscriptions/[subscription-id-guid]/resourceGroups/[resource-group-name]/providers/Microsoft.KeyVault/vaults/[keyvault-name] </br> </br>
359+
> The syntax for the value of the key-encryption-key parameter is the full URI to the KEK as in:
360+
https://[keyvault-name].vault.azure.net/keys/[kekname]/[kek-unique-id]
358361
359362
## Disable encryption for Linux VMs
360363
You can disable encryption using Azure PowerShell, the Azure CLI, or with a Resource Manager template.

articles/security/azure-security-disk-encryption-linux.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: security
66
ms.subservice: Azure Disk Encryption
77
ms.topic: article
88
ms.author: mstewart
9-
ms.date: 09/10/2018
9+
ms.date: 09/19/2018
1010

1111
---
1212

@@ -146,8 +146,22 @@ The following table lists Resource Manager template parameters for existing or r
146146
147147
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.
148148
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+
149163
### 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.
151165

152166
- **Encrypt a running virtual machine scale set**
153167
```azurecli-interactive
@@ -170,8 +184,23 @@ Use the [az vmss encryption enable](/cli/azure/vmss/encryption#az-vmss-encryptio
170184
az vmss encryption disable --resource-group "MySecureRG" --name "MySecureVmss"
171185
```
172186
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:
190+
191+
```azurepowershell-interactive
192+
Register-AzureRmProviderFeature -ProviderNamespace Microsoft.Compute -FeatureName "UnifiedDiskEncryption"
193+
```
194+
195+
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):
196+
197+
```azurepowershell-interactive
198+
Get-AzureRmProviderFeature -ProviderNamespace "Microsoft.Compute" -FeatureName "UnifiedDiskEncryption"
199+
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute
200+
```
201+
173202
### Encrypt virtual machine scale sets with Azure PowerShell
174-
Use the [Set-Azure​RmVmss​Disk​Encryption​Extension](/powershell/module/azurerm.compute/set-azurermvmssdiskencryptionextension) cmdlet to enable encryption on a Windows virtual machine scale set.
203+
Use the [Set-Azure​RmVmss​Disk​Encryption​Extension](/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.
175204

176205
- **Encrypt a running virtual machine scale set**:
177206
```powershell
@@ -302,17 +331,22 @@ New-AzureRmVM -VM $VirtualMachine -ResouceGroupName "MySecureRG"
302331
```
303332

304333
## Enable encryption on a newly added data disk
334+
305335
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.
306336

307337
### 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:**
310344

311345
```azurecli-interactive
312346
az vm encryption enable --resource-group "MySecureRg" --name "MySecureVM" --disk-encryption-keyvault "MySecureVault" --volume-type "Data"
313347
```
314348
315-
- **Encrypt a running VM using KEK:**
349+
- **Encrypt data volumes of a running VM using KEK:**
316350
317351
```azurecli-interactive
318352
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/
322356
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.
323357
324358
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.
326360
327361
```azurepowershell-interactive
328362
$sequenceVersion = [Guid]::NewGuid();
@@ -335,7 +369,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
335369
336370
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -VolumeType 'data' –SequenceVersion $sequenceVersion;
337371
```
338-
- **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.
339373
340374
```azurepowershell-interactive
341375
$rgName = 'MySecureRg';
@@ -347,7 +381,7 @@ You can add a new data disk using [az vm disk attach](../virtual-machines/linux/
347381
$KeyVaultResourceId = $KeyVault.ResourceId;
348382
$keyEncryptionKeyUrl = (Get-AzureKeyVaultKey -VaultName $KeyVaultName -Name $keyEncryptionKeyName).Key.kid;
349383
350-
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $KeyVaultResourceId;
384+
Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $KeyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $KeyVaultResourceId -VolumeType 'data';
351385
352386
```
353387

0 commit comments

Comments
 (0)