Skip to content

Commit 00f907d

Browse files
authored
Merge pull request #107020 from tamram/tamram-0309
forbidden operations after CMK revocation + remove key size restriction
2 parents 4ad5a4e + 880f75b commit 00f907d

File tree

4 files changed

+55
-12
lines changed

4 files changed

+55
-12
lines changed

articles/storage/common/storage-encryption-keys-cli.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 01/10/2020
10+
ms.date: 03/10/2020
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common
@@ -116,11 +116,21 @@ When you create a new version of a key, you'll need to update the storage accoun
116116

117117
To change the key used for Azure Storage encryption, call [az storage account update](/cli/azure/storage/account#az-storage-account-update) as shown in [Configure encryption with customer-managed keys](#configure-encryption-with-customer-managed-keys) and provide the new key name and version. If the new key is in a different key vault, also update the key vault URI.
118118

119+
## Revoke customer-managed keys
120+
121+
If you believe that a key may have been compromised, you can revoke customer-managed keys by removing the key vault access policy. To revoke a customer-managed key, call the [az keyvault delete-policy](/cli/azure/keyvault#az-keyvault-delete-policy) command, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
122+
123+
```azurecli-interactive
124+
az keyvault delete-policy \
125+
--name <key-vault> \
126+
--object-id $storage_account_principal
127+
```
128+
119129
## Disable customer-managed keys
120130

121-
When you disable customer-managed keys, your storage account is then encrypted with Microsoft-managed keys. To disable customer-managed keys, call [az storage account update](/cli/azure/storage/account#az-storage-account-update) and set the `--encryption-key-source parameter` to `Microsoft.Storage`, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
131+
When you disable customer-managed keys, your storage account is once again encrypted with Microsoft-managed keys. To disable customer-managed keys, call [az storage account update](/cli/azure/storage/account#az-storage-account-update) and set the `--encryption-key-source parameter` to `Microsoft.Storage`, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
122132

123-
```powershell
133+
```azurecli-interactive
124134
az storage account update
125135
--name <storage-account> \
126136
--resource-group <resource_group> \

articles/storage/common/storage-encryption-keys-portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ To change the key used for Azure Storage encryption, follow these steps:
9090

9191
## Disable customer-managed keys
9292

93-
When you disable customer-managed keys, your storage account is then encrypted with Microsoft-managed keys. To disable customer-managed keys, follow these steps:
93+
When you disable customer-managed keys, your storage account is once again encrypted with Microsoft-managed keys. To disable customer-managed keys, follow these steps:
9494

9595
1. Navigate to your storage account and display the **Encryption** settings.
9696
1. Deselect the checkbox next to the **Use your own key** setting.

articles/storage/common/storage-encryption-keys-powershell.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: tamram
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 01/03/2019
10+
ms.date: 03/10/2020
1111
ms.author: tamram
1212
ms.reviewer: cbrooks
1313
ms.subservice: common
@@ -93,9 +93,18 @@ When you create a new version of a key, you'll need to update the storage accoun
9393

9494
To change the key used for Azure Storage encryption, call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) as shown in [Configure encryption with customer-managed keys](#configure-encryption-with-customer-managed-keys) and provide the new key name and version. If the new key is in a different key vault, also update the key vault URI.
9595

96+
## Revoke customer-managed keys
97+
98+
If you believe that a key may have been compromised, you can revoke customer-managed keys by removing the key vault access policy. To revoke a customer-managed key, call the [Remove-AzKeyVaultAccessPolicy](/powershell/module/az.keyvault/remove-azkeyvaultaccesspolicy) command, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
99+
100+
```powershell
101+
Remove-AzKeyVaultAccessPolicy -VaultName $keyVault.VaultName `
102+
-ObjectId $storageAccount.Identity.PrincipalId `
103+
```
104+
96105
## Disable customer-managed keys
97106

98-
When you disable customer-managed keys, your storage account is then encrypted with Microsoft-managed keys. To disable customer-managed keys, call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) with the `-StorageEncryption` option, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
107+
When you disable customer-managed keys, your storage account is once again encrypted with Microsoft-managed keys. To disable customer-managed keys, call [Set-AzStorageAccount](/powershell/module/az.storage/set-azstorageaccount) with the `-StorageEncryption` option, as shown in the following example. Remember to replace the placeholder values in brackets with your own values and to use the variables defined in the previous examples.
99108

100109
```powershell
101110
Set-AzStorageAccount -ResourceGroupName $storageAccount.ResourceGroupName `

articles/storage/common/storage-service-encryption.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: storage
55
author: tamram
66

77
ms.service: storage
8-
ms.date: 02/05/2020
8+
ms.date: 03/09/2020
99
ms.topic: conceptual
1010
ms.author: tamram
1111
ms.reviewer: cbrooks
@@ -61,7 +61,7 @@ By default, your storage account uses Microsoft-managed encryption keys. You can
6161

6262
## Customer-managed keys with Azure Key Vault
6363

64-
You can manage Azure Storage encryption at the level of the storage account with your own keys. When you specify a customer-managed key at the level of the storage account, that key is used to protect and control access the root encryption key for the storage account which in turn is used to encrypt and decrypt all blob and file data. Customer-managed keys offer greater flexibility to create, rotate, disable, and revoke access controls. You can also audit the encryption keys used to protect your data.
64+
You can manage Azure Storage encryption at the level of the storage account with your own keys. When you specify a customer-managed key at the level of the storage account, that key is used to protect and control access to the root encryption key for the storage account which in turn is used to encrypt and decrypt all blob and file data. Customer-managed keys offer greater flexibility to manage access controls. You can also audit the encryption keys used to protect your data.
6565

6666
You must use Azure Key Vault to store your customer-managed keys. You can either create your own keys and store them in a key vault, or you can use the Azure Key Vault APIs to generate keys. The storage account and the key vault must be in the same region and in the same Azure Active Directory (Azure AD) tenant, but they can be in different subscriptions. For more information about Azure Key Vault, see [What is Azure Key Vault?](../../key-vault/key-vault-overview.md).
6767

@@ -98,7 +98,7 @@ To learn how to use customer-managed keys with Azure Key Vault for Azure Storage
9898

9999
To enable customer-managed keys on a storage account, you must use an Azure Key Vault to store your keys. You must enable both the **Soft Delete** and **Do Not Purge** properties on the key vault.
100100

101-
Only RSA keys of size 2048 are supported with Azure Storage encryption. For more information about keys, see **Key Vault keys** in [About Azure Key Vault keys, secrets and certificates](../../key-vault/about-keys-secrets-and-certificates.md#key-vault-keys).
101+
Only RSA keys are supported with Azure Storage encryption. For more information about keys, see **Key Vault keys** in [About Azure Key Vault keys, secrets and certificates](../../key-vault/about-keys-secrets-and-certificates.md#key-vault-keys).
102102

103103
### Rotate customer-managed keys
104104

@@ -108,7 +108,31 @@ Rotating the key does not trigger re-encryption of data in the storage account.
108108

109109
### Revoke access to customer-managed keys
110110

111-
To revoke access to customer-managed keys, use PowerShell or Azure CLI. For more information, see [Azure Key Vault PowerShell](/powershell/module/az.keyvault//) or [Azure Key Vault CLI](/cli/azure/keyvault). Revoking access effectively blocks access to all data in the storage account, as the encryption key is inaccessible by Azure Storage.
111+
You can revoke the storage account's access to the customer-managed key at any time. After access to customer-managed keys is revoked, or after the key has been disabled or deleted, clients cannot call operations that read from or write to a blob or its metadata. Attempts to call any of the following operations will fail with error code 403 (Forbidden) for all users:
112+
113+
- [List Blobs](/rest/api/storageservices/list-blobs), when called with the `include=metadata` parameter on the request URI
114+
- [Get Blob](/rest/api/storageservices/get-blob)
115+
- [Get Blob Properties](/rest/api/storageservices/get-blob-properties)
116+
- [Get Blob Metadata](/rest/api/storageservices/get-blob-metadata)
117+
- [Set Blob Metadata](/rest/api/storageservices/set-blob-metadata)
118+
- [Snapshot Blob](/rest/api/storageservices/snapshot-blob), when called with the `x-ms-meta-name` request header
119+
- [Copy Blob](/rest/api/storageservices/copy-blob)
120+
- [Copy Blob From URL](/rest/api/storageservices/copy-blob-from-url)
121+
- [Set Blob Tier](/rest/api/storageservices/set-blob-tier)
122+
- [Put Block](/rest/api/storageservices/put-block)
123+
- [Put Block From URL](/rest/api/storageservices/put-block-from-url)
124+
- [Append Block](/rest/api/storageservices/append-block)
125+
- [Append Block From URL](/rest/api/storageservices/append-block-from-url)
126+
- [Put Blob](/rest/api/storageservices/put-blob)
127+
- [Put Page](/rest/api/storageservices/put-page)
128+
- [Put Page From URL](/rest/api/storageservices/put-page-from-url)
129+
- [Incremental Copy Blob](/rest/api/storageservices/incremental-copy-blob)
130+
131+
To call these operations again, restore access to the customer-managed key.
132+
133+
All data operations that are not listed in this section may proceed after customer-managed keys are revoked or a key is disabled or deleted.
134+
135+
To revoke access to customer-managed keys, use [PowerShell](storage-encryption-keys-powershell.md#revoke-customer-managed-keys) or [Azure CLI](storage-encryption-keys-cli.md#revoke-customer-managed-keys).
112136

113137
### Customer-managed keys for Azure managed disks (preview)
114138

@@ -118,11 +142,11 @@ Customer-managed keys are also available for managing encryption of Azure manage
118142

119143
Clients making requests against Azure Blob storage have the option to provide an encryption key on an individual request. Including the encryption key on the request provides granular control over encryption settings for Blob storage operations. Customer-provided keys (preview) can be stored in Azure Key Vault or in another key store.
120144

121-
For an example that shows how to specify a customer-provided key on a request to Blob storage, see [Specify a customer-provided key on a request to Blob storage with .NET](../blobs/storage-blob-customer-provided-key.md).
145+
For an example that shows how to specify a customer-provided key on a request to Blob storage, see [Specify a customer-provided key on a request to Blob storage with .NET](../blobs/storage-blob-customer-provided-key.md).
122146

123147
### Encrypting read and write operations
124148

125-
When a client application provides an encryption key on the request, Azure Storage performs encryption and decryption transparently while reading and writing blob data. Azure Storage writes an SHA-256 hash of the encryption key alongside the blob's contents. The hash is used to verify that all subsequent operations against the blob use the same encryption key.
149+
When a client application provides an encryption key on the request, Azure Storage performs encryption and decryption transparently while reading and writing blob data. Azure Storage writes an SHA-256 hash of the encryption key alongside the blob's contents. The hash is used to verify that all subsequent operations against the blob use the same encryption key.
126150

127151
Azure Storage does not store or manage the encryption key that the client sends with the request. The key is securely discarded as soon as the encryption or decryption process is complete.
128152

0 commit comments

Comments
 (0)