Bug 2140534 - [View only] it should give a permission error when user clicking the VNC play/connect button as a view only user
Summary: [View only] it should give a permission error when user clicking the VNC play...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.12.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.12.0
Assignee: Dana Orr
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-07 05:12 UTC by Guohua Ouyang
Modified: 2023-01-24 13:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-24 13:41:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
view only user to visit VM VNC console (197.60 KB, image/png)
2022-11-07 05:12 UTC, Guohua Ouyang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt-ui kubevirt-plugin pull 959 0 None open Bug 2140534: Disable VNC play button and the standalone view button in overview tab 2022-11-09 13:30:05 UTC
Red Hat Issue Tracker CNV-22304 0 None None None 2022-11-07 06:07:36 UTC
Red Hat Product Errata RHSA-2023:0408 0 None None None 2023-01-24 13:41:58 UTC

Description Guohua Ouyang 2022-11-07 05:12:33 UTC
Created attachment 1922658 [details]
view only user to visit VM VNC console

Description of problem:
It should give a permission error when user click VNC play or VNC connect button for view only user.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. create a running vm in a project
2. create a non-admin user and assign view only permission to the project
$ oc adm policy add-role-to-user view test -n default
3. view the VM VNC console

Actual results:
nothing happens when clicking the VNC play button 

Expected results:
Give an error like the command line:
$ virtctl vnc -n ecosystem-engineering centos-stream8-slight-hamster
Can't access VMI centos-stream8-slight-hamster: virtualmachineinstances.subresources.kubevirt.io "centos-stream8-slight-hamster" is forbidden: User "dkenigsb" cannot get resource "virtualmachineinstances/vnc" in API group "subresources.kubevirt.io" in the namespace "ecosystem-engineering"

Additional info:

Comment 1 Guohua Ouyang 2022-11-07 05:48:48 UTC
Instead of giving errors for specific action, I think it would be better to disable these active element for the view only user.
So I logged a bug to review all active elements on VM and Template pages: https://bugzilla.redhat.com/show_bug.cgi?id=2140539
If we prefer to do it in bug 2140539, this one can be closed.

Comment 2 Guohua Ouyang 2022-11-23 04:47:48 UTC
verified on v4.12.0-172

Comment 6 errata-xmlrpc 2023-01-24 13:41:51 UTC
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 (Important: OpenShift Virtualization 4.12.0 Images 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-2023:0408


Note You need to log in before you can comment on or make changes to this bug.