Skip to content

Commit c71b846

Browse files
authored
Add key rotation procedures and better organize sections
1 parent 68c1823 commit c71b846

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

docs/cloud/security/cmek.md

+31-27
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import cmek_performance from '@site/static/images/_snippets/cmek-performance.png
1111

1212
<EnterprisePlanFeatureBadge feature="Enhanced Encryption" support="true"/>
1313

14-
Data at rest is encrypted by default using cloud provider-managed AES 256 keys. Customers may enable Transparent Data Encryption (TDE) to provide an additional layer of protection for service data. Additionally, customers may supply their own key to implement Customer Managed Encryption Keys (CMEK) for their service.
14+
Data at rest is encrypted by default using cloud provider-managed AES 256 keys. Customers may enable Transparent Data Encryption (TDE) to provide an additional layer of protection for service data or supply their own key to implement Customer Managed Encryption Keys (CMEK) for their service.
1515

1616
Enhanced encryption is currently available in AWS and GCP services. Azure is coming soon.
1717

@@ -21,51 +21,55 @@ TDE must be enabled on service creation. Existing services cannot be encrypted a
2121

2222
1. Select `Create new service`
2323
2. Name the service
24-
3. Select AWS as the cloud provider and the desired region from the drop-down
24+
3. Select AWS or GCP as the cloud provider and the desired region from the drop-down
2525
4. Click the drop-down for Enterprise features and toggle Enable Transparent Data Encryption (TDE)
2626
5. Click Create service
2727

2828
## Customer Managed Encryption Keys (CMEK) {#customer-managed-encryption-keys-cmek}
2929

3030
:::warning
31-
Deleting a KMS key used to encrypt a ClickHouse Cloud service will cause your ClickHouse service to be stopped and its data will be unretrievable, along with existing backups.
31+
Deleting a KMS key used to encrypt a ClickHouse Cloud service will cause your ClickHouse service to be stopped and its data will be unretrievable, along with existing backups. To prevent accidental data loss when rotating keys you may wish to maintain old KMS keys for a period of time prior to deletion.
3232
:::
3333

34-
Once a service is encrypted with TDE, customers may update the key to enable CMEK. The service will automatically restart after updating the Transparent Data Encryption setting. During this process, the old KMS key decrypts the data encrypting key (DEK), and the new KMS key re-encrypts the DEK. This ensures that the service on restart will use the new KMS key for encryption operations moving forward. This process may take several minutes.
35-
36-
### CMEK with AWS KMS {#cmek-with-aws-kms}
34+
Once a service is encrypted with TDE, customers may update the key to enable CMEK. The service will automatically restart after updating the TDE setting. During this process, the old KMS key decrypts the data encrypting key (DEK), and the new KMS key re-encrypts the DEK. This ensures that the service on restart will use the new KMS key for encryption operations moving forward. This process may take several minutes.
3735

36+
<details>
37+
<summary>Enable CMEK with AWS KMS</summary>
38+
3839
1. In ClickHouse Cloud, select the encrypted service
3940
2. Click on the Settings on the left
4041
3. At the bottom of the screen, expand the Network security information
4142
4. Copy the Encryption role ID (AWS) or Encryption Service Account (GCP) - you will need this in a future step
4243
5. [Create a KMS key for AWS](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)
4344
6. Click the key
4445
7. Update the AWS key policy as follows:
45-
46+
4647
```json
4748
{
4849
"Sid": "Allow ClickHouse Access",
49-
"Effect": "Allow",
50-
"Principal": {
51-
"AWS": "{ Encryption role ID }"
52-
},
53-
"Action": [
54-
"kms:Encrypt",
55-
"kms:Decrypt",
56-
"kms:ReEncrypt",
57-
"kms:DescribeKey"
58-
],
59-
"Resource": "*"
50+
"Effect": "Allow",
51+
"Principal": {
52+
"AWS": "{ Encryption role ID }"
53+
},
54+
"Action": [
55+
"kms:Encrypt",
56+
"kms:Decrypt",
57+
"kms:ReEncrypt",
58+
"kms:DescribeKey"
59+
],
60+
"Resource": "*"
6061
}
6162
```
62-
63+
6364
10. Save the Key policy
6465
11. Copy the Key ARN
6566
12. Return to ClickHouse Cloud and paste the Key ARN in the Transparent Data Encryption section of the Service Settings
6667
13. Save the change
68+
69+
</details>
6770

68-
### CMEK with GCP KMS {#cmek-with-gcp-kms}
71+
<details>
72+
<summary>Enable CMEK with GCP KMS</summary>
6973

7074
1. In ClickHouse Cloud, select the encrypted service
7175
2. Click on the Settings on the left
@@ -80,21 +84,21 @@ Once a service is encrypted with TDE, customers may update the key to enable CME
8084
11. Copy the Key Resource Path
8185
12. Return to ClickHouse Cloud and paste the Key Resource Path in the Transparent Data Encryption section of the Service Settings
8286
13. Save the change
87+
88+
</details>
89+
90+
## Key Rotation {#key-rotation}
91+
92+
Once you set up CMEK, rotate the key by following the procedures above for creating a new KMS key and granting permissions. Return to the service settings to paste the new ARN (AWS) or Key Resource Path (GCP) and save the settings. The service will restart to apply the new key.
8393

8494
## Backup and Restore {#backup-and-restore}
8595

86-
Backups are encrypted using the same key as the associated service. When you restore an encrypted backup, it creates an encrypted instance that uses the same KMS key as the original instance. If needed, you can rotate the KMS key; see [Key Rotation](#key-rotation) for more details.
96+
Backups are encrypted using the same key as the associated service. When you restore an encrypted backup, it creates an encrypted instance that uses the same KMS key as the original instance. If needed, you can rotate the KMS key after restoration; see [Key Rotation](#key-rotation) for more details.
8797

8898
## KMS Key Poller {#kms-key-poller}
8999

90100
When using CMEK, the validity of the provided KMS key is checked every 10 minutes. If access to the KMS key is invalid, the ClickHouse service will stop. To resume service, restore access to the KMS key by following the steps in this guide, and then restart the service.
91101

92-
Due to the nature of this feature, it's not possible to recover a ClickHouse Cloud service after the KMS key has been deleted. To prevent this, most providers don't remove the key immediately and instead schedule it for deletion, please check your provider documentation.
93-
94-
## Key Rotation {#key-rotation}
95-
96-
Due to the nature of this feature, it is not possible to recover a ClickHouse Cloud service if the KMS key has been deleted. To prevent accidental loss, most providers schedule key deletion rather than removing it immediately. For more details, refer to your provider’s documentation.
97-
98102
## Performance {#performance}
99103

100104
As specified in this page, we use ClickHouse's built-in [Virtual File System for Data Encryption feature](/operations/storing-data#encrypted-virtual-file-system) to encrypt and protect your data.

0 commit comments

Comments
 (0)