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

key_groups should only require 1 group to decrypt minimum #1560

Open
kriegster108 opened this issue Jul 19, 2024 · 2 comments
Open

key_groups should only require 1 group to decrypt minimum #1560

kriegster108 opened this issue Jul 19, 2024 · 2 comments

Comments

@kriegster108
Copy link

kriegster108 commented Jul 19, 2024

using sops 3.8.1

My .sops.yaml

I am able to encrypt and decrypt SOPS secrets using this configuration:

creation_rules:
- path_regex: \.yaml$
  key_groups:
  - kms:
    - arn: 'arn:'
      role: 'arn:'
  # - age:
  #       - ageblablabla

If I uncomment the age portion it fails to decrypt via this configuration:

creation_rules:
- path_regex: \.yaml$
  key_groups:
  - kms:
    - arn: 'arn'
      role: 'arn'
  - age:
        - ageblah


Error:

"sops_decrypt_file" failed: Error getting data key: 2 successful groups required, got 1.

This should still let me decrypt. I do not understand why we need two minimum. AGE encryption is a redundancy just incase something bad happens to KMS, and the AGE private key is not stored on my local machine.

The reason why I am in this situation is because it appears based on the SOPs documentation the only way to have a KMS configured which requires role assumption to encrypt/decrypt is to use the key_groups syntax above. There is no configuration I have found where SOPS will allow me to set a role as a creation rule other than this. How do I fix?

@kriegster108 kriegster108 changed the title SOPS wont put KMS, age, or role into encrypted file when specifying role Cant assume role in .sops.yaml configuration unless key_groups are implemented Jul 19, 2024
@kriegster108 kriegster108 changed the title Cant assume role in .sops.yaml configuration unless key_groups are implemented key_groups should only require 1 group to decrypt minimum Jul 19, 2024
@kriegster108
Copy link
Author

my solution for now, because I am using this alongside terragrunt is to just use the sops terraform provider directly in my TF manifests vs loading the file in using terragrunt's syntax

@felixfontein
Copy link
Contributor

Why don't you put all keys into the same group, if you want to decrpyt with only one key?

creation_rules:
- path_regex: \.yaml$
  key_groups:
  - kms:
    - arn: 'arn'
      role: 'arn'
    age:
        - ageblah

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