-
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
Token roles don't respect 'allowed_entity_aliases' parameter #13340
Comments
I'd like to take a look at this. |
So I've been able to successfully add a proper error response if no 'entity_alias' field is supplied. The current error message reads: "no 'entity_alias' value supplied".
|
@kauedg Are there any additional changes you'd like added or should I open a pull request for this? |
Go ahead |
Hi @kauedg, Can you help me understand what problem this is causing? Changing this is going to break backwards compatibility, so we'd need a pretty good reason. |
@ncabatoff I believe this problem could be treated as a security risk. An alias could receive inadequate permissions only from knowing the higher-permission role name. Besides, if the |
@ncabatoff any insights on this issue? If a token role was supposed to be protected from unauthorized token generation, based on an entity alias whitelist, and an unauthorized alias is able to create a token from this role, it is clear to me it's a case of unauthorized access. I believe that the points I made are a good reason to patch the endpoint's behaviour. |
I think you are envisioning a different use case than was intended for allowed_entity_aliases. We could add a require_entity_alias bool param to roles for your use case. |
Which use case would require an allowed entity list but allowing any alias to request tokens, at the same time? I believe that the field's name implies that other aliases shouldn't be allowed to request tokens, so the new field wouldn't even be required. If there's such use case then I think the |
The field was added in #6267, and the fact that they made it optional suggests to me that they weren't thinking about it the same way you are. Either way, we can't change this retroactively without the risk of breaking things for someone, so the new behaviour you're looking for must be opted-in to via a new field. |
So, if I understood correctly, |
I don't think so. allowed_entity_aliases specifies which entities can be bound to tokens created with that role. It doesn't constrain token creation, it grants permission to extend the privileges of the created token by granting it the permissions associated with the entity tied to be to the specified alias. Another use case is for billing: with Vault Enterprise, you're billed based on how many "clients" you have, so by using tying the token to an entity you can ensure the "client" associated with that token will be that entity. This is less important in recent versions, since we treat all tokens with the same set of policies in a given namespace as a single "client". If you want to restrict access to the token role to specific entities, you should use identity policies to grant access to the role endpoint. |
Here we go, now I got it. Maybe the field's documentation could use some rephrasing. The endpoint has fields that are related to the endpoint (like |
Describe the bug
When a token role is created using the
allowed_entity_aliases
parameter it is still possible to create a token using the role when no entity alias is passed.To Reproduce
entity_alias
parameter or with a valid alias:Expected behavior
The documentation states that:
If a list of allowed users is set, there's no point in allowing anyone else to generate a token using the role. The API should refuse generating the token when
entity-alias
is not passed/empty.Environment:
vault status
): 1.9.0vault version
): Vault v1.9.0Vault server configuration file(s): none, dev server
Additional context
None
The text was updated successfully, but these errors were encountered: