Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Adding Secrets to Already Encrypted Secrets File #1138

Open
cdunford opened this issue Mar 9, 2020 · 3 comments
Open

Question: Adding Secrets to Already Encrypted Secrets File #1138

cdunford opened this issue Mar 9, 2020 · 3 comments
Labels

Comments

@cdunford
Copy link
Contributor

cdunford commented Mar 9, 2020

I have a use case where it would be ideal if there was some way to add new secrets to an existing secrets file that is encrypted. I know this is possible by decrypting the file then adding and then re-encrypting, but I am using Azure Keyvault and many folks who may need to have access to add new secret values will not have access to use the key in the vault to decrypt, so they cannot decrypt and re-encrypt all of the secrets.

Is this somehow possible today?

@mumoshu
Copy link
Collaborator

mumoshu commented Mar 29, 2020

@cdunford I think the only possible way would be to split the secrets file into two, one with the key that only admins have access to, and another with the key everyone has access to.

Not sure if this works with helm-secrets, but I remember that sops - the tool used by helm-secrets under the hood to enc/dec secrets - had the ability to use a dedicated key for each encrypted secrets file. So hopefully it just work.

Another way would be to enhance vals. It's the secrets manager embedded in Helmfile to turn any yaml values formatted like ref+<provider name>://id/of/the/secret/you/want/to/load into actual secrets values.

This way, you don't need to re-encrypt the secrets file to add/remove a single secret.

It doesn't support Azure KeyVault or a kind of secrets manager in Azure yet https://github.com/variantdev/vals#suported-backends so hopefully you could submit a pull request OR help me to implement/test the Azure provider for vals to support your usecase.

@cdunford
Copy link
Contributor Author

I am using the multiple secrets files approach currently and it works fine. My use case doesn't actually involve different keys. It's the same key for all secrets, it's just no one has access to use the key in the vault to decrypt, they can just use it to encrypt.

I wasn't aware of the other means to load secrets directly from the values. Is that documented somewhere (maybe I just missed it)?

@mumoshu
Copy link
Collaborator

mumoshu commented Mar 29, 2020

@cdunford It's available since #906 but it isn't documented yet.

it's just no one has access to use the key in the vault to decrypt, they can just use it to encrypt.

Well then, I guess the only way would be to never decrypt/re-encrypt it. In other words, create a new secret file for each newly added secret value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants