Edit

Share via


Configure customer-managed keys for Azure NetApp Files volume encryption

Customer-managed keys for Azure NetApp Files volume encryption enable you to use your own keys rather than a platform-managed key when creating a new volume. With customer-managed keys, you can fully manage the relationship between a key's life cycle, key usage permissions, and auditing operations on keys.

The following diagram demonstrates how customer-managed keys work with Azure NetApp Files:

Conceptual diagram of customer-managed keys.

  1. Azure NetApp Files grants permissions to encryption keys to a managed identity. The managed identity is either a user-assigned managed identity that you create and manage or a system-assigned managed identity associated with the NetApp account.

  2. You configure encryption with a customer-managed key for the NetApp account.

  3. You use the managed identity to which the Azure Key Vault admin granted permissions in step 1 to authenticate access to Azure Key Vault via Microsoft Entra ID.

  4. Azure NetApp Files wraps the account encryption key with the customer-managed key in Azure Key Vault.

    Customer-managed keys don't affect performance of Azure NetApp Files. Its only difference from platform-managed keys is how the key is managed.

  5. For read/write operations, Azure NetApp Files sends requests to Azure Key Vault to unwrap the account encryption key to perform encryption and decryption operations.

Cross-tenant customer-managed keys is available in all Azure NetApp Files supported regions.

Considerations

  • To create a volume using customer-managed keys, you must select the Standard network features. You can't use customer-managed key volumes with volume configured using Basic network features. Follow instructions in to Set the Network Features option in the volume creation page.
  • For increased security, you can select the Disable public access option within the network settings of your key vault. When selecting this option, you must also select Allow trusted Microsoft services to bypass this firewall to permit the Azure NetApp Files service to access your encryption key.
  • Customer-managed keys support automatic Managed System Identity (MSI) certificate renewal. If your certificate is valid, you don't need to manually update it.
  • If Azure NetApp Files fails to create a customer-managed key volume, error messages are displayed. For more information, see Error messages and troubleshooting.
  • Do not make any changes to the underlying Azure Key Vault or Azure Private Endpoint after creating a customer-managed keys volume. Making changes can make the volumes inaccessible. If you must make changes, see Update the private endpoint IP for customer-managed keys.
  • Azure NetApp Files supports the ability to transition existing volumes from platform-managed keys (PMK) to customer-managed keys (CMK) without data migration. This provides flexibility with the encryption key lifecycle (renewals, rotations) and extra security for regulated industry requirements.
  • If Azure Key Vault becomes inaccessible, Azure NetApp Files loses its access to the encryption keys and the ability to read or write data to volumes enabled with customer-managed keys. In this situation, create a support ticket to have access manually restored for the affected volumes.
  • Azure NetApp Files supports customer-managed keys on source and data replication volumes with cross-region replication or cross-zone replication relationships.
  • Applying Azure network security groups (NSG) on the private link subnet to Azure Key Vault is supported for Azure NetApp Files customer-managed keys. NSGs don’t affect connectivity to private links unless a private endpoint network policy is enabled on the subnet.
  • Wrap/unwrap is not supported. Customer-managed keys uses encrypt/decrypt. For more information, see RSA algorithms.

Requirements

Before creating your first customer-managed key volume, you must set up:

  • An Azure Key Vault, containing at least one key.
    • The key vault must have soft delete and purge protection enabled.
    • The key must be of type RSA.
  • The key vault must have an Azure Private Endpoint.
    • The private endpoint must reside in a different subnet than the one delegated to Azure NetApp Files. The subnet must be in the same virtual network as the one delegated to Azure NetApp.

For more information about Azure Key Vault and Azure Private Endpoint, see:

Configure a NetApp account to use customer-managed keys

  1. In the Azure portal and under Azure NetApp Files, select Encryption.

    The Encryption page enables you to manage encryption settings for your NetApp account. It includes an option to let you set your NetApp account to use your own encryption key, which is stored in Azure Key Vault. This setting provides a system-assigned identity to the NetApp account, and it adds an access policy for the identity with the required key permissions.

    Screenshot of the encryption menu.

  2. When you set your NetApp account to use customer-managed key, you have two ways to specify the Key URI:

    • The Select from key vault option allows you to select a key vault and a key. Screenshot of the select a key interface.

    • The Enter key URI option allows you to enter manually the key URI. Screenshot of the encryption menu showing key URI field.

  3. Select the identity type that you want to use for authentication to the Azure Key Vault. If your Azure Key Vault is configured to use Vault access policy as its permission model, both options are available. Otherwise, only the user-assigned option is available.

    • If you choose System-assigned, select the Save button. The Azure portal configures the NetApp account automatically by adding a system-assigned identity to your NetApp account. An access policy is also created on your Azure Key Vault with key permissions Get, Encrypt, Decrypt.

    Screenshot of the encryption menu with system-assigned options.

    • If you choose User-assigned, you must select an identity. Choose Select an identity to open a context pane where you select a user-assigned managed identity.

    Screenshot of user-assigned submenu.

    If you've configured your Azure Key Vault to use Vault access policy, the Azure portal configures the NetApp account automatically with the following process: The user-assigned identity you select is added to your NetApp account. An access policy is created on your Azure Key Vault with the key permissions Get, Encrypt, Decrypt.

    If you've configure your Azure Key Vault to use Azure role-based access control, then you need to make sure the selected user-assigned identity has a role assignment on the key vault with permissions for actions:

  4. Select Save then observe the notification communicating the status of the operation. If the operation isn't successful, an error message displays. For assistance in resolving the error, see error messages and troubleshooting.

Use role-based access control

You can use an Azure Key Vault that is configured to use Azure role-based access control. To configure customer-managed keys through Azure portal, you need to provide a user-assigned identity.

  1. In your Azure account, navigate to Key vaults then Access policies.

  2. To create an access policy, under Permission model, select Azure role-based access-control. Screenshot of access configuration menu.

  3. When creating the user-assigned role, there are three permissions required for customer-managed keys:

    1. Microsoft.KeyVault/vaults/keys/read
    2. Microsoft.KeyVault/vaults/keys/encrypt/action
    3. Microsoft.KeyVault/vaults/keys/decrypt/action

    Although there are predefined roles that include these permissions, those roles grant more privileges than are required. It's recommended that you create a custom role with only the minimum required permissions. For more information, see Azure custom roles.

    {
        "id": "/subscriptions/<subscription>/Microsoft.Authorization/roleDefinitions/<roleDefinitionsID>",
        "properties": {
            "roleName": "NetApp account",
            "description": "Has the necessary permissions for customer-managed key encryption: get key, encrypt and decrypt",
            "assignableScopes": [
                "/subscriptions/<subscriptionID>/resourceGroups/<resourceGroup>"
            ],
            "permissions": [
              {
                "actions": [],
                "notActions": [],
                "dataActions": [
                    "Microsoft.KeyVault/vaults/keys/read",
                    "Microsoft.KeyVault/vaults/keys/encrypt/action",
                    "Microsoft.KeyVault/vaults/keys/decrypt/action"
                ],
                "notDataActions": []
                }
            ]
          }
    }
    
  4. Once the custom role is created and available to use with the key vault, you apply it to the user-assigned identity.

Screenshot of role-based access control review and assign menu.

Create an Azure NetApp Files volume using customer-managed keys

  1. From Azure NetApp Files, select Volumes and then + Add volume.

  2. Follow the instructions in Configure network features for an Azure NetApp Files volume:

  3. For a NetApp account configured to use a customer-managed key, the Create Volume page includes an option Encryption Key Source.

    To encrypt the volume with your key, select Customer-Managed Key in the Encryption Key Source dropdown menu.

    When you create a volume using a customer-managed key, you must also select Standard for the Network features option. Basic network features are not supported.

    You must select a key vault private endpoint as well. The dropdown menu displays private endpoints in the selected virtual network. If there's no private endpoint for your key vault in the selected virtual network, then the dropdown is empty, and you won't be able to proceed. If you encounter this scenario, see Azure Private Endpoint.

    Screenshot of create volume menu.

  4. Continue to complete the volume creation process. Refer to:

Transition an Azure NetApp Files volume to customer-managed keys (preview)

