|
| 1 | +--- |
| 2 | +title: Use customer-manged keys to encrypt data in Azure HPC Cache |
| 3 | +description: How to use Azure Key Vault with Azure HPC Cache to control encryption key access instead of using the default Microsoft-managed encryption keys |
| 4 | +author: ekpgh |
| 5 | +ms.service: hpc-cache |
| 6 | +ms.topic: conceptual |
| 7 | +ms.date: 04/15/2020 |
| 8 | +ms.author: v-erkel |
| 9 | +--- |
| 10 | + |
| 11 | +# Use customer-managed encryption keys for Azure HPC Cache |
| 12 | + |
| 13 | +You can use Azure Key Vault to control ownership of the keys used to encrypt your data in Azure HPC Cache. This article explains how to use customer-managed keys for cache data encryption. |
| 14 | + |
| 15 | +> [!NOTE] |
| 16 | +> All data stored in Azure, including on the cache disks, is encrypted at rest using Microsoft-managed keys by default. You only need to follow the steps in this article if you want to manage the keys used to encrypt your data. |
| 17 | +
|
| 18 | +This feature is available only in these Azure regions: |
| 19 | + |
| 20 | +* East US |
| 21 | +* South Central US |
| 22 | +* West US 2 |
| 23 | + |
| 24 | +There are three steps to enable customer-managed key encryption for Azure HPC Cache: |
| 25 | + |
| 26 | +1. Set up an Azure Key Vault to store the keys. |
| 27 | +1. When creating the Azure HPC Cache, choose customer-managed key encryption and specify the key vault and key to use. |
| 28 | +1. After the cache is created, authorize it to access the key vault. |
| 29 | + |
| 30 | +Encryption is not completely set up until after you authorize it from the newly created cache (step 3). This is because you must pass the cache's identity to the key vault to make it an authorized user. You can't do this before creating the cache, because the identity does not exist until the cache is created. |
| 31 | + |
| 32 | +After you create the cache, you cannot change between customer-managed keys and Microsoft-managed keys. However, if your cache uses customer-managed keys you can [change](#update-key-settings) the encryption key, the key version, and the key vault as needed. |
| 33 | + |
| 34 | +## Understand key vault and key requirements |
| 35 | + |
| 36 | +The key vault and key must meet these requirements to work with Azure HPC Cache. |
| 37 | + |
| 38 | +Key vault properties: |
| 39 | + |
| 40 | +* **Subscription** - Use the same subscription that is used for the cache. |
| 41 | +* **Region** - The key vault must be in the same region as the Azure HPC Cache. |
| 42 | +* **Pricing tier** - Standard tier is sufficient for use with Azure HPC Cache. |
| 43 | +* **Soft delete** - Azure HPC Cache will enable soft delete if it is not already configured on the key vault. |
| 44 | +* **Purge protection** - Purge protection must be enabled. |
| 45 | +* **Access policy** - Default settings are sufficient. |
| 46 | +* **Network connectivity** - Azure HPC Cache must be able to access the key vault regardless of the endpoint settings you choose. |
| 47 | + |
| 48 | +Key properties: |
| 49 | + |
| 50 | +* **Key type** - RSA |
| 51 | +* **RSA key size** - 2048 |
| 52 | +* **Enabled** - Yes |
| 53 | + |
| 54 | +Key vault access permissions: |
| 55 | + |
| 56 | +* The user that creates the Azure HPC Cache must have permissions equivalent to the [Key Vault contributor role](../role-based-access-control/built-in-roles.md#key-vault-contributor). The same permissions are needed to set up and manage Azure Key Vault. |
| 57 | + |
| 58 | + Read [Secure access to a key vault](../key-vault/key-vault-secure-your-key-vault.md) for more information. |
| 59 | + |
| 60 | +## 1. Set up Azure Key Vault |
| 61 | + |
| 62 | +You can set up a key vault and key before you create the cache, or do it as part of cache creation. Make sure these resources meet the requirements outlined [above](#understand-key-vault-and-key-requirements). |
| 63 | + |
| 64 | +At cache creation time you must specify a vault, key, and key version to use for the cache's encryption. |
| 65 | + |
| 66 | +Read the [Azure Key Vault documentation](../key-vault/key-vault-overview.md) for details. |
| 67 | + |
| 68 | +> [!NOTE] |
| 69 | +> The Azure Key Vault must use the same subscription and be in the same region as the Azure HPC Cache. Use one of the supported regions listed at the beginning of this article. |
| 70 | +
|
| 71 | +## 2. Create the cache with customer-managed keys enabled |
| 72 | + |
| 73 | +You must specify the encryption key source when you create your Azure HPC Cache. Follow the instructions in [Create an Azure HPC Cache](hpc-cache-create.md), and specify the key vault and key in the **Disk encryption keys** page. You can create a new key vault and key during cache creation. |
| 74 | + |
| 75 | +> [!TIP] |
| 76 | +> If the **Disk encryption keys** page does not appear, make sure that your cache is in one of the supported regions. |
| 77 | +
|
| 78 | +The user who creates the cache must have privileges equal to the [Key Vault contributor role](../role-based-access-control/built-in-roles.md#key-vault-contributor) or higher. |
| 79 | + |
| 80 | +1. Click the button to enable privately managed keys. After you change this setting, the key vault settings appear. |
| 81 | + |
| 82 | +1. Click **Select a key vault** to open the key selection page. Choose or create the key vault and key for encrypting data on this cache's disks. |
| 83 | + |
| 84 | + If your Azure Key Vault does not appear in the list, check these requirements: |
| 85 | + |
| 86 | + * Is the cache in the same subscription as the key vault? |
| 87 | + * Is the cache in the same region as the key vault? |
| 88 | + * Is there network connectivity between the Azure portal and the key vault? |
| 89 | + |
| 90 | +1. After selecting a vault, select the individual key from the available options, or create a new key. The key must be a 2048-bit RSA key. |
| 91 | + |
| 92 | +1. Specify the version for the selected key. Learn more about versioning in the [Azure Key Vault documentation](../key-vault/about-keys-secrets-and-certificates.md#objects-identifiers-and-versioning). |
| 93 | + |
| 94 | +Continue with the rest of the specifications and create the cache as described in [Create an Azure HPC Cache](hpc-cache-create.md). |
| 95 | + |
| 96 | +## 3. Authorize Azure Key Vault encryption from the cache |
| 97 | +<!-- header is linked from create article, update if changed --> |
| 98 | + |
| 99 | +After a few minutes, the new Azure HPC Cache appears in your Azure portal. Go to the **Overview** page to authorize it to access your Azure Key Vault and enable customer-managed key encryption. (The cache might appear in the resources list before the "deployment underway" messages clear.) |
| 100 | + |
| 101 | +This two-step process is necessary because the Azure HPC Cache instance needs an identity to pass to the Azure Key Vault for authorization. The cache identity doesn't exist until after its initial creation steps are complete. |
| 102 | + |
| 103 | +> [!NOTE] |
| 104 | +> You must authorize encryption within 90 minutes after creating the cache. If you don't complete this step, the cache will time out and fail. A failed cache has to be re-created, it can't be fixed. |
| 105 | +
|
| 106 | +The cache shows the status **Waiting for key**. Click the **Enable encryption** button at the top of the page to authorize the cache to access the specified key vault. |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +Click **Enable encryption** and then click the **Yes** button to authorize the cache to use the encryption key. This action also enables soft-delete and purge protection (if not already enabled) on the key vault. |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | +After the cache requests access to the key vault, it can create and encrypt the disks that store cached data. |
| 115 | + |
| 116 | +After you authorize encryption, Azure HPC Cache goes through several more minutes of setup to create the encrypted disks and related infrastructure. |
| 117 | + |
| 118 | +## Update key settings |
| 119 | + |
| 120 | +You can change the key vault, key, or key version for your cache from the Azure portal. Click the cache's **Encryption** settings link to open the **Customer key settings** page. (You cannot change a cache between customer-managed keys and system-managed keys.) |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +Click the **Change key** link, then click **Change the key vault, key, or version** to open the key selector. |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | +Key vaults in the same subscription and same region as this cache are shown in the list. |
| 129 | + |
| 130 | +After you choose the new encryption key values, click **Select**. A confirmation page appears with the new values. Click **Save** to finalize the selection. |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +## Read more about customer-managed keys in Azure |
| 135 | + |
| 136 | +These articles explain more about using Azure Key Vault and customer-managed keys to encrypt data in Azure: |
| 137 | + |
| 138 | +* [Azure storage encryption overview](../storage/common/storage-service-encryption.md) |
| 139 | +* [Disk encryption with customer-managed keys](../virtual-machines/linux/disk-encryption.md#customer-managed-keys) - Documentation for using Azure Key Vault and managed disks, which is similar to the process used with Azure HPC Cache |
| 140 | + |
| 141 | +## Next steps |
| 142 | + |
| 143 | +After you have created the Azure HPC Cache and authorized Key Vault-based encryption, continue to set up your cache by giving it access to your data sources. |
| 144 | + |
| 145 | +* [Add storage targets](hpc-cache-add-storage.md) |
0 commit comments