fix: prevent refreshAliasesTask from reverting rotated aliases in aws_kms plugin#6805
Open
angabini wants to merge 1 commit intospiffe:mainfrom
Open
fix: prevent refreshAliasesTask from reverting rotated aliases in aws_kms plugin#6805angabini wants to merge 1 commit intospiffe:mainfrom
angabini wants to merge 1 commit intospiffe:mainfrom
Conversation
…_kms plugin Signed-off-by: angabini <494150+angabini@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request check list
Affected functionality
aws_kmsKeyManager plugin — specifically therefreshAliasesTaskbackground task that periodically refreshes alias timestamps.Description of change
In multi-replica SPIRE server deployments sharing a
key_identifier_value,refreshAliasesTaskon non-leader replicas can revert a KMS alias to a stale cached key after the leader rotates it. If the old key is subsequently scheduled for deletion, the alias ends up pointing to a disabled key, causing all future server startups to crash withFailedPrecondition.This PR adds a
DescribeKeycheck inrefreshAliases()before callingUpdateAlias. If the alias's current target differs from the local cache (indicating a rotation by another replica), the refresh is skipped to avoid reverting the rotation.Which issue this PR fixes
fixes #6804