-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
keyring: support prepublishing keys #23577
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
from
July 12, 2024 16:26
1ea4f48
to
6d054c4
Compare
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
from
July 12, 2024 16:29
6d054c4
to
4f82345
Compare
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
from
July 12, 2024 17:41
4f82345
to
6ede3dd
Compare
tgross
added
backport/ent/1.6.x+ent
Changes are backported to 1.6.x+ent
backport/ent/1.7.x+ent
Changes are backported to 1.7.x+ent
backport/1.8.x
backport to 1.8.x release line
labels
Jul 12, 2024
pkazmierczak
approved these changes
Jul 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work! I left some questions/comments, but nothing major.
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
2 times, most recently
from
July 18, 2024 14:00
e6d2fe5
to
719b42e
Compare
schmichael
approved these changes
Jul 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLI comment isn't a blocker but give it a quick think 😁
When a root key is rotated, the servers immediately start signing Workload Identities with the new active key. But workloads may be using those WI tokens to sign into external services, which may not have had time to fetch the new public key and which might try to fetch new keys as needed. Add support for prepublishing keys. Prepublished keys will be visible in the JWKS endpoint but will not be used for signing or encryption until their `PublishTime`. Update the periodic key rotation to prepublish keys at half the `root_key_rotation_threshold` window, and promote prepublished keys to active after the `PublishTime`. This changeset also fixes two bugs in periodic root key rotation and garbage collection, both of which can't be safely fixed without implementing prepublishing: * Periodic root key rotation would never happen because the default `root_key_rotation_threshold` of 720h exceeds the 72h maximum window of the FSM time table. We now compare the `CreateTime` against the wall clock time instead of the time table. (We expect to remove the time table in future work, ref #16359) * Root key garbage collection could GC keys that were used to sign identities. We now wait until `root_key_rotation_threshold` + `root_key_gc_threshold` before GC'ing a key. * When rekeying a root key, the core job did not mark the key as inactive after the rekey was complete. Ref: https://hashicorp.atlassian.net/browse/NET-10398 Ref: https://hashicorp.atlassian.net/browse/NET-10280 Fixes: #19669 Fixes: #23528 Fixes: #19368
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
from
July 19, 2024 15:14
719b42e
to
a883182
Compare
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
from
July 19, 2024 15:32
c6ec0d0
to
bb8c57d
Compare
tgross
force-pushed
the
keyring-rotation-and-prepublish
branch
from
July 19, 2024 15:34
bb8c57d
to
cae6cc2
Compare
This was referenced Jul 19, 2024
tgross
added a commit
that referenced
this pull request
Jul 19, 2024
Backports required documentation bits from #23577 because the PR was only automatically backported to the 1.7.x+ent branch.
tgross
added a commit
that referenced
this pull request
Jul 19, 2024
Backports required documentation bits from #23577 because the PR was only automatically backported to the 1.6.x+ent branch.
This was referenced Jul 19, 2024
This was referenced Jul 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport/ent/1.6.x+ent
Changes are backported to 1.6.x+ent
backport/ent/1.7.x+ent
Changes are backported to 1.7.x+ent
backport/1.8.x
backport to 1.8.x release line
theme/keyring
type/bug
type/enhancement
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.
When a root key is rotated, the servers immediately start signing Workload Identities with the new active key. But workloads may be using those WI tokens to sign into external services, which may not have had time to fetch the new public key and which might try to fetch new keys as needed.
Add support for prepublishing keys. Prepublished keys will be visible in the JWKS endpoint but will not be used for signing or encryption until their
PublishTime
. Update the periodic key rotation to prepublish keys at half theroot_key_rotation_threshold
window, and promote prepublished keys to active after thePublishTime
.This changeset also fixes three bugs in periodic root key rotation and garbage collection, none of which can be safely fixed without implementing prepublishing:
root_key_rotation_threshold
of 720h exceeds the 72h maximum window of the FSM time table. We now compare theCreateTime
against the wall clock time instead of the time table. (We expect to remove the time table in future work, ref GC limits > 3 days are in effect infinite b/c of FSM timetable limit #16359)root_key_rotation_threshold
+root_key_gc_threshold
before GC'ing a key.Ref: https://hashicorp.atlassian.net/browse/NET-10398
Ref: https://hashicorp.atlassian.net/browse/NET-10280
Fixes: #19669
Fixes: #23528
Fixes: #19368
Notes for reviewers: