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

AGE and Google KMS edge case #1418

Open
Triskae opened this issue Jan 22, 2024 · 3 comments
Open

AGE and Google KMS edge case #1418

Triskae opened this issue Jan 22, 2024 · 3 comments

Comments

@Triskae
Copy link

Triskae commented Jan 22, 2024

Hello,
I think I've found an edge case. On my computer I'm working on several projects, and all of them use sops.
The problem is that not all store their keys in the same place. Some of them use AGE, others use GCP KMS.

But if I try to encrypt saying with AGE using --age param, but having SOPS_GCP_KMS_IDS env variable set, the encrypted file seems to encrypt with both keys in some way. If I look inside the encrypted file I can see that age and gcp_kms have a value.

Do you guys have the same behaviour ?
Specifying the type of encryption explicitly on the command line should override the encryption specified in the environment variable right ?
Thanks !

@Triskae
Copy link
Author

Triskae commented Feb 2, 2024

Hello,
Any news guys ? Tell me if I need to clarify something

@mrgleeco
Copy link

mrgleeco commented Feb 6, 2024

i'm interested in this issue. However as written, it is not well understood what you are doing and experiencing. Consider rewriting this with exhibits and exact steps so that others can reproduce it. Thanks in advance!

@Triskae
Copy link
Author

Triskae commented Feb 6, 2024

Hello, thanks for your answser, so let me explain a little bit more:

  • I work for a company that uses GCP KMS with SOPS to encrypt secrets, I have SOPS_GCP_KMS_IDS in my environement variables in order to make things work with SOPS.
  • I'm also a freelance, and I work for another company, and using the same machine. For this other company I'm don't using GCP KMS, I use age. I use the SOPS_AGE_KEY_FILE environment variable to make things work.

So the problem is when I try to encrypt, with age, when I open the encrypted file, I can see that the original file was encrypted with GCP KMS and Age. I can see that thanks to the age and gcp_kms array not being empty.

So the question is: Is there any way to prevent sops using both AGE and GCP KMS, any flag or something like that to disable this behaviour.

I hope it's a little bit clearer.

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

No branches or pull requests

2 participants