feat(stackitkms): Add STACKIT KMS support#2094
Open
xtavras wants to merge 1 commit intogetsops:mainfrom
Open
Conversation
7dc6048 to
9705d53
Compare
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>
9705d53 to
22efee4
Compare
Author
|
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 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