os-server-groups uses same policy.json rule for all CRUD operations

Bug #1636157 reported by prashkre
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matthew Edmonds

Bug Description

All os-server-groups REST calls use same rule (https://github.com/openstack/nova/blob/master/nova/policies/server_groups.py#L29-L31) instead of having a separate rule for create, delete, show and list actions on server_groups. This takes away control of RBAC at a REST api level and is incorrect.

Here are the references of rule being used with respective REST action.
1. create (https://github.com/openstack/nova/blob/stable/newton/nova/api/openstack/compute/server_groups.py#L136)
2. delete(https://github.com/openstack/nova/blob/stable/newton/nova/api/openstack/compute/server_groups.py#L89)
3. show (https://github.com/openstack/nova/blob/stable/newton/nova/api/openstack/compute/server_groups.py#L78)
4. list(https://github.com/openstack/nova/blob/stable/newton/nova/api/openstack/compute/server_groups.py#L120)

seen in newton

Tags: api policy
prashkre (prashkre)
Changed in nova:
assignee: nobody → prashkre (prashkre)
Revision history for this message
prashkre (prashkre) wrote :

I am working on the fix for the issue.

Revision history for this message
Matt Riedemann (mriedem) wrote :

I'm not entirely sure what rules/guidelines we have around policy granularity, but this seems like an OK change.

tags: added: api policy
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
prashkre (prashkre) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/391113

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
assignee: prashkre (prashkre) → Matthew Edmonds (edmondsw)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/391113
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4a09c2210b3c07343411a06c676c2d85aa0e214f
Submitter: Jenkins
Branch: master

commit 4a09c2210b3c07343411a06c676c2d85aa0e214f
Author: Prashanth kumar reddy <email address hidden>
Date: Thu Oct 27 07:09:01 2016 -0400

    Separate CRUD policy for server_groups

    The same policy rule (os_compute_api:os-server-groups) is being used
    for all actions (show, index, delete, create) for server_groups REST
    APIs. It is thus impossible to provide different RBAC for specific
    actions based on roles. To address this changes are made to have
    separate policy rules for each of action.

    It has been argued that index and show may not need separate policy
    rules, but most other places in nova (and OpenStack in general) do
    have separate policy rules for each action. This affords the ultimate
    flexibility to deployers, who can obviously use the same rule if
    that is what they want. One example where show and index may be
    different is that if show is restricted based on some criteria, such
    that a user is able to see some resources within the tenant but not
    others, then list would need to be disallowed to prevent the user
    from using list to see resources they cannot show.

    Change-Id: Ica9e07f6e80257902b4a0cc44b65fd6bad008bba
    Closes-Bug: #1636157

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b2

This issue was fixed in the openstack/nova 15.0.0.0b2 development milestone.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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