|
| 1 | +--- |
| 2 | +title: Set up customer-managed keys to encrypt data at rest in ISEs |
| 3 | +description: Create and manage your own encryption keys to secure data at rest for integration service environments (ISEs) in Azure Logic Apps |
| 4 | +services: logic-apps |
| 5 | +ms.suite: integration |
| 6 | +ms.reviewer: klam, rarayudu, logicappspm |
| 7 | +ms.topic: conceptual |
| 8 | +ms.date: 01/14/2020 |
| 9 | +--- |
| 10 | + |
| 11 | +# Set up customer-managed keys to encrypt data at rest for integration service environments (ISEs) in Azure Logic Apps |
| 12 | + |
| 13 | +Azure Logic Apps relies on Azure Storage to store and automatically [encrypt data at rest](../storage/common/storage-service-encryption.md). This encryption protects your data and helps you meet your organizational security and compliance commitments. By default, Azure Storage uses Microsoft-managed keys to encrypt your data. For more information about how Azure Storage encryption works, see [Azure Storage encryption for data at rest](../storage/common/storage-service-encryption.md) and [Azure Data Encryption-at-Rest](../security/fundamentals/encryption-atrest.md). |
| 14 | + |
| 15 | +When you create an [integration service environment (ISE)](../logic-apps/connect-virtual-network-vnet-isolated-environment-overview.md) for hosting your logic apps, and you want more control over the encryption keys used by Azure Storage, you can set up, use, and manage your own key by using [Azure Key Vault](../key-vault/key-vault-overview.md). This capability is also known as "Bring Your Own Key" (BYOK), and your key is called a "customer-managed key". |
| 16 | + |
| 17 | +This topic shows how to set up and specify your own encryption key to use when you create your ISE. |
| 18 | + |
| 19 | +## Considerations |
| 20 | + |
| 21 | +* At this time, customer-managed key support for an ISE is available only in these Azure regions: West US 2, East US, and South Central US |
| 22 | + |
| 23 | +* You can specify a customer-managed key *only when you create your ISE*, not afterwards. You can't disable this key after your ISE is created. Currently, no support exists for rotating a customer-managed key for an ISE. |
| 24 | + |
| 25 | +* To support customer-managed keys, your ISE requires requires having its [system-assigned managed identity](../active-directory/managed-identities-azure-resources/overview.md#how-does-the-managed-identities-for-azure-resources-work) enabled. This identity lets the ISE authenticate access to resources in other Azure Active Directory (Azure AD) tenants so that you don't have to sign in with your credentials. |
| 26 | + |
| 27 | +* Currently, to create an ISE that supports customer-managed keys and has its system-assigned identity enabled, you have to call the Logic Apps REST API by using an HTTPS PUT request. |
| 28 | + |
| 29 | +* Within *30 minutes* after you send the HTTPS PUT request that creates your ISE, you must [give key vault access to your ISE's system-assigned identity](#identity-access-to-key-vault). Otherwise, ISE creation fails and throws a permissions error. |
| 30 | + |
| 31 | +## Prerequisites |
| 32 | + |
| 33 | +* An Azure subscription. If you don't have an Azure subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/). |
| 34 | + |
| 35 | +* An Azure key vault that has the **Soft Delete** and **Do Not Purge** properties enabled |
| 36 | + |
| 37 | + For more information about enabling these properties, see [Azure Key Vault soft-delete overview](../key-vault/key-vault-ovw-soft-delete.md) and [Configure customer-managed keys with Azure Key Vault](../storage/common/storage-encryption-keys-portal.md). If you're new to Azure Key Vault, learn [how to create a key vault](../key-vault/quick-create-portal.md#create-a-vault) by using the Azure portal or by using the Azure PowerShell command, [New-AzKeyVault](https://docs.microsoft.com/powershell/module/az.keyvault/new-azkeyvault). |
| 38 | + |
| 39 | +* In your key vault, a key that's created with these property values: |
| 40 | + |
| 41 | + | Property | Value | |
| 42 | + |----------|-------| |
| 43 | + | **Key Type** | RSA | |
| 44 | + | **RSA Key Size** | 2048 | |
| 45 | + | **Enabled** | Yes | |
| 46 | + ||| |
| 47 | + |
| 48 | +  |
| 49 | + |
| 50 | + For more information, see [Configure customer-managed keys with Azure Key Vault](../storage/common/storage-encryption-keys-portal.md) or the Azure PowerShell command, [Add-AzKeyVaultKey](https://docs.microsoft.com/powershell/module/az.keyvault/Add-AzKeyVaultKey). |
| 51 | + |
| 52 | +* A tool that you can use to create your ISE by calling the Logic Apps REST API with an HTTPS PUT request. For example, you can use [Postman](https://www.getpostman.com/downloads/), or you can build a logic app that performs this task. |
| 53 | + |
| 54 | +<a name="enable-support-key-system-identity"></a> |
| 55 | + |
| 56 | +## Create ISE with key vault and managed identity support |
| 57 | + |
| 58 | +To create your ISE by calling the Logic Apps REST API, make this HTTPS PUT request: |
| 59 | + |
| 60 | +`PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}?api-version=2019-05-01` |
| 61 | + |
| 62 | +> [!IMPORTANT] |
| 63 | +> The Logic Apps REST API 2019-05-01 version requires that you make your own HTTP PUT request for ISE connectors. |
| 64 | +
|
| 65 | +### Request header |
| 66 | + |
| 67 | +In the request header, include these properties: |
| 68 | + |
| 69 | +* `Content-type`: Set this property value to `application/json`. |
| 70 | + |
| 71 | +* `Authorization`: Set this property value to the bearer token for the customer who has access to the Azure subscription or resource group that you want to use. |
| 72 | + |
| 73 | +### Request body |
| 74 | + |
| 75 | +In the request body, enable support for these additional items by providing their information in your ISE definition: |
| 76 | + |
| 77 | +* The system-assigned managed identity that your ISE uses to access your key vault |
| 78 | +* Your key vault and the customer-managed key that you want to use |
| 79 | + |
| 80 | +#### Request body syntax |
| 81 | + |
| 82 | +Here is the request body syntax, which describes the properties to use when you create your ISE: |
| 83 | + |
| 84 | +```json |
| 85 | +{ |
| 86 | + "id": "/subscriptions/{Azure-subscription-ID/resourceGroups/{Azure-resource-group}/providers/Microsoft.Logic/integrationServiceEnvironments/{ISE-name}", |
| 87 | + "name": "{ISE-name}", |
| 88 | + "type": "Microsoft.Logic/integrationServiceEnvironments", |
| 89 | + "location": "{Azure-region}", |
| 90 | + "sku": { |
| 91 | + "name": "Premium", |
| 92 | + "capacity": 1 |
| 93 | + }, |
| 94 | + "identity": { |
| 95 | + "type": "SystemAssigned" |
| 96 | + }, |
| 97 | + "properties": { |
| 98 | + "networkConfiguration": { |
| 99 | + "accessEndpoint": { |
| 100 | + // Your ISE can use the "External" or "Internal" endpoint. This example uses "External". |
| 101 | + "type": "External" |
| 102 | + }, |
| 103 | + "subnets": [ |
| 104 | + { |
| 105 | + "id": "/subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group}/providers/Microsoft.Network/virtualNetworks/{virtual-network-name}/subnets/{subnet-1}", |
| 106 | + }, |
| 107 | + { |
| 108 | + "id": "/subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group}/providers/Microsoft.Network/virtualNetworks/{virtual-network-name}/subnets/{subnet-2}", |
| 109 | + }, |
| 110 | + { |
| 111 | + "id": "/subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group}/providers/Microsoft.Network/virtualNetworks/{virtual-network-name}/subnets/{subnet-3}", |
| 112 | + }, |
| 113 | + { |
| 114 | + "id": "/subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group}/providers/Microsoft.Network/virtualNetworks/{virtual-network-name}/subnets/{subnet-4}", |
| 115 | + } |
| 116 | + ] |
| 117 | + }, |
| 118 | + "encryptionConfiguration": { |
| 119 | + "encryptionKeyReference": { |
| 120 | + "keyVault": { |
| 121 | + "id": "subscriptions/{Azure-subscription-ID}/resourceGroups/{Azure-resource-group}/providers/Microsoft.KeyVault/vaults/{key-vault-name}", |
| 122 | + }, |
| 123 | + "keyName": "{customer-managed-key-name}", |
| 124 | + "keyVersion": "{key-version-number}" |
| 125 | + } |
| 126 | + } |
| 127 | + } |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +#### Request body example |
| 132 | + |
| 133 | +This example request body shows the sample values: |
| 134 | + |
| 135 | +```json |
| 136 | +{ |
| 137 | + "id": "/subscriptions/********************/resourceGroups/Fabrikam-RG/providers/Microsoft.Logic/integrationServiceEnvironments/Fabrikam-ISE", |
| 138 | + "name": "Fabrikam-ISE", |
| 139 | + "type": "Microsoft.Logic/integrationServiceEnvironments", |
| 140 | + "location": "WestUS2", |
| 141 | + "identity": { |
| 142 | + "type": "SystemAssigned" |
| 143 | + }, |
| 144 | + "sku": { |
| 145 | + "name": "Premium", |
| 146 | + "capacity": 1 |
| 147 | + }, |
| 148 | + "properties": { |
| 149 | + "networkConfiguration": { |
| 150 | + "accessEndpoint": { |
| 151 | + // Your ISE can use the "External" or "Internal" endpoint. This example uses "External". |
| 152 | + "type": "External" |
| 153 | + }, |
| 154 | + "subnets": [ |
| 155 | + { |
| 156 | + "id": "/subscriptions/********************/resourceGroups/Fabrikam-RG/providers/Microsoft.Network/virtualNetworks/Fabrikam-VNET/subnets/subnet-1", |
| 157 | + }, |
| 158 | + { |
| 159 | + "id": "/subscriptions/********************/resourceGroups/Fabrikam-RG/providers/Microsoft.Network/virtualNetworks/Fabrikam-VNET/subnets/subnet-2", |
| 160 | + }, |
| 161 | + { |
| 162 | + "id": "/subscriptions/********************/resourceGroups/Fabrikam-RG/providers/Microsoft.Network/virtualNetworks/Fabrikam-VNET/subnets/subnet-3", |
| 163 | + }, |
| 164 | + { |
| 165 | + "id": "/subscriptions/********************/resourceGroups/Fabrikam-RG/providers/Microsoft.Network/virtualNetworks/Fabrikam-VNET/subnets/subnet-4", |
| 166 | + } |
| 167 | + ] |
| 168 | + }, |
| 169 | + "encryptionConfiguration": { |
| 170 | + "encryptionKeyReference": { |
| 171 | + "keyVault": { |
| 172 | + "id": "subscriptions/********************/resourceGroups/Fabrikam-RG/providers/Microsoft.KeyVault/vaults/FabrikamKeyVault", |
| 173 | + }, |
| 174 | + "keyName": "Fabrikam-Encryption-Key", |
| 175 | + "keyVersion": "********************" |
| 176 | + } |
| 177 | + } |
| 178 | + } |
| 179 | +} |
| 180 | +``` |
| 181 | + |
| 182 | +<a name="identity-access-to-key-vault"></a> |
| 183 | + |
| 184 | +## Grant access to your key vault |
| 185 | + |
| 186 | +Within *30 minutes* after you send the HTTP PUT request to create your ISE, you must add an access policy to your key vault for your ISE's system-assigned identity. Otherwise, creation for your ISE fails, and you get a permissions error. |
| 187 | + |
| 188 | +For this task, you can use either the Azure PowerShell [Set-AzKeyVaultAccessPolicy](https://docs.microsoft.com/powershell/module/az.keyvault/set-azkeyvaultaccesspolicy) command, or you can follow these steps in the Azure portal: |
| 189 | + |
| 190 | +1. In the [Azure portal](https://portal.azure.com), open your Azure key vault. |
| 191 | + |
| 192 | +1. On your key vault menu, select **Access policies** > **Add Access Policy**, for example: |
| 193 | + |
| 194 | +  |
| 195 | + |
| 196 | +1. After the **Add access policy** pane opens, follow these steps: |
| 197 | + |
| 198 | + 1. Select these options: |
| 199 | + |
| 200 | + | Setting | Values | |
| 201 | + |---------|--------| |
| 202 | + | **Configure from template (optional) list** | Key Management | |
| 203 | + | **Key permissions** | - **Key Management Operations**: Get, List <p><p>- **Cryptographic Operations**: Unwrap Key, Wrap Key | |
| 204 | + ||| |
| 205 | + |
| 206 | +  |
| 207 | + |
| 208 | + 1. For **Select principal**, select **None selected**. After the **Principal** pane opens, in the search box, find and select your ISE. When you're done, choose **Select** > **Add**. |
| 209 | + |
| 210 | +  |
| 211 | + |
| 212 | + 1. When you're finished with the **Access policies** pane, select **Save**. |
| 213 | + |
| 214 | +For more information, see [Provide Key Vault authentication with a managed identity](../key-vault/managed-identity.md#grant-your-app-access-to-key-vault). |
| 215 | + |
| 216 | +## Next steps |
| 217 | + |
| 218 | +* Learn more about [Azure Key Vault](../key-vault/key-vault-overview.md) |
0 commit comments