Azure NetApp Files supports the ability to move existing volumes using platform-managed keys to customer-managed keys. Once you complete the migration, you can't revert to platform-managed keys.

Register the feature

Encryption key transition for Azure NetApp Files is currently in preview. Before using this feature for the first time, you need to register it.

  1. Register the feature:

    Register-AzProviderFeature -ProviderNamespace Microsoft.NetApp -FeatureName ANFMigratePmkToCmk 
    
  2. Check the status of the feature registration:

    Get-AzProviderFeature -ProviderNamespace Microsoft.NetApp -FeatureName ANFMigratePmkToCmk
    

    Note

    The RegistrationState can remain in the Registering state for up to 60 minutes before changing to Registered. Wait until the status is Registered before continuing.

You can also use Azure CLI commands az feature register and az feature show to register the feature and display the registration status.

Transition volumes

Note

When you transition volumes to use customer-managed keys, you must perform the transition for every virtual network where your Azure NetApp Files account has volumes.

  1. Ensure you configured your Azure NetApp Files account to use customer-managed keys.
  2. In the Azure portal, navigate to Encryption.
  3. Select the CMK Migration tab.
  4. From the drop-down menu, select the virtual network and key vault private endpoint you want to use.
  5. Azure generates a list of volumes to be encrypted by your customer-managed key.
  6. Select Confirm to initiate the migration.

Rekey all volumes under a NetApp account

If you have already configured your NetApp account for customer-managed keys and have one or more volumes encrypted with customer-managed keys, you can change the key that is used to encrypt all volumes under the NetApp account. You can select any key that is in the same key vault. Changing key vaults isn't supported.

  1. Under your NetApp account, navigate to the Encryption menu. Under the Current key input field, select the Rekey link. Screenshot of the encryption key.

  2. In the Rekey menu, select one of the available keys from the dropdown menu. The chosen key must be different from the current key. Screenshot of the rekey menu.

  3. Select OK to save. The rekey operation can take several minutes.

Switch from system-assigned to user-assigned identity

To switch from system-assigned to user-assigned identity, you must grant the target identity access to the key vault being used with read/get, encrypt, and decrypt permissions.

  1. Update the NetApp account by sending a PATCH request using the az rest command:

    az rest -m PATCH -u <netapp-account-resource-id>?api-versions=2022-09-01 -b @path/to/payload.json
    

    The payload should use the following structure:

    {
      "identity": {
        "type": "UserAssigned",
        "userAssignedIdentities": {
         "<identity-resource-id>": {}
        }
      },
      "properties": {
        "encryption": {
          "identity": {
            "userAssignedIdentity": "<identity-resource-id>"
          }
        }
      }
    }
    
  2. Confirm the operation completed successfully with the az netappfiles account show command. The output includes the following fields:

        "id": "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.NetApp/netAppAccounts/account",
        "identity": {
            "principalId": null,
            "tenantId": null,
            "type": "UserAssigned",
            "userAssignedIdentities": {
                "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity>": {
                    "clientId": "<client-id>",
                    "principalId": "<principalId>",
                    "tenantId": <tenantId>"
                }
            }
        },
    

    Ensure that:

    • encryption.identity.principalId matches the value in identity.userAssignedIdentities.principalId
    • encryption.identity.userAssignedIdentity matches the value in identity.userAssignedIdentities[]
    "encryption": {
        "identity": {
            "principalId": "<principal-id>",
            "userAssignedIdentity": "/subscriptions/<subscriptionId>/resourceGroups/<resource-group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity>"
        },
        "KeySource": "Microsoft.KeyVault",
    },
    

Update the private endpoint

Making changes to the Azure Private Endpoint after creating a customer-managed key volume can make the volume inaccessible. If you need to make changes, you must create a new endpoint and update the volume to point to the new endpoint.

  1. Create a new endpoint between the virtual network and Azure Key Vault.
  2. Update all volumes using the old endpoint to use the new endpoint.
    az netappfiles volume update --g $resource-group-name --account-name $netapp-account-name --pool-name $pool-name --name $volume-name --key-vault-private-endpoint-resource-id $newendpoint
    
  3. Delete the old private endpoint.

Next steps