non-admins can delete in-use images
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
In Progress
|
Medium
|
Felix Huettner |
Bug Description
Hello everyone,
we have an issue in the following (simplified) setup:
* we have an user which is uploading images. This user only has default member rights and is not an admin
* the user is uploading new versions of the images regularly
* the user tries to delete previous versions of the images to clean up space. Some of the deletes fail if the image is still in use
* the user then disables such images to ensure that no new instances are spawned from it
When the user now tries to delete such disabled image they will always succeed. Independent if the image is acutally in use or not. The deletion only happens on the Database of glance. The image is still present in ceph.
Note that this issue does not happen if an admin tries to delete the disabled image. Then the image is correctly checked if it's still in use.
Some general information regarding the environment:
* Openstack release queens
* ceph as a backend of cinder and glance
* show_image_
In order to reproduce the issue the following steps are necessary (please run with a non-admin user):
[root@openstack
+------
| Field | Value |
+------
| checksum | 01e7d1515ee776b
| container_format | bare |
| created_at | 2021-03-
| disk_format | raw |
| file | /v2/images/
| id | b8a48536-
| min_disk | 0 |
| min_ram | 0 |
| name | testimage |
| owner | 4e6fb48327204e9
| properties | direct_
| protected | False |
| schema | /v2/schemas/image |
| size | 117440512 |
| status | active |
| tags | |
| updated_at | 2021-03-
| virtual_size | None |
| visibility | shared |
+------
[root@openstack
[root@openstack
Failed to delete image with name or ID 'b8a48536-
Failed to delete 1 of 1 images.
[root@openstack
[root@openstack
[root@openstack
Could not find resource b8a48536-
The issue seems to also effect newer glance releases.
A fix is being developed at: https:/
Changed in glance: | |
status: | New → In Progress |
assignee: | nobody → Felix Huettner (felix.huettner) |
importance: | Undecided → Medium |
IMO image deactivation should be strictly admin operation only.
By design once image is deactivated then only admin has access to its location. So correct way to fix this issue is raise 403 Forbidden if any user other than admin tries to deletes the data.