← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1867840] [NEW] os-flavor-access API policy should be admin only

 

Public bug reported:

os-flavor-access API policy is default to admin_or_owner[1] but API is
allowed for everyone.

This is because API does not pass the server project_id in policy target
- https://github.com/openstack/nova/blob/96f6622316993fb41f4c5f37852d4c879c9716a5/nova/api/openstack/compute/flavor_access.py#L45

and if no target is passed then, policy.py add the default targets which is nothing but context.project_id (allow for everyone try to access)
- https://github.com/openstack/nova/blob/c16315165ce307c605cf4b608b2df3aa06f46982/nova/policy.py#L191

I do not think there is owner things for flavor as multiple tenant can
be added to access the flavor. I think we should default this policy to
admin only and admin only should be able to list all the tenants who has
access to specific flavor.

[1]
- https://github.com/openstack/nova/blob/96f6622316993fb41f4c5f37852d4c879c9716a5/nova/policies/flavor_access.py#L49

** Affects: nova
     Importance: Undecided
     Assignee: Ghanshyam Mann (ghanshyammann)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Ghanshyam Mann (ghanshyammann)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1867840

Title:
  os-flavor-access  API policy should be admin only

Status in OpenStack Compute (nova):
  New

Bug description:
  os-flavor-access API policy is default to admin_or_owner[1] but API is
  allowed for everyone.

  This is because API does not pass the server project_id in policy target
  - https://github.com/openstack/nova/blob/96f6622316993fb41f4c5f37852d4c879c9716a5/nova/api/openstack/compute/flavor_access.py#L45

  and if no target is passed then, policy.py add the default targets which is nothing but context.project_id (allow for everyone try to access)
  - https://github.com/openstack/nova/blob/c16315165ce307c605cf4b608b2df3aa06f46982/nova/policy.py#L191

  I do not think there is owner things for flavor as multiple tenant can
  be added to access the flavor. I think we should default this policy
  to admin only and admin only should be able to list all the tenants
  who has access to specific flavor.

  [1]
  - https://github.com/openstack/nova/blob/96f6622316993fb41f4c5f37852d4c879c9716a5/nova/policies/flavor_access.py#L49

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1867840/+subscriptions


Follow ups