-
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
Group-membership inconsistencies when using identity/group to remove member entities by group name #10223
Comments
Seemingly related issues:
|
Thank you @indjb for an incredibly thorough bug report, complete with reproduction via shell script. 👏 |
Looks like fix has not been merged. Do you have updates about this? |
This affects policies as well. The common code does check for an existing group of the same name, but after policies are assigned:
|
* Updates identity/group to allow updating a group by name (#10223) * Now that lookup by name is outside handleGroupUpdateCommon, do not use the second name lookup as the object to update. * Added changelog. Co-authored-by: dr-db <[email protected]>
* Updates identity/group to allow updating a group by name (#10223) * Now that lookup by name is outside handleGroupUpdateCommon, do not use the second name lookup as the object to update. * Added changelog. Co-authored-by: dr-db <[email protected]>
…0813) * Updates identity/group to allow updating a group by name (#10223) * Now that lookup by name is outside handleGroupUpdateCommon, do not use the second name lookup as the object to update. * Added changelog. Co-authored-by: dr-db <[email protected]>
Hi @mgritter,
|
Hey @samuelmasuy that's an interesting side effect. I think probably the team will not change it (but feel free to open an issue.) Today's my last day at HashiCorp so I won't be fixing it, anyway. The issue is that the second call goes to the "modify group" API endpoint, which doesn't return a response:
That is, we only return the group on a create, not an update operation. So I think this is consistent that the second call to identity/group does not return a response, even if it differs from the previous behavior (which was a result of going through the "new group" code path each time, and half-heartedly swapping in the existing group too late in the process.) |
I have run into this also, my issue logged here: #11334 The tutorials for OIDC Auth, using groups fail as the GROUP_ID is not in the variable for ie, this fails:
|
Is there another way to discover the group_id after a group has been created, from the group name? |
Describe the bug
Group-membership inconsistencies arise when using
identity/group
by group name only to remove member entities:The result is that tokens for the entity are still granted the policies for the group.
To Reproduce
This script reproduces the behavior:
The output will be something like:
Expected behavior
I expect the entity's list of groups to always be in sync with the group's list of members.
Environment:
vault status
):vault version
):Default configs only. Dev mode.
Additional context
This inconsistency does not arise when using
identity/group/name/$group_name
oridentity/group/id/$group_id
to remove the entity from the group, so the "fix" in our case is just to use a different endpoint, but I think it's important to clarify (and possibly fix) the behavior of the endpoint in question when used in this way. It's true that the documentation foridentity/group
only promises to update an existing group if the ID is given, but if the ID is not given -- and the name matches the name of an existing group -- the behavior is not specified in the documentation. The most obvious possibilities seem to be:identity/group/name/$group_name
. It's not clear that that's desirable behavior, and anyway it's not what Vault is actually doing.In any case, it seems that Vault should never behave in a way that results in the mismatch between the entity and the group. The result in our case was that the entity was still getting policies for the group, despite the group thinking the entity was no longer a member, leading to entities maintaining access to secrets for which we thought access had been revoked.
The text was updated successfully, but these errors were encountered: