|
| 1 | +--- |
| 2 | +title: Configure active encryption for Enterprise Azure Cache for Redis instances |
| 3 | +description: Learn about encryption for your Azure Cache for Redis Enterprise instances across Azure regions. |
| 4 | +author: flang-msft |
| 5 | + |
| 6 | +ms.service: cache |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 03/24/2023 |
| 9 | +ms.author: franlanglois |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +# Configure disk encryption for Azure Cache for Redis instances using customer managed keys (preview) |
| 14 | + |
| 15 | +In this article, you learn how to configure disk encryption using Customer Managed Keys (CMK). The Enterprise and Enterprise Flash tiers of Azure Cache for Redis offer the ability to encrypt the OS and data persistence disks with customer-managed key encryption. Platform-managed keys (PMKs), also know as Microsoft-managed keys (MMKs), are used to encrypt the data. However, customer managed keys (CMK) can also be used to wrap the MMKs to control access to these keys. This makes the CMK a _key encryption key_ or KEK. For more information, see [key management in Azure](/azure/security/fundamentals/key-management). |
| 16 | + |
| 17 | +Data in a Redis server is stored in memory by default. This data isn't encrypted. You can implement your own encryption on the data before writing it to the cache. In some cases, data can reside on-disk, either due to the operations of the operating system, or because of deliberate actions to persist data using [export](cache-how-to-import-export-data.md) or [data persistence](cache-how-to-premium-persistence.md). |
| 18 | + |
| 19 | +> [!NOTE] |
| 20 | +> Operating system disk encryption is more important on the Premium tier because open-source Redis can page cache data to disk. The Enterprise tiers does not do page cache data to disk, which is an advantage of the Enterprise and Enterprise Flash tiers. |
| 21 | +> |
| 22 | +
|
| 23 | +## Scope of availability for CMK disk encryption |
| 24 | + |
| 25 | +|: Tier :| Basic, Standard, Premium | Enterprise, Enterprise Flash | |
| 26 | +|-----------------------------|---------|---------------| |
| 27 | +|Microsoft managed keys (MMK) | Yes | Yes | |
| 28 | +|Customer managed keys (CMK) | No | Yes (preview) | |
| 29 | + |
| 30 | +> [!NOTE] |
| 31 | +> By default, all Azure Cache for Redis tiers use Microsoft managed keys to encrypt disks mounted to cache instances. However, in the Basic and Standard tiers, the C0 and C1 SKUs do not support any disk encryption. |
| 32 | +> |
| 33 | +
|
| 34 | +> [!IMPORTANT] |
| 35 | +> On the Premium tier, data persistence streams data directly to Azure Storage, so disk encryption is less important. Azure Storage offers a [variety of encryption methods](../storage/common/storage-service-encryption.md) to be used instead. |
| 36 | +> |
| 37 | +
|
| 38 | +## Encryption coverage |
| 39 | + |
| 40 | +### Enterprise tiers |
| 41 | + |
| 42 | +In the **Enterprise** tier, disk encryption is used to encrypt the persistence disk, temporary files, and the OS disk: |
| 43 | + |
| 44 | +- persistence disk: holds persisted RDB or AOF files as part of [data persistence](cache-how-to-premium-persistence.md) |
| 45 | +- temporary files used in _export_: temporary data used exported is encrypted. When you [export](cache-how-to-import-export-data.md) data, the encryption of the final exported data is controlled by settings in the storage account. |
| 46 | +- the OS disk |
| 47 | + |
| 48 | +MMK is used to encrypt these disks by default, but CMK can also be used. |
| 49 | + |
| 50 | +In the **Enterprise Flash** tier, keys and values are also partially stored on-disk using nonvolatile memory express (NVMe) flash storage. However, this disk isn't the same as the one used for persisted data. Instead, it's ephemeral, and data isn't persisted after the cache is stopped, deallocated, or rebooted. only MMK is only supported on this disk because this data is transient and ephemeral. |
| 51 | + |
| 52 | +| Data stored |Disk |Encryption Options | |
| 53 | +|-------------------|------------------|-------------------| |
| 54 | +|Persistence files | Persistence disk | MMK or CMK | |
| 55 | +|RDB files waiting to be exported | OS disk and Persistence disk | MMK or CMK | |
| 56 | +|Keys & values (Enterprise Flash tier only) | Transient NVMe disk | MMK | |
| 57 | + |
| 58 | +### Other tiers |
| 59 | + |
| 60 | +In the **Basic, Standard, and Premium** tiers, the OS disk is encrypted using MMK. There's no persistence disk mounted and Azure Storage is used instead. |
| 61 | + |
| 62 | +## Prerequisites and limitations |
| 63 | + |
| 64 | +### General prerequisites and limitations |
| 65 | + |
| 66 | +- Disk encryption isn't available in the Basic and Standard tiers for the C0 or C1 SKUs |
| 67 | +- Only user assigned managed identity is supported to connect to Azure Key Vault |
| 68 | +- Changing between MMK and CMK on an existing cache instance triggers a long-running maintenance operation. We don't recommend this for production use because a service disruption occurs. |
| 69 | + |
| 70 | +### Azure Key Vault prerequisites and limitations |
| 71 | + |
| 72 | +- The Azure Key Vault resource containing the customer managed key must be in the same region as the cache resource. |
| 73 | +- [Purge protection and soft-delete](../key-vault/general/soft-delete-overview.md) must be enabled in the Azure Key Vault instance. Purge protection isn't enabled by default. |
| 74 | +- When you use firewall rules in the Azure Key Vault, the Key Vault instance must be configured to [allow trusted services](/azure/key-vault/general/network-security). |
| 75 | +- Only RSA keys are supported |
| 76 | +- The user assigned managed identity must be given the permissions _Get_, _Unwrap Key_, and _Wrap Key_ in the Key Vault access policies, or the equivalent permissions within Azure Role Based Access Control. A recommended built-in role definition with the least privileges needed for this scenario is called [KeyVault Crypto Service Encryption User](../role-based-access-control/built-in-roles.md#key-vault-crypto-service-encryption-user). |
| 77 | + |
| 78 | +## How to configure CMK encryption on Enterprise caches |
| 79 | + |
| 80 | +### Use the portal to create a new cache with CMK enabled |
| 81 | + |
| 82 | +1. Sign in to the [Azure portal](https://portal.azure.com) and start the [Create a Redis Enterprise cache](quickstart-create-redis-enterprise.md) quickstart guide. |
| 83 | + |
| 84 | +1. On the **Advanced** page, go to the section titled **Customer-managed key encryption at rest** and enable the **Use a customer-managed key** option. |
| 85 | + |
| 86 | + :::image type="content" source="media/cache-how-to-encryption/cache-use-key-encryption.png" alt-text="Screenshot of the advanced settings with customer-managed key encryption checked and in a red box."::: |
| 87 | + |
| 88 | +1. Select **Add** to assign a [user assigned managed identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md) to the resource. This managed identity is used to connect to the [Azure Key Vault](../key-vault/general/overview.md) instance that holds the customer managed key. |
| 89 | + |
| 90 | + :::image type="content" source="media/cache-how-to-encryption/cache-managed-identity-user-assigned.png" alt-text="Screenshot showing user managed identity in the working pane."::: |
| 91 | + |
| 92 | +1. Select your chosen user assigned managed identity, and then choose the key input method to use. |
| 93 | + |
| 94 | +1. If using the **Select Azure key vault and key** input method, choose the Key Vault instance that holds your customer managed key. This instance must be in the same region as your cache. |
| 95 | + |
| 96 | + > [!NOTE] |
| 97 | + > For instructions on how to set up an Azure Key Vault instance, see the [Azure Key Vault quickstart guide](../key-vault/secrets/quick-create-portal.md). You can also select the _Create a key vault_ link beneath the Key Vault selection to create a new Key Vault instance. |
| 98 | +
|
| 99 | +1. Choose the specific key and version using the **Customer-managed key (RSA)** and **Version** drop-downs. |
| 100 | + |
| 101 | + :::image type="content" source="media/cache-how-to-encryption/cache-managed-identity-version.png" alt-text="Screenshot showing the select identity and key fields completed."::: |
| 102 | + |
| 103 | +1. If using the **URI** input method, enter the Key Identifier URI for your chosen key from Azure Key Vault. |
| 104 | + |
| 105 | +1. When you've entered all the information for your cache, select **Review + create**. |
| 106 | + |
| 107 | +### Add CMK encryption to an existing Enterprise cache |
| 108 | + |
| 109 | +1. Go to the **Encryption** in the Resource menu of your cache instance. If CMK is already set up, you see the key information. |
| 110 | + |
| 111 | +1. If you haven't set up or if you want to change CMK settings, select **Change encryption settings** |
| 112 | + :::image type="content" source="media/cache-how-to-encryption/cache-encryption-existing-use.png" alt-text="Screenshot encryption selected in the Resource menu for an Enterprise tier cache."::: |
| 113 | + |
| 114 | +1. Select **Use a customer-managed key** to see your configuration options. |
| 115 | + |
| 116 | +1. Select **Add** to assign a [user assigned managed identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md) to the resource. This managed identity is used to connect to the [Azure Key Vault](../key-vault/general/overview.md) instance that holds the customer managed key. |
| 117 | + |
| 118 | +1. Select your chosen user assigned managed identity, and then choose which key input method to use. |
| 119 | + |
| 120 | +1. If using the **Select Azure key vault and key** input method, choose the Key Vault instance that holds your customer managed key. This instance must be in the same region as your cache. |
| 121 | + |
| 122 | + > [!NOTE] |
| 123 | + > For instructions on how to set up an Azure Key Vault instance, see the [Azure Key Vault quickstart guide](../key-vault/secrets/quick-create-portal.md). You can also select the _Create a key vault_ link beneath the Key Vault selection to create a new Key Vault instance. |
| 124 | +
|
| 125 | +1. Choose the specific key using the **Customer-managed key (RSA)** drop-down. If there are multiple versions of the key to choose from, use the **Version** drop-down. |
| 126 | + :::image type="content" source="media/cache-how-to-encryption/cache-encryption-existing-key.png" alt-text="Screenshot showing the select identity and key fields completed for Encryption."::: |
| 127 | + |
| 128 | +1. If using the **URI** input method, enter the Key Identifier URI for your chosen key from Azure Key Vault. |
| 129 | + |
| 130 | +1. Select **Save** |
| 131 | + |
| 132 | +## Next steps |
| 133 | + |
| 134 | +Learn more about Azure Cache for Redis features: |
| 135 | + |
| 136 | +- [Data persistence](cache-how-to-premium-persistence.md) |
| 137 | +- [Import/Export](cache-how-to-import-export-data.md) |
0 commit comments