Keystone is unable to remove role-assignment for deleted LDAP users
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Confirmed
|
Low
|
Vishakha Agarwal |
Bug Description
We are experiencing issues when trying to remove role-assignments for users that were in our LDAP catalog, but now is deleted. We use LDAP as a read-only source of usernames/
When listing role-assignments we get something like this:
$ openstack role assignment list --project project --names
+------
| Role | User | Group | Project | Domain | System | Inherited |
+------
| _member_ | @ | | project@LDAP-DOMAIN | | | False |
| _member_ | @ | | project@LDAP-DOMAIN | | | True |
| heat_stack_owner | @ | | project@LDAP-DOMAIN | | | False |
| heat_stack_owner | @ | | project@LDAP-DOMAIN | | | True |
| _member_ | @ | | project@LDAP-DOMAIN | | | False |
| _member_ | @ | | project@LDAP-DOMAIN | | | True |
| heat_stack_owner | @ | | project@LDAP-DOMAIN | | | False |
| heat_stack_owner | @ | | project@LDAP-DOMAIN | | | True |
| _member_ | defaultuser@Default | | project@LDAP-DOMAIN | | | False |
| _member_ | defaultuser@Default | | project@LDAP-DOMAIN | | | True |
| heat_stack_owner | defaultuser@Default | | project@LDAP-DOMAIN | | | False |
| heat_stack_owner | defaultuser@Default | | project@LDAP-DOMAIN | | | True |
| _member_ | ldapuser@
| _member_ | ldapuser@
| heat_stack_owner | ldapuser@
| heat_stack_owner | ldapuser@
+------
Here the first 8 lines represents roles to two different users deleted from LDAP. Listing the assignments without --names will give me the users ID's:
$ openstack role assignment list --project project --names
+------
| Role | User | Group | Project | Domain | System | Inherited |
+------
| 9fe2ff9ee4384b1
| 9fe2ff9ee4384b1
| c5b14c3cf7014b4
| c5b14c3cf7014b4
| 9fe2ff9ee4384b1
| 9fe2ff9ee4384b1
| c5b14c3cf7014b4
| c5b14c3cf7014b4
| 9fe2ff9ee4384b1
| 9fe2ff9ee4384b1
| c5b14c3cf7014b4
| c5b14c3cf7014b4
| 9fe2ff9ee4384b1
| 9fe2ff9ee4384b1
| c5b14c3cf7014b4
| c5b14c3cf7014b4
+------
Trying to delete the roles for one of the deleted users simply gives me an error-message stating that the user dont exist:
$ openstack role remove --user 0f9389d48ed88c2
No user with a name or ID of '0f9389d48ed88c
I have an understanding of the reasons why role-assignments and id-mappings are not cleaned automaticly to allow the user get its old roles back if it reappear; but as an adminstrator I should be able to remove a role-assignments to prevent a re-appearing user from getting access to a certain project.
Changed in keystone: | |
status: | Incomplete → New |
Changed in keystone: | |
assignee: | nobody → Vishakha Agarwal (vishakha.agarwal) |
Can you please run the `openstack role remove` command with the `--debug` flag?
I believe the above error is coming from the way that the openstack command line client checks to see if the argument provided is a name or an id, and fails because it cannot figure that out.
Can you please try to remove the role assignment directly using the REST API? See here https:/ /docs.openstack .org/api- ref/identity/ v3/#unassign- role-from- user-on- project
You can get a token using the command `openstack token issue -f value -c id` and then use that by filling in the token and ids in the below command.
`curl -i -X DELETE -H "X-Auth-Token: <token>" https://<keystone- hostname> /v3/projects/ <project_ id>/users/ <user_id> /roles/ <role_id> `