Storage-level encryption
The buckets that hold table data and backups are encrypted at rest with cloud provider-managed AES-256 keys: S3 server-side encryption on AWS, Google default encryption on GCP, and Azure Storage service-side encryption on Azure. Nothing needs to be configured.Transparent Data Encryption (TDE)
TDE is available on AWS, GCP, and Azure. Each TDE service has its own data encryption key (DEK). ClickHouse encrypts table data with the DEK, usingAES_256_CTR, before writing it to storage (see performance). The DEK is stored only in wrapped form, encrypted by a key encryption key (KEK) in your cloud account. The ClickHouse server unwraps the DEK at startup and keeps it only in memory.
When TDE is turned on for your BYOC infrastructure, ClickHouse creates a default KEK and an identity that can use it, the TDE delegate, in your account:
The ClickHouse server and the ClickHouse management service use the KEK only through the TDE delegate. The KEK itself never leaves your key management service.
TDE encrypts table data and the backups taken from it. Database metadata, such as table definitions, and ClickHouse Keeper state are not covered by TDE.
Enable TDE
- Turn on TDE for your BYOC infrastructure. Contact ClickHouse support. Your onboarding stack must include the TDE permissions: set
include_tde_permissionsin the Terraform module, orIncludeTDEPermissionsin the AWS CloudFormation template. If your infrastructure is already onboarded, update the stack with this setting first. ClickHouse then creates the default KEK and the TDE delegate. - Create the service with TDE. In the ClickHouse Cloud console, open Enterprise features during service creation and turn on Enable Transparent Data Encryption (TDE). With the Cloud API, set
hasTransparentDataEncryptiontotruewhen you create the service.
Customer-managed encryption keys (CMEK)
A new TDE service uses the default KEK of its infrastructure. To use your own key instead:- Create a key in the AWS account, GCP project, or Azure tenant of your BYOC infrastructure. On GCP, use the key itself, not a key version. On Azure, use an RSA key.
- Give the TDE delegate access to the key:
- AWS: add a key policy statement that allows the principal
arn:aws:iam::<account-id>:role/<infra>-<region>-tde-delegatethe actionskms:Encrypt,kms:Decrypt,kms:ReEncrypt*, andkms:DescribeKey. - GCP: grant
<infra>-tde-delegate@<project-id>.iam.gserviceaccount.comthe roles Cloud KMS CryptoKey Encrypter/Decrypter and Cloud KMS Viewer on the key. - Azure: assign the managed identity
<infra>-tde-delegatethe role Key Vault Crypto User on the key.
- AWS: add a key policy statement that allows the principal
- Set the key on the service. In the console, open the service Settings. In the Transparent Data Encryption section, enter the key ARN (AWS), the key resource path (GCP), or the key name, Key Vault URI, and tenant ID (Azure), and save. On AWS and GCP, you can also set
transparentDataEncryptionKeyIdwith the Cloud API.