feat: Add Tencent Cloud KMS Support#2032
Conversation
b264bff to
4cdbc7e
Compare
|
Hi maintainers — this PR is now ready for review. |
|
Hi maintainers, this PR is ready. |
|
Hi maintainers — I’ve resolved the merge conflict in Could someone please re-approve the pending workflows (if needed) and review the PR when you have a moment? Thanks! |
Add support for Tencent Cloud Key Management Service (KMS) as a new encryption provider for SOPS. This implementation follows the same pattern as existing cloud KMS integrations. Features: - Encrypt/decrypt SOPS data keys using Tencent Cloud KMS - CLI flags: --tencent-kms, --add-tencent-kms, --rm-tencent-kms - Environment variable: SOPS_TENCENT_KMS_IDS - Configuration file support: tencent_kms key in .sops.yaml - Optional STS token support via TENCENTCLOUD_TOKEN - Customizable endpoint for CVM/TKE internal networks Authentication via environment variables: - TENCENTCLOUD_SECRET_ID (required) - TENCENTCLOUD_SECRET_KEY (required) - TENCENTCLOUD_TOKEN (optional, for STS) - TENCENTCLOUD_REGION (optional, default: ap-guangzhou) - TENCENTCLOUD_KMS_ENDPOINT (optional) Signed-off-by: frank <frankstarye@tencent.com>
- Add usage guide in README.rst - Add CHANGELOG entry - Include internal endpoint hint for CVM/TKE environments Signed-off-by: frank <frankstarye@tencent.com>
Signed-off-by: frank <frankstarye@tencent.com>
Signed-off-by: frank <frankstarye@tencent.com>
|
Hi maintainers — I think the main question at this point is which Tencent KMS PR you want to move forward with. PR #2032 is maintained by the Tencent Cloud KMS team and is intended to be the main Tencent KMS contribution going forward. Since HuaweiCloud KMS was merged in #2001, an in-tree KMS backend seems acceptable in principle. For Tencent KMS specifically, could you please clarify whether #2032 should be treated as the primary PR, and whether #1984 should be considered superseded? Compared with #1984, this PR is rebased, mergeable, includes README/CHANGELOG updates, keyservice integration, and tests for the Tencent KMS implementation. If #2032 is the preferred PR to continue with, could someone with write access please:
Thanks. |
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