-
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
Creating a group with the same name as an existing group is interpreted as a modification to the original group, even by a different user #9002
Comments
Hi @axfelix, I'm not yet persuaded this is a bug. The
The policy you posted didn't include the |
Hi, When you say it didn't include the
I'm not totally sure what you mean, can you clarify? |
Sorry, I misspoke. What I should have said was the policy you posted doesn't show restrictions on that endpoint that enforce different behaviours for the two users. |
Oh, I see -- you're saying that there's no reason, based on the config we have, that they shouldn't both have access to any new groups? |
Yeah. |
Would it be necessary to use a block like |
Sorry, can you specify the exact behaviour you want? I have some idea, but I'd rather you spelled it out. You want users to be able to create groups with arbitrary names (which you don't know in advance) that only they are allowed to modify? |
Yes, exactly! Sorry for the confusion, I think we'd assumed that would be closer to the default behaviour. |
I don't think there's any information attached to groups that corresponds to an "owner", so I don't know of any way to do what you want. We could probably make it work if you limited your requirements to allowing users to exclusively create groups with names having a certain prefix, such that e.g. Joe could only create groups starting with "a-" and Sue could only create groups starting with "b-". |
Any way to derive that prefix from a unique subset of, or their entire, username? |
I think so yes. What about
? |
That actually seems to confirm this as a bug!
allows users only to modify groups with names having their entity_name as the prefix. However, with the above block users cannot create new groups. To give users permission to create groups, the following is required, according to the API documentation: https://www.vaultproject.io/api-docs/secret/identity/group
However, with the above added to the policy, any users can modify any group by creating a new one with the same name. |
You've tested the policy I suggested? According to the API documentation at https://www.vaultproject.io/api-docs/secret/identity/group#create-update-group-by-name, re the endpoint I'm suggesting
and it does look like it's going through the same code path. |
Ah, it appears to work when using |
Describe the bug
We allow users to grant access other users access to their individual secrets by creating their own group and adding members to this group. However, we've noticed that when two users try to create new groups with the same name, attempts after the first are treated as modifications of the original group -- they are generated with the same unique ID, and the modify_index value of the group is incremented. This appears to be a bug, as the second user does not have permission to edit this group, but can accidentally modify it.
To Reproduce
Notice that the same group ID is returned.
Note that modify_index has been incremented, as though the API is interpreting this as a modify call rather than a create call.
Expected behavior
Group IDs should not be identical.
Environment:
vault status
): 1.4.0vault version
): 1.4.0Vault server configuration file(s): Server started in dev mode with no additional config provided.
The text was updated successfully, but these errors were encountered: