Bug 1824911
Summary: | PersistentVolume yaml editor is read-only with system:persistent-volume-provisioner ClusterRole | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Eric Fried <efried> |
Component: | Management Console | Assignee: | Samuel Padgett <spadgett> |
Status: | CLOSED ERRATA | QA Contact: | Xiyun Zhao <xiyuzhao> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.3.0 | CC: | afrahman, aos-bugs, jokerman, nthomas, rhamilto, spadgett, yapei |
Target Milestone: | --- | Flags: | xiyuzhao:
needinfo-
|
Target Release: | 4.8.0 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | 4.8.0-0.nightly-2021-04-09-222447 | Doc Type: | Bug Fix |
Doc Text: |
The web console YAML editor was incorrectly set to read-only mode when a user had permission to create a resource, but not permission to edit it. The editor content is now correctly editable when the user has create access for the resource.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2021-07-27 22:32:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1942027 |
Description
Eric Fried
2020-04-16 16:17:50 UTC
Reassigning to Console Storage Plugin since they own this functionality. Low priority issue, moving to 4.6 Moving out to 4.8 Hello Eric. I don't have access to some of the resources (namely OSD cluster, Openshift_SRE credentials, and the apiGroup privileges) that are described in your aforementioned comment, hence I'm unable to reproduce this on my machine. Would it be possible for you to grant me testing access to them (or a similar environment that depicts your bug successfully, maybe a VM?) so that I can take a look at what may be causing this bug? This is a generic issue, it happens with all the resources. Moving it to Management Console. Will investigate next sprint. Reassigning to Jakub since he's better equipped to fix RBAC issues. Can you confirm you can edit the resource via the CLI? We rely on self-subject access reviews to determine if the editor should be read-only. Note that you need `update` authority on the resource, not just `patch`. I've spun up a fresh cluster to test this. Let me know if you would like access to poke around.
> Can you confirm you can edit the resource via the CLI?
Indeed, I cannot edit PVs (in the UI or CLI) as the system:persistent-volume-provisioner clusterrole does not have PV patch or update permissions:
```
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- create
- delete
- get
- list
- watch
```
When I add those permissions to the clusterrole and reload the console, the editor becomes writable (and editing via the CLI becomes possible).
So it sounds like the bug is that the editor in the "Create" page should rely on the `create` verb rather than `update`/`patch`.
Yeah, I see the problem. You're right: we're incorrectly checking update permission when creating a resource via the YAML editor. @Samuel Padgett I think the action of 'create' verb for the role is still doesn't have the proper behavior, ping me if there is any misunderstanding here. On current behavior, normal user will not able to create PV only after actions of '-update' and '-patch' verb are granted to related Role once. Build version: 4.8.0-0.nightly-2021-04-09-222447 Verify steps: 1. Login to the OCP as administrator. 2. Create a Groups with a normal user 3. Create a RoleBindings for the Group with name (system:persistent-volume-provisioner-for-sre) and Role ref (system:persistent-volume-provisioner) 4. Checking Rules of Role red(syste:persistent-volume-provisioner), make sure only create, delete, get, list, watch actions has been granted to the Resources (persistentvolumes) 5. Re-login the OCP as a normal user testuser0 6. Verify if user is able to create PV on page, and check if 'Create PersistentVolume' button is showable and workable Issue: the 'Create PersistentVolume' button is showable, but block/unable for click 7. Re-login the OCP as admin 8. Add - update and - patch actions for persitentvolumes resources for roles of system:persistent-volume-provisioner 9. Re-login OCP as normal user testuser0 10. Verify if user is able to create/edit PV on page normally. then remove all created PV. 11. Re-login OCP as admin, remove -update and -patch actions for persitentvolumes resources for roles of system:persistent-volume-provisioner. 12. Re-login as normal user 13. Verify if user is able to create/edit PV normally. Result: 1. For Step6: User is unable to create PV even if 'create' actions is granted, the 'Create PersistentVolume' button is showable, but block for create. 2. For Step 10 & 13: user is able to create and edit PV normally. What you're seeing looks like an unrelated issue where the "getting started" message is displaying because the user hasn't created a project yet. After I create a project, I am able to create the PersistentVolume. The original bug was specifically that the YAML editor was read-only, which was the scope of the bug fix. We can track the other "getting started" behavior in a separate bug. It's currently working as designed, but it does block you from doing some things until you create a project. Moving back to ON_QA. @Samuel Padgett, yes, you're right, thanks for your information. Bug has been verified and fixed on payload 4.8.0-0.nightly-2021-04-09-222447 Verify Step: 1. Login to the OCP as administrator. 2. Create a Groups with a normal user 3. Create a RoleBindings for the Group with name (system:persistent-volume-provisioner-for-sre) and Role ref (system:persistent-volume-provisioner) 4. Checking Rules of Role red(syste:persistent-volume-provisioner), make sure only create, delete, get, list, watch actions has been granted to the Resources (persistentvolumes) 5. Re-login the OCP as a normal user testuser0, create a new project 6. Navigate to page of PV, verify if user is able to create PV on page, and check if 'Create PersistentVolume' button is showable. 7. Re-login the OCP as admin 8. Add - update and - patch actions for persitentvolumes resources for roles of system:persistent-volume-provisioner 9. Re-login OCP as normal user testuser0 10. Verify if user is able to edit PV on page normally 11. Login OCP by using CLI, use below command to create PV, verify if user could create PV successfully by using CLI. oc create -f testpv $ cat testpv apiVersion: v1 kind: PersistentVolume metadata: name: example spec: capacity: storage: 5Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain storageClassName: slow nfs: path: /tmp server: 172.17.0.2 Result: 1. For step 6: user is able to create PV successfully 2. For step 10: user is able to edit and update PV successfully, YAML is editable. 3. For step 11: user is able to create PV by using CLI successfully Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:2438 |