-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security: Encrypt region boundary keys, Part 4 - KMS #3141
Conversation
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
@Yisaer: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/prow-config repository. |
@Yisaer: adding 'status/can-merge' to this PR must have 2 LGTMs In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/prow-config repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
@Yisaer: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/prow-config repository. |
Can merge label has been added. Git tree hash: 7480d5d
|
/merge |
@yiwu-arbug: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/prow-config repository. |
@yiwu-arbug: you cannot merge your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/prow-config repository. |
/run-integration-ddl-test |
/merge |
@HunDunDM: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/prow-config repository. |
/run-integration-lightning-test |
What problem does this PR solve?
This is part 4 for adding TDE support to PD. pingcap/tidb#18262 This PR supports AWS KMS as master key.
What is changed and how it works?
The previous PR in the series support storing master key as a file. This is only suitable for testing. For production this is insecure. This PR supports using AWS KMS as master key. KMS is a service holds an encryption key (called a CMK), and provide API to encrypt and decrypt data using the encryption key, without exposing the key itself. We only use two of its interfaces:
GenerateDataKey()
generates an encryption key from the CMK, returning both the plaintext key, and the key after encrypted by the CMK (the ciphertext key).Decrypt()
can then used to decrypt the ciphertext key. We could use the KMS data key as our data key, but on PD restart we would need to decrypt the data keys one by one, and AWS KMS doesn't provide a batch API. Instead we use the KMS data key as our master key. So here's another layer of envelope encryption.KMS CMK (hold by KMS, never exposed to us)
↓ encrypts
KMS data key (a.k.a PD master key)
↓ encrypts
PD data key
When PD persist data keys (after key rotation):
GenerateDataKey
to obtain a new KMS data key (plaintext and ciphertext key pair), use it to encrypt the PD data keysWhen PD restart, or is notified of change to the keys through watcher:
Decrypt
to restore plaintext KMS data key from the ciphertext key.This PR only support AWS KMS, but in the future we need to support other KMS services (e.g. GCP KMS). The
vender
field inencryptionpb.MasterKey
is used for forward compatibility - we will fail if the field is not "AWS".Check List
Tests
Related changes
Release note