getsops / sops

Simple and flexible tool for managing secrets
https://getsops.io/
Mozilla Public License 2.0
16.13k stars 854 forks source link

AGE and Google KMS edge case #1418

Open Triskae opened 7 months ago

Triskae commented 7 months ago

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 commented 6 months ago

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

mrgleeco commented 6 months ago

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 commented 6 months ago

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

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.