getsops / getsops/sops

updatekeys doesn't trigger when key ordering change

Open
#2,269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

When changing key ordering to prioritize a decryption key over others (age key over password-protected ssh private key), sops updatekeys exit with "File already up to date" message.

updatekeys should update the encryption order of the file, since sops decrypt decrypt the file in the encryption order, rather than in the .sops.yaml key declaration order.

For example, updating .sops.yaml from:

key_groups: &encryption-keys
  - age:
    - &user_ssh_id ssh-ed25519 rtensaensuurestntreunesaruxxxxxxxxxxxx user@domain.com
    - &user_sops_age age1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
creation_rules:
  - path_regex: secrets/.+$
    key_groups: *encryption-keys

to

key_groups: &encryption-keys
  - age:
    - &user_sops_age age1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    - &user_ssh_id ssh-ed25519 rtensaensuurestntreunesaruxxxxxxxxxxxx user@domain.com
creation_rules:
  - path_regex: secrets/.+$
    key_groups: *encryption-keys

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the updatekeys command and reproduce the issue using the two .sops.yaml key orderings shown. Verify how the encrypted file's key order is compared with the configuration; done means sops updatekeys changes the encryption order and no longer reports the file as already up to date.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.