feat: Add Tencent Cloud KMS Support #2032
Open
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.
Add Tencent Cloud KMS Support
Summary
This PR adds support for encrypting and decrypting SOPS files using Tencent Cloud KMS, similar to existing AWS KMS, GCP KMS, Azure Key Vault, and HuaweiCloud KMS integrations.
Changes
Core Implementation
tencentkmspackage implementingMasterKeyinterface for Tencent Cloud KMSgithub.com/tencentcloud/tencentcloud-sdk-go)CLI Integration
--tencent-kmsflag for encrypt and edit commands--add-tencent-kmsand--rm-tencent-kmsflags for rotate commandSOPS_TENCENT_KMS_IDSenvironment variableConfiguration Support
.sops.yamlconfiguration fileskey-uuid(e.g.,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)gRPC Keyservice Integration
TencentKmsKeymessage to protobuf definitionsStorage Format
tencent_kmskey serialization in stores packageUsage
Set credentials:
Encrypt a file:
Edit encrypted file:
Rotate keys:
Configuration File Example
Authentication
Tencent Cloud credentials can be provided via environment variables:
TENCENTCLOUD_SECRET_IDTENCENTCLOUD_SECRET_KEYTENCENTCLOUD_TOKENTENCENTCLOUD_REGIONap-guangzhou)TENCENTCLOUD_KMS_ENDPOINTkms.internal.tencentcloudapi.comfor CVM/TKE environments)Testing
make checkdocs)Implementation Notes