-
Notifications
You must be signed in to change notification settings - Fork 4.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
request.tokenentry.meta should be accessible in role.template during oidc token creation #11803
Comments
Hi, if I understood correctly; you want the token's metadata to be accessible in the template; meaning, the metadata that was copied from the OIDC auth backend? But it is an alive and well enough topic that this does not mean the end of that; but, the concept needs to be fleshed out better I guess.
Perhaps we could:
If my assumption is wrong that token metadata is what you'd like to see interpolated, please, if you could elaborate what it is you'd like, then perhaps that different point-of-view could be the key to this problem |
Hi @dlamotte, As you saw in #11798, trying to use different metadata for different secretids is unreliable, and the Vault team decided that we don't want different secretids for the same approle to be treated differently or to have different permissions. Can you explain more about why
is not a good solution for you? The intent of an approle role is that it will only be shared by different instances of the same application, which to my mind means that all of them will need the same permissions. |
@UXabre ya, we're aligned AFAICT. @ncabatoff It's simply that it becomes a maintenance burden. You can imagine many instances of the similar class but scoped to its local resources. That's parameterized by the name of the instance. ie: instance ABC can only access resources below path/ABC/* but the patterns of usage match because they are all instances of the same class (I'm speaking very generically here). Since this cannot be templated as such, it means for each instance, we must manage the lifecycle of a correlated approle and policy dedicated specifically for the instance. It means that destruction of the instance also mandates destruction of the correlating vault resources or it leaks. The extent of the resources that need to be managed is what is in discussion here. Should a secretid alone be enough to be deleted? Or is it a secretid + approle + policy? It also means that whatever is controlling the lifecycle of the instance also needs elevated privileges in order to create/manage approles and policies whereas with this it would only need secretid on a specific role. I can see your point about the loophole here. And I'm not too familiar with vault internals, so forgive me... but perhaps there should be clear delineation between "server-side metadata" and "client-side metadata". Server-side metadata can always be trusted and used in policy, but client-side metadata cannot be trusted (but may be useful for other reasons) and therefore cannot be used in policy. |
@dlamotte To be complete, I'll link to a closed PR of mine as this also has the same discussion topic: #10682 Back to you @ncabatoff (sorry if I just ran in a big circle in my comment above as you metioned that you're not a fan of making distinctions between tokens) |
Is your feature request related to a problem? Please describe.
Multiple secret-id's per approle could be more useful if a secret-id's meta was exposed so that JWTs could encode details from the secret-id meta.
Describe the solution you'd like
I'd like to hand a service an role-id+secret-id that was minted with a specific metadata field such that future requests to vault with the token could have secret-id specific authorization.
that could be enforced by applications based on the contents of the JWT. ie: JWT with field
scope: /objects/subset1
which ensures clients with the JWT cannot modify all/objects
but only objects belowsubset1
(the rules here are opaque and application dependent).There are two aspects here:
The initial attempt here utilized querying into entity aliases in templates like
identity.entity.aliases[$accessor].metadata[$secret-id-field]
but this was found to work only intermittently (see #11798).Describe alternatives you've considered
It seems the alternative is creating an approle per scope with a policy/role.template associated specifically with it.
The issue here is that approle/secret-id scale 1:1 with each other here vs the ideal solution is a single approle with a secret-id per variation.
Explain any additional use-cases
Any use cases where applications authenticating to vault with secret-id's that have some limited scope within an approle.
Additional context
Terraform to setup a
vault server -dev
:After running
vault server -dev
:Unfortunately, accessing in this way
"alias.metadata.hello": {{identity.entity.aliases.${vault_auth_backend.app.accessor}.metadata.hello}},
appears to yield intermittent results whereas I assume iftokenentry.meta
were exposed, it could beidentity.tokenentry.meta.hello
(or some similar pattern).The text was updated successfully, but these errors were encountered: