Fixing updatekeys command to respect configured shamir_threshold with groups #1509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed a bug when running
sops updatekeys <filename>
after changing the.sops.yaml
configuration from a single master key to 3 groups with master keys and ashamir_threshold
below the groups size. The threshold configuration was not respected, and the group size was always used. There was also a problem with increasing theshamir_threshold
. If the threshold was still below the group size, the old threshold were used.This PR aims to solve the following issues:
shamir-secret-sharing-quorum
, and the relatedGroupQuorum
option that was always0
shamir_threshold
defined in the configurationExample to reproduce the problem
Use the following
.sops.yaml
to encrypt a fileThen change
.sops.yaml
toAfter running
sops updatekeys <filename>
, the resulting encrypted file has a metadata section starting with:I.e
shamir_threshold
in.sops.yaml
was not respected, and the number of groups was used instead.User experience after change
Message when running
sops updatekeys <filename>
after changing.sops.yaml
from no groups to 3 groups, withshamir_threshold
configured as 2After confirmation the the resulting encrypted file has a metadata section starting with:
Message when changing
shamir_threshold
from 2 to 3 (equal to removingshamir_threshold
from configuration)After confirmation the the resulting encrypted file has a metadata section starting with: