Bug 1703789 - [free-stg] Rolebinding should be restricted for the common user
Summary: [free-stg] Rolebinding should be restricted for the common user
Keywords:
Status: VERIFIED
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Website
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Justin Pierce
QA Contact: Justin Pierce
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-28 10:33 UTC by tzhou
Modified: 2023-05-15 19:01 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-29 19:21:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description tzhou 2019-04-28 10:33:51 UTC
Description of problem: 
The role binding is restricted, should not added to other group by default.

Version-Release number of selected component (if applicable):
Kubernetes Master Version    v1.13.4+81fc896

How reproducible:
always

Steps to Reproduce:
1.Log in to the https://console-openshift-console.apps.stg-2.online-starter.openshift.com
2.Add a view role to another group,e.g: $ oc policy add-role-to-group view groupA

Actual results:
Role added successfully

Expected results:
The role "view" could not be granted.
Reason: rolebindings "view" is forbidden: rolebindings to Group "groupA" are not allowed in project "xxx"

Additional info:
Same issue not only on Group, also found on ServiceAccount and User

Comment 2 Justin Pierce 2019-04-29 21:28:32 UTC
After looking at 1684344 for a bit, we determined we could workaround this issue in online environments using a validating webhook. It has been installed in stg-2 and added to source control for subsequent clusters. Please take another look. At present, the following error should result:

$ oc policy add-role-to-group view groupA
Error from server: admission webhook "validate.rolebinding.update" denied the request: Prohibited rolebinding

Comment 3 tzhou 2019-05-05 10:03:46 UTC
Thanks Justin, Yes, At present, the following error result:

$ oc policy add-role-to-group view groupA
Error from server: admission webhook "validate.rolebinding.update" denied the request: Prohibited rolebinding

ServiceAccount and User are the same.


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