-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adds vault role to JWT claims if specified in jobspec #19535
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
mikenomitch
force-pushed
the
add-vault-role-to-jwt-claims
branch
from
December 19, 2023 22:52
9b5fc5b
to
1d36a98
Compare
mikenomitch
force-pushed
the
add-vault-role-to-jwt-claims
branch
from
December 19, 2023 22:58
1d36a98
to
45f3296
Compare
lgfa29
approved these changes
Dec 20, 2023
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! Mostly some minor suggestions, and I think we need to remove that VaultRole
from WIHandle
since we're not using it anymore?
mikenomitch
force-pushed
the
add-vault-role-to-jwt-claims
branch
from
December 20, 2023 22:24
45f3296
to
737bbb7
Compare
When would this feature released? Do you have any plan? |
@BGMUSTC The feature will be released in the upcoming 1.7.3 release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Adds vault_role as an attribute in the JWT if, and only if, the role is specified in the jobspec. This would allow Vault users to interpolate the Vault role in their templated policies. This could be generally useful, but was primarily added to unblock a specific customer. They have verified that this fix (including the constraint below) would unblock JWT-based Vault auth for their setup.
Ideally, we could add the role regardless of where it is specified, but since the server is minting the JWTs and the client has the default fallback auth_role values, it is difficult to insert the role into the JWT claims if it is using the fallback. There is also a potential syncing issue if you update config and then restart Nomad. To get around these issues, Vault Namespaces have the same constraint (only adding to claims if in the jobspec), so we're adding the same constraint to the role JWT claim.