[Feature] Support Tencent Cloud KMS #1984
Open
+1,290
−205
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.
Feature Background
This PR adds support for Tencent Cloud Key Management Service (KMS) as a new key provider in SOPS. Tencent Cloud KMS is a secure, scalable key management service that helps users manage cryptographic keys, meet compliance requirements, and secure sensitive data .
With this addition, SOPS users can now leverage Tencent Cloud KMS for encrypting and decrypting their secrets alongside existing providers like AWS KMS, GCP KMS, Azure Key Vault, and HashiCorp Vault.
Implementation Details
New Files
Key Components
MasterKey Implementation :
Configuration Support :
Usage Example
below is my test case:
./sops --encrypt --tencent-kms {kms key id} config.yaml > config.enc.yaml ./sops decrypt config.enc.yaml./sops --encrypt --tencent-kms {kms key id1},{kms key id 2} config.yaml > config.enc.yaml ./sops decrypt config.enc.yaml./sops -r -i --rm-tencent-kms {kms key id} config.enc.yaml ./sops -r -i --add-tencent-kms {kms key id} config.enc.yaml./sops encrypt --tencent-kms {kms key id} --kms {aws kms key arn} config.yaml > config.enc.mixed.yaml ./sops --decrypt --kms {aws kms key arn} ./sops --decrypt --tencent-kms {kms key id} config.enc.mixed.yamlset below file content in .sops.yaml
then run below cmd
./sops encrypt config.yaml >config.enc.groups.yaml ./sops decrypt config.enc.groups.yaml ./sops groups add --tencent-kms {new kms key id } -i -f config.enc.groups.yaml ./sops updatekeys -y config.enc.groups.yamlin one shell with Tencent Cloud credential run sops service :
sops keyservice --network unix --address /tmp/sops.sock --verboseanother shell run test cmd:
@felixfontein , Could you pls take a look ? thank you.