Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-22557

[S-RBAC] Regular user can't never send project_id in request body, even with custom policy rules which allows that

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • openstack-neutron
    • None
    • Important

      With S-RBAC policies, by default it is of course forbidden for regular users to create resources, like e.g. networks for different project. Only users with admin and service roles can send project_id in request body. This is verified in https://github.com/openstack/neutron-lib/blob/3c6e404c23596411d51c42edf93b3df9948034ed/neutron_lib/api/attributes.py#L25-L32

      Generally it is ok, but there may be case when operator wants to configure custom role like e.g. "network_admin" who should have granted permission to create networks on behalf of every project. Today this is not possible due to this hardcoded check.

      I propose to add new rule in policy file, something like "context_can_override_project" which by default would be granted to nobody but could be then configured differently in the policy.yaml file by operator. This role would be also checked in https://github.com/openstack/neutron-lib/blob/3c6e404c23596411d51c42edf93b3df9948034ed/neutron_lib/api/attributes.py#L25-L32
      This solution would be similar to solution for bug https://github.com/openstack/neutron-lib/blob/3c6e404c23596411d51c42edf93b3df9948034ed/neutron_lib/api/attributes.py#L25-L32 fixed with https://review.opendev.org/c/openstack/neutron-lib/+/954054

              Unassigned Unassigned
              skaplons@redhat.com Slawomir Kaplonski
              rhos-dfg-networking-squad-neutron
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: