feat: Add offline Azure Key Vault encryption support#2113
feat: Add offline Azure Key Vault encryption support#2113rkthtrifork wants to merge 1 commit intogetsops:mainfrom
Conversation
Signed-off-by: rkthtrifork <rkth@trifork.com>
|
Thanks for your contribution! I don't think this is a good fit for the SOPS "core" codebase, which is already way too big (and this seems to be another big chunk that also does more explicit cryptography then I think we should be doing), but I think this would be great to have as a plugin. Unfortunately there's no plugin infrastructure yet, see #2016. |
That makes sense, I'll follow that proposal :) Would you prefer I delete this PR to avoid bloating the repo or put the PR in draft or something? |
Summary
This adds support for encrypting SOPS data keys for Azure Key Vault without network access.
When an Azure Key Vault public key is provided locally, SOPS now:
Decryption still goes through Azure Key Vault using the corresponding private key.
Existing Azure Key Vault behavior remains unchanged when no local public key is configured.
Configuration
The existing
azure_keyvaultURL form is still supported unchanged:Offline encryption is enabled through the structured form by adding
publicKeyFile:Notes:
versionmust be set whenpublicKeyFileis used, since SOPS cannot resolve the latest key version offline.publicKeyFilepaths are resolved relative to the config file.Implementation details
azkvusing a locally supplied RSA public keyTests
Added coverage for:
publicKeyFileValidated with:
go test ./azkv ./config ./stores ./keyservice ./cmd/sops/...Not tested in practice. I would like to know if you are interested in this before i spend any more time on it.