You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tidb-cloud: add CMEK documentation for Google Cloud - #24792
Add a new page tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md and link it in TOC-tidb-cloud.md under Data Access Control.
The page documents how to encrypt TiDB Cloud Dedicated data with a customer-managed key in Google Cloud KMS:
Select the Dedicated key scope and add the CMEK configuration under Organization Settings > CMEK.
Copy the full key name returned by the console, which is the name prefix plus the TiDB Cloud-generated suffix.
Create the key ring and a symmetric key in Cloud KMS, in the region selected in the console.
Grant roles/cloudkms.cryptoKeyEncrypterDecrypter to both service agents: Compute Engine (cluster disks) and Cloud Storage (backups). Both grants are required.
Paste the Cloud KMS key resource name and verify the configuration.
Rotate, revoke, and restore CMEK access.
Which TiDB version(s) do your changes apply to? (Required)
master (the latest development version)
What is the related PR or file link(s)?
Related code change PR links (if applicable): N/A
This PR is translated from: N/A
Other reference link(s): N/A
AI agent involvement
The changes in this PR were primarily made by an AI agent on behalf of the PR author.
Do your changes match any of the following descriptions?
Delete files
Change aliases
Need modification after applied to another branch
Might cause conflicts after applied to another branch
Notes for reviewers
The existing AWS and Azure CMEK pages still describe the previous project-level flow (Project Settings > Encryption Access). This new page follows the current organization-level flow (Organization Settings > CMEK). Aligning the other two pages can be handled in a follow-up PR.
This first version is text-only and does not include console screenshots.
Summary by CodeRabbit
Documentation
Added a Google Cloud guide for configuring customer-managed encryption keys (CMEK) for TiDB Cloud Dedicated cluster data and backups.
The guide covers project and region requirements, key setup, required service-agent permissions, key selection and rotation, and how to revoke or restore access.
It clarifies that clusters with changefeeds or PITR enabled must have those features removed or disabled before they can be paused, and that running VM disks may remain accessible until shutdown.
It explains that key-dependent operations fail after affected clusters are paused until key versions and required permissions are restored.
Added a link to the guide in the TiDB Cloud table of contents.
Add a page describing how to encrypt TiDB Cloud Dedicated data with a customer-managed key in Google Cloud KMS, covering key scope selection, service agent authorization, key resource name configuration, and revocation.
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign csuzhangxc for approval. For more information see the Code Review Process. Please ensure that each of them provides their approval before proceeding.
The full list of commands accepted by this bot can be found here.
Details
Needs approval from an approver in each of these files:
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
The TiDB Cloud documentation adds a Google Cloud guide for using customer-managed encryption keys (CMEK) with Dedicated clusters and backups. The table of contents links to the guide.
Changes: Google Cloud CMEK documentation
Layer / File(s)
Summary
Project and key setup tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md, TOC-tidb-cloud.md
The guide describes CMEK restrictions, project configuration, and regional Cloud KMS key creation. The table of contents links to the guide.
Permissions and cluster use tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md
The guide describes the required service-agent permissions, key verification, and key matching for cluster creation.
The guide covers automatic key rotation, revocation conditions, and restoration of access and disabled key versions. It also documents restrictions on pausing clusters and disk access until shutdown.
The new Google Cloud CMEK guide's revocation and restore sections are incomplete. Readers may believe access is revoked while other grants still allow decryption, or while a change is still propagating. After restoring access they may be left without point-in-time restore and without changefeeds. These are small documentation fixes that should be made before merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: a new CMEK documentation page for Google Cloud in TiDB Cloud. It matches the changeset, which adds tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md and a TOC link. The title …
Description check
The description covers the required sections of the template: what changed, the TiDB version selection (master), related PR or file links, and AI agent involvement. The first-time contributor checklis…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: a new CMEK documentation page for Google Cloud in TiDB Cloud. It matches the changeset, which adds tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md and a TOC link. The title is short, specific, and in the repository's expected format.
Full details: Description check
Explanation
The description covers the required sections of the template: what changed, the TiDB version selection (master), related PR or file links, and AI agent involvement. The first-time contributor checklist and the Contributor License Agreement item are not addressed, and the template's 'Do your changes match' checklist is filled in. The required 'What is changed' section is detailed and accurate. Missing items are minor, so the check passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between aff3f03 and 6182804.
Files selected for processing: 2
TOC-tidb-cloud.md
tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Specify the Google Cloud project in the gcloud commands, revoke access to all key versions, and limit the pause and resume steps to clusters that use the affected regional key.
Reviewing files that changed from the base of the PR and between 6182804 and 52c33c1.
Files selected for processing: 1
tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Note inherited key ring and project level grants, add the pause prerequisites for clusters with PITR or changefeeds, and explain when attached disks become inaccessible.
Reviewing files that changed from the base of the PR and between 52c33c1 and c5e7f63.
Files selected for processing: 1
tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
> Step 2 pauses the affected clusters. You cannot pause a cluster that has [changefeeds](/tidb-cloud/changefeed-overview.md) or [Point-in-Time Restore (PITR)](/tidb-cloud/backup-and-restore.md#turn-on-point-in-time-restore) enabled, so delete the changefeeds or turn off PITR first. For details, see [Limitations](/tidb-cloud/pause-or-resume-tidb-cluster.md#limitations).
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Quick win
Restore the features disabled for the pause.
After restoration, the procedure resumes the clusters but does not restore PITR or the deleted changefeeds. PITR and replication therefore remain disabled. Ask readers to record the affected settings before revocation and restore them after the clusters resume. (raw.githubusercontent.com)
> Removing the key-level role bindings revokes access to all versions of the key at once, provided that neither service agent also holds a decrypt-capable role granted at the key ring or project level. If such an inherited grant exists, remove it at that level as well. Alternatively, disable every enabled version of the key, not only the current one. Data and backups written before a rotation are still protected by the earlier versions, so disabling only the newest version leaves them decryptable. Record which versions you disable so that you can re-enable them when you restore access.
The reason will be displayed to describe this comment to others. Learn more.
Major · Security & Privacy · Quick win
Check all effective decrypt grants.
A service agent can have another decrypt-capable grant directly on the key or inherit one from a folder or organization. Removing the Step 2 bindings and checking only the key ring and project leaves that access intact. Instruct readers to check and remove all applicable grants, or disable every enabled key version. (docs.cloud.google.com)
Minor · Security & Privacy · Quick win
Revocation takes time to become effective.
Disabling a key version and removing a role binding are both eventually consistent. A disabled key version can stay usable for up to 1 minute, and in exceptional cases for several hours. A removed IAM role binding can take about 2 minutes, and 7 minutes or longer in some cases. Pausing the clusters in Step 2 does not confirm that the change has taken effect. Wait for the change to take effect before you treat access as revoked.
Suggested note
--- "a/tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md"+++ "b/tidb-cloud/tidb-cloud-encrypt-cmek-gcp.md"@@ -183,7 +183,9 @@
> **Note:**
>
> Removing the key-level role bindings revokes access to all versions of the key at once, provided that neither service agent also holds a decrypt-capable role granted at the key ring or project level. If such an inherited grant exists, remove it at that level as well. Alternatively, disable every enabled version of the key, not only the current one. Data and backups written before a rotation are still protected by the earlier versions, so disabling only the newest version leaves them decryptable. Record which versions you disable so that you can re-enable them when you restore access.
+ >+ > Disabling a key version and removing a role binding are eventually consistent changes. A disabled key version typically stops working within 1 minute, but can remain usable for several hours in exceptional cases. A removed role binding typically takes effect within 2 minutes, and can take 7 minutes or longer. Pausing the clusters in Step 2 does not confirm that the change has taken effect. Wait for the change to take effect before you treat access as revoked.
2. In the TiDB Cloud console, pause the clusters that use this key, that is, the clusters in the region of the key. Clusters in other regions use their own regional keys and are not affected.
Committable suggestion
IMPORTANT
Review the replacement and indentation, then test before committing.
Suggested change
> Removing the key-level role bindings revokes access to all versions of the key at once, provided that neither service agent also holds a decrypt-capable role granted at the key ring or project level. If such an inherited grant exists, remove it at that level as well. Alternatively, disable every enabled version of the key, not only the current one. Data and backups written before a rotation are still protected by the earlier versions, so disabling only the newest version leaves them decryptable. Record which versions you disable so that you can re-enable them when you restore access.
> Removing the key-level role bindings revokes access to all versions of the key at once, provided that neither service agent also holds a decrypt-capable role granted at the key ring or project level. If such an inherited grant exists, remove it at that level as well. Alternatively, disable every enabled version of the key, not only the current one. Data and backups written before a rotation are still protected by the earlier versions, so disabling only the newest version leaves them decryptable. Record which versions you disable so that you can re-enable them when you restore access.
>
> Disabling a key version and removing a role binding are eventually consistent changes. A disabled key version typically stops working within 1 minute, but can remain usable for several hours in exceptional cases. A removed role binding typically takes effect within 2 minutes, and can take 7 minutes or longer. Pausing the clusters in Step 2 does not confirm that the change has taken effect. Wait for the change to take effect before you treat access as revoked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changed, added, or deleted? (Required)
Add a new page
tidb-cloud/tidb-cloud-encrypt-cmek-gcp.mdand link it inTOC-tidb-cloud.mdunder Data Access Control.The page documents how to encrypt TiDB Cloud Dedicated data with a customer-managed key in Google Cloud KMS:
roles/cloudkms.cryptoKeyEncrypterDecrypterto both service agents: Compute Engine (cluster disks) and Cloud Storage (backups). Both grants are required.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Notes for reviewers
Summary by CodeRabbit