Cinder Quota RBAC does not consider project_id passed

Bug #1665341 reported by Divya K Konoor
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

The problem reported below is not limited to just cinder quotas. I checked and see this in other apis as well like quota classes and lots of others. The problem listed down is specific to quotas because I ran into this problem when I tried this rest api:

As we know the policy.json file defines the RBAC for a rest api. I updated my policy json rules for quotas as seen below with an intent that the admin user of a particular project is not able to update or access information w.r.t. quotas of other project . But the below project segregation rules do not work.

"volume_extension:quotas:show": "role:admin and project_id:%(project_id)s",
"volume_extension:quotas:update": "role:admin and project_id:%(project_id)s",
"volume_extension:quotas:delete": "role:admin and project_id:%(project_id)s",

These do not work because in the api level code, the same project id is passed for target and credentials.
https://github.com/openstack/cinder/blob/master/cinder/api/contrib/quotas.py#L165

This happens because there's no target information passed at the time of rule enforcement in which case the code uses the context project id as the target :

https://github.com/openstack/cinder/blob/master/cinder/api/extensions.py#L326

Changed in cinder:
assignee: nobody → Divya K Konoor (dikonoor)
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: Divya K Konoor (dikonoor) → nobody
Revision history for this message
Matthew Edmonds (edmondsw) wrote :

scope checks should be done in code, not by adding project_id:%(project_id)s in policy files. That said, there are at least a couple things that need to happen here:
1) we need to start doing proper scope checks in the code
2) target data needs to be filled to enable other types of checks from policy

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.