Bug 1384035

Summary: Create permissions do not check filter limits
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Users & RolesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bkearney, dhlavacd, dzhukous, mhulan, sauchter, spetrosi
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Satellite 6.4 introduces tighter restrictions around resource filter limitations. In previous versions of Satellite, the search query applied incorrect permissions to resources, which allowed users to perform tasks that were not permitted. This is now fixed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:28:34 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: 1316897, 1373844    

Description Jitendra Yejare 2016-10-12 12:06:13 UTC
Description of problem:
The user is able to create resource in taxonomies which were not added/associated to resource filter of role.

Version-Release number of selected component (if applicable):
Satellite 6.3 snap 3.0

How reproducible:
Always

Steps to Reproduce:
1. Create role with Organization A and Location A taxonomies.
2. Create a filter for resource type for which taxonomies can be applied and without overriding it.
e.g Domain Filter
3. Create a new user with different taxonomies than above role. Suppose Organization B and Location B.
4. Assign the role to user.
6. Login with new user.
5. Attempt to create a domain(or any resource type filter added in role) in user taxonomies(which are not the same as filter taxonomies).


Actual results:
1. Create permission is not honoring the resourse filter limits.
2. The resource is created in the user associated taxonomies which are not permitted by resource filter.

Expected results:
1.Create permissions should check filter limits.
2. The resource should not be created by user in taxonomies to which filter doesn't gives permission.
3. Some informative message should be displayed for unable to create resource due to no permissions from resource filter end.

Additional info:

Comment 1 Marek Hulan 2016-10-12 12:28:37 UTC
Created redmine issue http://projects.theforeman.org/issues/16884 from this bug

Comment 3 Bryan Kearney 2016-11-03 08:20:39 UTC
Upstream bug assigned to mhulan

Comment 4 Bryan Kearney 2016-11-03 08:20:41 UTC
Upstream bug assigned to mhulan

Comment 5 Marek Hulan 2017-01-09 09:48:43 UTC
*** Bug 1410929 has been marked as a duplicate of this bug. ***

Comment 9 Satellite Program 2017-07-20 16:02:35 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16884 has been resolved.

Comment 10 Jitendra Yejare 2017-08-17 12:54:18 UTC
This bug appears in latest Satellite 6.3 Snap 11. We want this to be added in recent snaps asap as creating something outside permissions seems malfunctioning and security concern as well.

Comment 12 Jitendra Yejare 2017-09-07 07:55:49 UTC
Even view permission from Hammer are not checking filter limits.

One of my user neither have permission for suppose Org B nor from its associated role, but still, the user can list products, domains, etc in Org B.

Comment 13 Jitendra Yejare 2017-09-07 07:56:22 UTC
Should I create a new Bug for comment 12 behavior ?

Comment 14 Marek Hulan 2017-09-11 09:37:07 UTC
No, hammer does not have any permission checks in it, permissions are checked on server side in API controllers so that's the same issue.

Comment 15 Marek Hulan 2017-10-12 07:26:15 UTC
*** Bug 1501127 has been marked as a duplicate of this bug. ***

Comment 18 Jitendra Yejare 2018-08-01 15:12:42 UTC
Verified !

@ Satellite 6.4 snap 14 - CLI and API


Steps:

1. Create role with Organization A and Location A taxonomies.
2. Create a filter for resource type for which taxonomies can be applied and without overriding it.
e.g Domain Filter
3. Create a new user with different taxonomies than above role. Suppose Organization B and Location B.
4. Assign the role to user.
6. Login with new user.
5. Attempt to create a domain(or any resource type filter added in role) in user taxonomies(which are not the same as filter taxonomies).


Observation:

1.Create permissions is checking filter limits.
2. The resource is not being created by user in taxonomies to which filter/role doesn't gives permission.
3. The error message is displayed for unable to create resource due to no permissions from resource filter end.
Thats is : 
Invalid organizations selection, you must select at least one of yours and have 'assign_organizations' permission.
and
Invalid locations selection, you must select at least one of yours and have 'assign_locations' permission.

Comment 19 Bryan Kearney 2018-10-16 19:28:34 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-2018:2927