-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
auth/cert: Add metadata to identity-alias #14751
Conversation
4f56f57
to
61623a9
Compare
Thank you for your contribution. There has been an update on the original GH issue. I am going to post a link here for reference. #14418 (comment) |
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.
Hi @peterverraedt ,
Thanks for submitting this PR!
This change makes sense to us as the right path forward for enabling using certificates metadata in ACL templating. However, we're worried about storage concerns regarding this change, so we'd like for this to be an opt-in feature. One option is to add this to the role config, but it might also be possible that an extra config endpoint is needed.
Thanks again!
84771ef
to
d704497
Compare
d704497
to
c5cf53f
Compare
@HridoyRoy I've added a config value to the existing configuration endpoint of the auth method mount. As the identity aliases are linked to the auth mount as a whole rather than to the specific role, this seems to be the most logical place (either all identity aliases have some metadata, or none have metadata). The amount of stored metadata is limited to these five fields https://github.com/hashicorp/vault/blob/c5cf53fccb1923e2f17aacc100b6ba50881c23ee/builtin/credential/cert/path_login.go#L98-L102 and what the user specifies as "allowed_metadata_extensions". The latter is specified on role level as it could easily differ depending on the trusted CAs. |
@HridoyRoy What is the current status of this PR? |
Hey @peterverraedt ! So we discovered a potential entity bloat bug when it comes to adding data to the alias metadata, and there's currently a PR open for it that we're in the process of reviewing and merging, once that is done the plan is to review either this or the other open PR fixing the issue. |
Hi @peterverraedt ! I'm currently taking a look at this PR, and i'll drop a proper review shortly, but off the bat I had a couple asks, if they make sense to you.
|
Hi @pmmukh, back from holidays now.
|
Add the possibility to include certificate metadata in the created logical.Alias (the identity alias), in addition to the metadata added to logical.Auth. This is analogous to the behaviour of the ldap and approle auth providers. This possibility can be configured by the config endpoint of the auth method mount and is disabled by default. We added the read operation on this config endpoint as well. Fixes: hashicorp#14418 Signed-off-by: Peter Verraedt <[email protected]>
Signed-off-by: Peter Verraedt <[email protected]>
8155c4f
to
f1f980c
Compare
Signed-off-by: Peter Verraedt <[email protected]>
f1f980c
to
32d0e67
Compare
Hi @pmmukh, I added a test case for testing whether usage of metadata in acl policies works. I can also confirm for your second question that the metadata that is set in Auth.Metadata ends up as metadata associtated with the token, and while this does not relate at all to the acl policy templates, it still might be useful. |
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!
Add metadata to logical.Alias (the identity alias) too, in addition
to the metadata added to logical.Auth. This is analogous to the
behaviour of the ldap and approle auth providers.
CC: @pmmukh
Fixes: #14418
Signed-off-by: Peter Verraedt [email protected]