Bug 1496753 - Viewer could not get serviceinstance
Summary: Viewer could not get serviceinstance
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.7.0
Assignee: Jeff Peeler
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-28 09:43 UTC by Yadan Pei
Modified: 2017-11-28 22:13 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: RBAC rules were not set up properly for the view role. Consequence: Any user with the view role could not get/list/watch any serviceinstances. Fix: Add the proper RBAC rules to the view role. Result: Any user with the view role can now access serviceinstances as expected.
Clone Of:
Environment:
Last Closed: 2017-11-28 22:13:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-29 02:34:54 UTC

Description Yadan Pei 2017-09-28 09:43:55 UTC
Description of problem:
Viewer could not get serviceinstance resources

Version-Release number of selected component (if applicable):
oc v3.7.0-0.131.0
<brew-registry>/openshift3/ose-service-catalog          v3.7                039b461b7213        34 hours ago        348.2 MB

How reproducible:
Always

Steps to Reproduce:
1.User1 create project "test", provision services and create binding on web console, taking Hello World (APB) as an example
$ oc get serviceinstances
NAME                                                       KIND
dh-ansibleplaybookbundle-hello-world-apb-latest-wkb3c      ServiceInstance.v1alpha1.servicecatalog.k8s.io
2.Add user2 with view permission on his project
$ oc policy add-role-to-user view user2 -n test
3.User2 login via CLI, and try "oc get serviceinstances -n test"
$ oc get serviceinstances
Error from server (Forbidden): User "user2" cannot list serviceinstances.servicecatalog.k8s.io in the namespace "test": User "user2" cannot list serviceinstances.servicecatalog.k8s.io in project "test" (get serviceinstances.servicecatalog.k8s.io)


Actual results:
1. serviceinstance is created successfully
3. Error from server (Forbidden): User "user2"  cannot list serviceinstances.servicecatalog.k8s.io in the namespace  "test": User "user2" cannot list serviceinstances.servicecatalog.k8s.io  in project "test" (get serviceinstances.servicecatalog.k8s.io)

Expected results:
3. viewer "user2" should be able to list serviceinstances

Additional info:

Comment 1 Samuel Padgett 2017-09-28 12:33:08 UTC
Related issue: https://github.com/openshift/origin/issues/16585

Comment 2 Gabe Montero 2017-10-05 14:12:29 UTC
Since Simo was assigned 16585, assigning this bugzilla to him as well.  We'll let him decide if we need to carry both issues (they seem to be the same root cause on the surface).

Or reassign if I have misread things :-)

CC:ing a few potentially interested parties as well.

Comment 3 Simo Sorce 2017-10-06 12:38:52 UTC
Reassigning, this is Service Catalog territory

Comment 4 Ben Parees 2017-10-10 13:49:48 UTC
Paul, this is blocking acceptance of a 3.7 trello card.  Can you find someone to make these changes?

Comment 5 Paul Morie 2017-10-11 18:10:34 UTC
This should actually be fixed in master now.

Comment 6 Yadan Pei 2017-10-13 09:40:58 UTC
Checked on v3.7.0-0.143.3
brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/ose-service-catalog   v3.7                3327e47e8acc        18 hours ago        348.2 MB

1. User "yapei" provision service successfully in project/yapei-test
# oc get serviceinstance -n yapei-test
NAME                        KIND
dh-hello-world-apb-m1kqw    ServiceInstance.v1alpha1.servicecatalog.k8s.io

2. Add view role to user "yapeiview" on project/yapei-test
# oc get rolebinding -n yapei-test
NAME                    ROLE                    USERS       GROUPS                              SERVICE ACCOUNTS   SUBJECTS
view                    /view                   yapeiview    

3. User "yapeiview" login and check serviceinstance
# oc login --server=<server> ......
Username: yapeiview
Password: 
Login successful.

You have one project on this server: "yapei-test"

Using project "yapei-test".
Welcome! See 'oc help' to get started.

# oc get serviceinstance 
Error from server (Forbidden): User "yapeiview" cannot list serviceinstances.servicecatalog.k8s.io in the namespace "yapei-test": User "yapeiview" cannot list serviceinstances.servicecatalog.k8s.io in project "yapei-test" (get serviceinstances.servicecatalog.k8s.io)


The issue still reproduce, assign back

Comment 7 Paul Morie 2017-10-13 16:44:35 UTC
Apologies; I realize now that I have misunderstood this bug.

Jeff, we will need to add code to pkg/oc/bootstrap/docker/openshift/servicecatalog.go that alters the view role to add list/get/watch permissions on serviceinstances and servicebindings.

Comment 8 Jeff Peeler 2017-10-13 20:40:02 UTC
https://github.com/openshift/origin/pull/16872

Comment 9 Jeff Peeler 2017-10-20 14:43:05 UTC
PR has been merged

Comment 11 Yadan Pei 2017-10-31 10:02:27 UTC
Waiting for fix in bug 1506976 merged to verify this bug

Comment 12 Yadan Pei 2017-11-03 09:39:39 UTC
Checked on v3.7.0-0.190.0

registry.reg-aws.openshift.com:443/openshift3/ose-service-catalog   v3.7.0-0.190.0      2a40aff211de        16 hours ago        266 MB

User with 'view' role could watch ServiceInstances on web console & CLI

$ oc policy add-role-to-user view <user> -n <project>


Move to VERIFIED

Comment 16 errata-xmlrpc 2017-11-28 22:13:20 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, 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-2017:3188


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