[S-RBAC] project admin can update the state of a share in another project

Bug #1955627 reported by Liron Kuchlani
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Goutham Pacha Ravi

Bug Description

"project_admin" can reset the status of a share that was created by "project_alt_member" in another project.

We expect the "project_admin" not to have access to this resource.

description: updated
Vida Haririan (vhariria)
tags: added: rbac
Vida Haririan (vhariria)
Changed in manila:
importance: Undecided → Low
milestone: none → yoga-3
Revision history for this message
Vida Haririan (vhariria) wrote :
tags: added: low-hanging-fruit
Changed in manila:
assignee: nobody → Shkoh Hamasoor (shkohy)
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

The problem here seems to be the "reset_status" logic doesn't check if the requester has permission to retrieve/manipulate the resource.

https://opendev.org/openstack/manila/src/commit/3ce3854ae9193d94537857737b961576386978b6/manila/api/openstack/wsgi.py#L1239-L1254

Before we perform the _update in that method, we could performa policy check with the resource as the target..

  resource = self._get(context, id)
  policy.check_policy(context, "%s:%s" % (resource_name, reset_status), resource)

Changed in manila:
milestone: yoga-3 → zed-1
Changed in manila:
milestone: zed-1 → zed-2
Changed in manila:
assignee: Shkoh Hamasoor (shkohy) → nobody
Vida Haririan (vhariria)
Changed in manila:
assignee: nobody → moin Ahmed (moin)
Changed in manila:
assignee: moin Ahmed (moin) → Mohammed Moin Mulla (mohammedmoin)
Revision history for this message
Vida Haririan (vhariria) wrote :
Changed in manila:
milestone: zed-2 → zed-3
Changed in manila:
assignee: Mohammed Moin Mulla (mohammedmoin) → Goutham Pacha Ravi (gouthamr)
Changed in manila:
milestone: zed-3 → zed-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/857980

Changed in manila:
status: New → In Progress
Changed in manila:
milestone: zed-rc1 → antelope-1
Changed in manila:
milestone: antelope-1 → antelope-2
Changed in manila:
milestone: antelope-2 → antelope-3
Changed in manila:
milestone: antelope-3 → antelope-rc1
Changed in manila:
milestone: antelope-rc1 → bobcat-1
Changed in manila:
milestone: bobcat-1 → bobcat-2
Changed in manila:
milestone: bobcat-2 → bobcat-3
Changed in manila:
milestone: bobcat-3 → bobcat-rc1
Changed in manila:
milestone: bobcat-rc1 → caracal-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/manila/+/896846

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

Reviewed: https://review.opendev.org/c/openstack/manila/+/857980
Committed: https://opendev.org/openstack/manila/commit/55edb00cc12ade9df333e9c0a3472e68d797b8f6
Submitter: "Zuul (22348)"
Branch: master

commit 55edb00cc12ade9df333e9c0a3472e68d797b8f6
Author: Goutham Pacha Ravi <email address hidden>
Date: Thu Sep 15 13:56:44 2022 -0700

    [RBAC] Enforce check for share updates

    When a user has access to the APIs to reset status,
    task state or replica state but doesn't have access to
    the share, they must be prevented from performing
    those actions. This enforcement allows granular control
    of these actions and the resources themselves.

    Change-Id: Ic3be777b238a467d1b7bd1daa6aa088dedb095b0
    Closes-Bug: #1955627
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

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

Reviewed: https://review.opendev.org/c/openstack/manila/+/896846
Committed: https://opendev.org/openstack/manila/commit/f1aa5f0744f21cdae9394da00f36cc57ce5e09f0
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit f1aa5f0744f21cdae9394da00f36cc57ce5e09f0
Author: Goutham Pacha Ravi <email address hidden>
Date: Thu Sep 15 13:56:44 2022 -0700

    [RBAC] Enforce check for share updates

    When a user has access to the APIs to reset status,
    task state or replica state but doesn't have access to
    the share, they must be prevented from performing
    those actions. This enforcement allows granular control
    of these actions and the resources themselves.

    Change-Id: Ic3be777b238a467d1b7bd1daa6aa088dedb095b0
    Closes-Bug: #1955627
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 55edb00cc12ade9df333e9c0a3472e68d797b8f6)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/manila/+/897450

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/manila/+/897962

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/manila/+/897450
Committed: https://opendev.org/openstack/manila/commit/6781f22bf1d78b89f500f538244d0991152f8e6d
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 6781f22bf1d78b89f500f538244d0991152f8e6d
Author: Goutham Pacha Ravi <email address hidden>
Date: Thu Sep 15 13:56:44 2022 -0700

    [RBAC] Enforce check for share updates

    When a user has access to the APIs to reset status,
    task state or replica state but doesn't have access to
    the share, they must be prevented from performing
    those actions. This enforcement allows granular control
    of these actions and the resources themselves.

    Change-Id: Ic3be777b238a467d1b7bd1daa6aa088dedb095b0
    Closes-Bug: #1955627
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 55edb00cc12ade9df333e9c0a3472e68d797b8f6)
    (cherry picked from commit f1aa5f0744f21cdae9394da00f36cc57ce5e09f0)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 16.1.0

This issue was fixed in the openstack/manila 16.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/manila/+/897962
Committed: https://opendev.org/openstack/manila/commit/27a89a6a1cfa0f75d270e46c933aa24cd9708c27
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 27a89a6a1cfa0f75d270e46c933aa24cd9708c27
Author: Goutham Pacha Ravi <email address hidden>
Date: Thu Sep 15 13:56:44 2022 -0700

    [RBAC] Enforce check for share updates

    When a user has access to the APIs to reset status,
    task state or replica state but doesn't have access to
    the share, they must be prevented from performing
    those actions. This enforcement allows granular control
    of these actions and the resources themselves.

    Change-Id: Ic3be777b238a467d1b7bd1daa6aa088dedb095b0
    Closes-Bug: #1955627
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit 55edb00cc12ade9df333e9c0a3472e68d797b8f6)
    (cherry picked from commit f1aa5f0744f21cdae9394da00f36cc57ce5e09f0)
    (cherry picked from commit 6781f22bf1d78b89f500f538244d0991152f8e6d)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/manila/+/898488

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 17.1.0

This issue was fixed in the openstack/manila 17.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 15.3.0

This issue was fixed in the openstack/manila 15.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (stable/yoga)

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/yoga
Review: https://review.opendev.org/c/openstack/manila/+/898488
Reason: stable/yoga branch of openstack/manila is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/yoga if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (unmaintained/yoga)

Fix proposed to branch: unmaintained/yoga
Review: https://review.opendev.org/c/openstack/manila/+/909551

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 18.0.0.0rc1

This issue was fixed in the openstack/manila 18.0.0.0rc1 release candidate.

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.