create/delete flavor permissions should be controlled by policy.json

Bug #1445335 reported by Divya K Konoor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Divya K Konoor
Kilo
Fix Released
High
Unassigned
OpenStack Security Advisory
Invalid
Undecided
Unassigned

Bug Description

The create/delete flavor rest api always expects the user to be of admin privileges and ignores the rule defined in the nova/policy.json. This behavior is observed after these changes >> https://review.openstack.org/#/c/150352/.

The expected behavior is that the permissions are controlled as per the rule defined in the policy file and should not mandate that only an admin should be able to create/delete a flavor

Tags: api nova
Changed in nova:
status: New → Confirmed
Revision history for this message
Alex Xu (xuhj) wrote :

This is the regression, the original patch assume the user request's context is pass down to the db call. But actually it is not, the code always pass fake admin context.

So should fix it to keep the v2 API behavor as before. And it should be backport to Kilo

Changed in nova:
importance: Undecided → High
tags: added: kilo-rc-potential
Changed in nova:
assignee: nobody → Divya K Konoor (dikonoor)
Changed in nova:
importance: High → Critical
information type: Public → Public Security
Revision history for this message
Jeremy Stanley (fungi) wrote :

You've switched the status of this bug to indicate an exploitable security vulnerability. Can you please clarify the conditions under which this bug can be exploited by a malicious actor, and the extent of the impact it implies?

Changed in ossa:
status: New → Incomplete
Revision history for this message
Divya K Konoor (dikonoor) wrote :

Jeremy , this bug does not cause security vulnerability. I am a bit new to using launchpad (I am not sure if the security tag addition was the cause ) . This defect merely overrides the flexibility to apply/control permissions associated with flavor rest api and mandates that only a user with admin permissions can make these calls.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Alex Xu (xuhj) wrote :

Yes, this isn't cause security vulnerability. We just add hard-permission checks in the v2 API, that make the flavor api is unconfiguable by policy.json. We just need remove the hard-code permission checks.

Changed in ossa:
status: Incomplete → Invalid
tags: removed: security
Revision history for this message
Divya K Konoor (dikonoor) wrote :
Revision history for this message
John Garbutt (johngarbutt) wrote :

yes sorry, I read this the wrong way around.

this is a relaxing of the check.

Changed in nova:
importance: Critical → High
Revision history for this message
Jeremy Stanley (fungi) wrote :

Thanks, I'll switch this to a normal public bug rather than a public security bug (the latter indicates a security vulnerability). The security bug tag is fine, it mainly just signifies a potential security hardening measure/opportunity and notifies the <email address hidden> mailing list.

information type: Public Security → Public
Matt Riedemann (mriedem)
tags: added: api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/176461

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit ced60b1d1b1608dc8229741b207a95498bc0b212
Author: Divya <email address hidden>
Date: Tue Apr 21 08:26:29 2015 +0200

    Control create/delete flavor api permissions using policy.json

    The permissions of create/delete flavor api is currently broken
    and expects the user to be always an admin, instead of controlling
    the permissions by the rules defined in the nova policy.json.

    Change-Id: Ide3c9ec2fa674b4fe3ea9d935cd4f7848914b82e
    Closes-Bug: 1445335

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/kilo)

Reviewed: https://review.openstack.org/176461
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8c9b5e620eef3233677b64cd234ed2551e6aa182
Submitter: Jenkins
Branch: stable/kilo

commit 8c9b5e620eef3233677b64cd234ed2551e6aa182
Author: Divya <email address hidden>
Date: Tue Apr 21 08:26:29 2015 +0200

    Control create/delete flavor api permissions using policy.json

    The permissions of create/delete flavor api is currently broken
    and expects the user to be always an admin, instead of controlling
    the permissions by the rules defined in the nova policy.json.

    Change-Id: Ide3c9ec2fa674b4fe3ea9d935cd4f7848914b82e
    Closes-Bug: 1445335
    (cherry picked from commit ced60b1d1b1608dc8229741b207a95498bc0b212)

Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)
Download full text (18.1 KiB)

Reviewed: https://review.openstack.org/179284
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5228d4e418734164ffa5ccd91d2865d9cc659c00
Submitter: Jenkins
Branch: master

commit 906ab9d6522b3559b4ad36d40dec3af20397f223
Author: He Jie Xu <email address hidden>
Date: Thu Apr 16 07:09:34 2015 +0800

    Update rpc version aliases for kilo

    Update all of the rpc client API classes to include a version alias
    for the latest version implemented in Kilo. This alias is needed when
    doing rolling upgrades from Kilo to Liberty. With this in place, you can
    ensure all services only send messages that both Kilo and Liberty will
    understand.

    Closes-Bug: #1444745

    Conflicts:
     nova/conductor/rpcapi.py

    NOTE(alex_xu): The conflict is due to there are some logs already added
    into the master.

    Change-Id: I2952aec9aae747639aa519af55fb5fa25b8f3ab4
    (cherry picked from commit 78a8b5802ca148dcf37c5651f75f2126d261266e)

commit f191a2147a21c7e50926b288768a96900cf4c629
Author: Hans Lindgren <email address hidden>
Date: Fri Apr 24 13:10:39 2015 +0200

    Add security group calls missing from latest compute rpc api version bump

    The recent compute rpc api version bump missed out on the security group
    related calls that are part of the api.

    One possible reason is that both compute and security group client side
    rpc api:s share a single target, which is of little value and only cause
    mistakes like this.

    This change eliminates future problems like this by combining them into
    one to get a 1:1 relationship between client and server api:s.

    Change-Id: I9207592a87fab862c04d210450cbac47af6a3fd7
    Closes-Bug: #1448075
    (cherry picked from commit bebd00b117c68097203adc2e56e972d74254fc59)

commit a2872a9262985bd0ee2c6df4f7593947e0516406
Author: Dan Smith <email address hidden>
Date: Wed Apr 22 09:02:03 2015 -0700

    Fix migrate_flavor_data() to catch instances with no instance_extra rows

    The way the query was being performed previously, we would not see any
    instances that didn't have a row in instance_extra. This could happen if
    an instance hasn't been touched for several releases, or if the data
    set is old.

    The fix is a simple change to use outerjoin instead of join. This patch
    includes a test that ensures that instances with no instance_extra rows
    are included in the migration. If we query an instance without such a
    row, we create it before doing a save on the instance.

    Closes-Bug: #1447132
    Change-Id: I2620a8a4338f5c493350f26cdba3e41f3cb28de7
    (cherry picked from commit 92714accc49e85579f406de10ef8b3b510277037)

commit e3a7b83834d1ae2064094e9613df75e3b07d77cd
Author: OpenStack Proposal Bot <email address hidden>
Date: Thu Apr 23 02:18:41 2015 +0000

    Updated from global requirements

    Change-Id: I5d4acd36329fe2dccb5772fed3ec55b442597150

commit 8c9b5e620eef3233677b64cd234ed2551e6aa182
Author: Divya <email address hidden>
Date: Tue Apr 21 08:26:29 2015 +0200

    Control create/delete flavor api permissions using policy.json

    The permissions of ...

Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-1 → 12.0.0
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.