User is able to still use deleted project when set as current project

Bug #1166585 reported by Sam Stoelinga
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Confirmed
Low
David Lyle

Bug Description

Description:
If we delete an project with an active user which is using the project, the user can still use the project by going back to project management and create instances, which are unable to be deleted in a later stadium.

Release found:
A customized version of Folsom

Steps to reproduce:
1. Go to Admin panel > Projects
2. Create a project named "sam", add admin user to the project with the admin role
3. Click on Project management
4. Set the current active project to "sam"
5. Go to on Admin panel > Projects
6. Delete the project called "sam"
7. Go back to Project management
8. Launch an instance

Current result:
I was able to go back to the sam project and create an instance in a non-existent project. If you then logout with the admin user and login again its impossible to find/delete the instance. nova list also doesn't show , the only way to delete it is with nova delete {{uuid}} but for this you need to know the uuid.

Expected result:
TO DISCUSS: I came up with two possiblities
1. Automatically logout if the project doesn't exist anymore
2 Or when deleting a project update the authorized_tenants and the user.tenant_name and user.tenant_id attributes. So that when the user goes back to Project management another(non-deleted) project will get set as active project for the user. A user shouldn't be able to have a non-existent project as active project in horizon

Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

There are two parts to this:

1. Horizon should do something to remove the deleted project from the list of available projects while the user is still logged in.

2. Nova is not doing the right thing with validating the token against keystone in your installation if you can still launch a VM. That part has nothing to do with Horizon.

I believe there are/have been other tickets about part 2, but I'll leave this one open to address part 1.

Changed in horizon:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → havana-1
Changed in horizon:
assignee: nobody → Tzu-Mainn Chen (tzumainn)
Revision history for this message
Tzu-Mainn Chen (tzumainn) wrote :

Should this check actually be on the django_openstack_auth user.py side? It seems like the solution offered here will only solve the problem for the logged in user (and not for any other user that may happen to be using the deleted project); and it will only solve it if the project is deleted from the dashboard (and not from the command-line).

Changed in horizon:
milestone: havana-1 → havana-2
Changed in horizon:
milestone: havana-2 → havana-3
Changed in horizon:
milestone: havana-3 → none
David Lyle (david-lyle)
Changed in horizon:
assignee: Tzu-Mainn Chen (tzumainn) → David Lyle (david-lyle)
importance: Medium → Low
Revision history for this message
David Lyle (david-lyle) wrote :

It is no longer possible to launch an instance while scoped to a deleted project. However, the fact that you can delete the project you are currently scoped to is troublesome. My feeling is you should not be able to delete the currently scoped project. Is there a use case for removing the project to which your role is currently tied?

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

I think there are no possible use cases for that action; the only viable scenario to avoid multiple errors that happen after the tenant the User was scoped-in is deleted - is to immediately log-out User after the tenant is deleted. This action can lead to the Users losing their only account in the OpenStack cloud and then bothering admins to recreate it - should be avoided. I vote for disabling that action for the tenant you're currently scoped in.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

It seems to me that bug 1252785 is solely about fixing the behavior described at comment#3, but was reported later than this one. Which bug should we close as Duplicate/Invalid?

Revision history for this message
Martin Hickey (martin-hickey) wrote :

I think this is still a valid defect. User can delete current project which they probably don't want to do with not very nice consequences. One example is cloud administrator for default domain and project.

The best scenario as previously mentioned is probably to disallow deletion of current scoped project which is similar to the user deletion workings.

David, are you still working on this defect? If not maybe I could provide fix for review for for Liberty?

Revision history for this message
Martin Hickey (martin-hickey) wrote :

Covered by bug 199410

Revision history for this message
Martin Hickey (martin-hickey) wrote :

Previous comment should refer to review https://review.openstack.org/#/c/199410/
Thanks to David Lyle for feedback on IRC.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.