10.1 Ensure 'Encryption key source' is set to 'Customer Managed Key' for Azure NetApp Files accounts (Automated)
Description
Customer-managed keys (CMK) for Azure NetApp Files volume encryption enable organizations to use their own keys instead of platform-managed ones, providing full control over encryption.
Rationale
Using customer-managed keys (CMKs) to encrypt Azure NetApp Files volumes enhances security by granting organizations complete control over their encryption keys.
Impact
There are costs and configuration overhead associated with setting up and managing customer-managed keys.
Audit Procedure
Audit from Azure Portal
- Go to
Azure NetApp Files. - Click the name of a NetApp account.
- Under
Azure NetApp Files, clickEncryption. - Ensure that
Encryption key sourceis set toCustomer Managed Key. - Repeat steps 1-4 for each NetApp Files account.
Audit from Azure CLI
Run the following command to list NetApp Files accounts:
az netappfiles account list
For each NetApp Files account, run the following command:
az netappfiles account show --resource-group <resource-group> --account-name <netapp-files-account>
Ensure that under encryption, keySource is set to Microsoft.KeyVault.
Audit from PowerShell
Run the following command to install the Az.NetAppFiles module:
Install-Module Az.NetAppFiles
Enter Y when prompted.
Run the following command to list NetApp Files accounts:
Get-AzResource | ? {$_.ResourceType -like 'Microsoft.NetApp/netAppAccounts'} | Format-Table
Run the following command to get the NetApp Files account in a resource group with a given name:
$netapp = Get-AzNetAppFilesAccount -ResourceGroupName <resource-group> -Name <netapp-files-account>
Run the following command to get the encryption key source for the NetApp Files account:
$netapp.Encryption.KeySource
Ensure that the command returns Microsoft.KeyVault. Repeat for each NetApp Files account.
Expected Result
Under encryption, keySource is set to Microsoft.KeyVault.
Remediation
Remediate from Azure Portal
- Go to
Azure NetApp Files. - Click the name of a NetApp account.
- Under
Azure NetApp Files, clickEncryption. - Next to
Encryption key source, click the radio button next toCustomer Managed Key. - Next to
Encryption key, click the radio button next toEnter key URIto provide a known key URI, or click the radio button next toSelect from key vaultto select a key from a key vault. - If entering a key URI, provide the key URI in the text box next to
Key URI. - If selecting a key from a key vault, click
Select a key vault and key.- From the drop-down menu next to
Key vault, select a key vault. - From the drop-down menu next to
Key, select a key. - Click
Select.
- From the drop-down menu next to
- Next to
Identity type, click the radio button next toSystem-assignedto use a system-assigned managed identity, or click the radio button next toUser-assignedto use a user-assigned managed identity. - If selecting a user-assigned managed identity, next to
User-assigned identity, clickSelect an identity.- In the filter box, type to filter by identity name and/or resource group name.
- Check the box next to a managed identity.
- Click
Add.
- Click
Save. - Repeat steps 1-10 for each NetApp Files account.
Remediate from Azure CLI
For each NetApp Files account requiring remediation, run the following command to assign a customer-managed encryption key:
az netappfiles account update --resource-group <resource-group> --account-name <netapp-files-account> --key-source Microsoft.KeyVault --key-name <key-name> --key-vault-uri <key-vault-uri> --keyvault-resource-id <key-vault-resource-id> --identity-type SystemAssigned
Note: Use --identity-type UserAssigned --user-assigned-identity <user-assigned-identity-id> with the above command to provide a UserAssigned Identity Id.
Default Value
By default, data in the NetApp Files account is encrypted using Microsoft-managed keys.
References
- https://learn.microsoft.com/en-us/azure/azure-netapp-files/configure-customer-managed-keys
- https://learn.microsoft.com/en-us/cli/azure/netappfiles
- https://learn.microsoft.com/en-us/powershell/module/az.netappfiles/get-aznetappfilesaccount
Profile
Level 2 | Automated