feat(stackitkms): Add STACKIT KMS support#2094
Conversation
9705d53 to
22efee4
Compare
|
Hi @felixfontein I know there is lack of time and plan do create some kind of plugin system in the future, but I really love SOPS and used it before with GCP KMS, so it would be great to see official STACKIT KMS support as well as they work in a similar way (I use it already with my build). |
aad57d1 to
a333f28
Compare
|
I don't think there's much you can do right now, unless you can convince another of the maintainers that they'll review this. I think the best way forward for this (and all the other PRs that want to add other KMSes) is #2016. |
sabre1041
left a comment
There was a problem hiding this comment.
Looking good. A few comments based on the initial review
Add encryption/decryption support using STACKIT KMS (Key Management Service). This follows the same pattern as existing KMS providers (AWS, GCP, Azure, HuaweiCloud). New files: - stackitkms/keysource.go: MasterKey implementation using STACKIT SDK - stackitkms/keysource_test.go: Unit tests - keyservice/stackitkms.go: StackitKmsKey protobuf-compatible types Modified files: - cmd/sops/main.go: --stackit-kms, --add-stackit-kms, --rm-stackit-kms flags - config/config.go: stackit_kms support in .sops.yaml - keyservice/keyservice.proto: StackitKmsKey message - keyservice/keyservice.go: KeyFromMasterKey conversion - keyservice/server.go: encrypt/decrypt handlers - stores/stores.go: serialization in encrypted file metadata - go.mod: STACKIT SDK dependency Key format: projects/<projectId>/regions/<regionId>/keyRings/<keyRingId>/keys/<keyId>/versions/<versionNumber> Signed-off-by: Stanislav Kopp <stanislav.kopp@digits.schwarz>
a333f28 to
f8a4931
Compare
|
Hi @sabre1041, thank you for looking into PR, the comments should be resolved now. |
Add STACKIT KMS Support
Summary
This PR adds support for encrypting and decrypting SOPS files using STACKIT KMS, similar to existing AWS KMS, GCP KMS, Azure Key Vault, and HuaweiCloud KMS integrations.
Changes
Core Implementation
stackitkmspackage implementingMasterKeyinterface for STACKIT KMSservices/kmsv1.3.2,corev0.22.0)CLI Integration
--stackit-kmsflag forencryptandeditcommands--add-stackit-kmsand--rm-stackit-kmsflags forrotatecommandSOPS_STACKIT_KMS_IDSenvironment variableConfiguration Support
.sops.yamlconfiguration filesprojects/<projectId>/regions/<regionId>/keyRings/<keyRingId>/keys/<keyId>/versions/<versionNumber>gRPC Keyservice Integration
StackitKmsKeymessage to protobuf definitionsStorage Format
stackit_kmskey serialization instorespackageUsage
Configuration File Example
Authentication
STACKIT credentials are resolved automatically by the SDK in the following order:
STACKIT_FEDERATED_TOKEN_FILE,STACKIT_SERVICE_ACCOUNT_EMAILSTACKIT_SERVICE_ACCOUNT_KEY_PATH,STACKIT_PRIVATE_KEY_PATHSTACKIT_SERVICE_ACCOUNT_TOKEN~/.stackit/credentials.jsonTesting
Implementation Notes
symmetric_encrypt_decryptpurpose withaes_256_gcmalgorithm