Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1408135

Summary: Customer facing issues when adding Roles in UserGroup + LDAP Filter (LDAP Auth)
Product: Red Hat Satellite Reporter: Waldirio M Pinheiro <wpinheir>
Component: Users & RolesAssignee: Daniel Lobato Garcia <dlobatog>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.2CC: bbuckingham, dhlavacd, dlobatog, ehelms, jcallaha, mhulan, wpinheir, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
URL: http://projects.theforeman.org/issues/17992
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:05:36 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:

Description Waldirio M Pinheiro 2016-12-22 09:17:00 UTC
Description of problem:
When customer try to add some roles in the user group feature receive the error message *we're sorry, but something went wrong*, this happen only when customer define the LDAP filter on ldap auth configuration.

When customer remove the filter, the error message doesn't appear.

Version-Release number of selected component (if applicable):
satellite-6.2.2.1-1.0.el7sat.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Customer sent one video to show the issue, the same will be attached.

Comment 8 Daniel Lobato Garcia 2017-01-09 13:20:12 UTC
We did some debugging and here's what happened. The filter set in the auth source checks that ANY object Satellite contacts, must be in this inheritance tree:

- OU = groups
  - CN = Red Hat Satellite Users

However, it was trying to add a group 'Nimbus Satellite Admins' which is NOT under that inheritance tree (Red Hat Satellite Users). Satellite is able to find the group, but the moment it checks for users, it notices they don't comply with the filter and ldap_fluff fails with an exception.
  
- OU = groups
  - CN = Red Hat Satellite Users
  - CN = Nimbus Satellite Admins 
  
This will not work because the filter checks for the user belonging to "Red Hat Satellite Users", and here Nimbus Satellite Admins does NOT belong to it. (memberOf).

We changed "Nimbus Satellite Admin" to this:
- OU = groups
  - CN = Red Hat Satellite Users
    - CN = Nimbus Satellite Admin
    - CN = whatever other group in satellite

And now it works.

So we're changing the bugzilla to just handle this nicely, and don't merely throw a 500, but explain what happened, by showing an error like:

You tried to add a user group that has users that do not belong to the filter in your LDAP auth source.

Comment 9 Daniel Lobato Garcia 2017-01-09 18:52:43 UTC
Connecting redmine issue http://projects.theforeman.org/issues/17992 from this bug

Comment 10 Satellite Program 2017-01-17 11:09:55 UTC
Upstream bug assigned to dlobatog

Comment 11 Satellite Program 2017-01-17 11:09:59 UTC
Upstream bug assigned to dlobatog

Comment 16 Daniel Lobato Garcia 2017-02-20 19:22:25 UTC
The issue ended up having not much to do with the original thing described here. The filter was fine. Waldirio and I had a call with the customer to figure out the issue: 

1. The Nimbus group could not refresh. 
2. The issue was that the group contained 2 DNs on its list of members:
  - 1 of them as an user
  - the 2nd one was a group
3. When ldap_fluff AD tried to fetch the users, it called find_by_dn on all users of the group:
  - https://github.com/theforeman/ldap_fluff/blob/6d23888fb5ba6175a91da68ce51f6a7fde39f273/lib/ldap_fluff/generic.rb#L49
  - https://github.com/theforeman/ldap_fluff/blob/master/lib/ldap_fluff/active_directory.rb#L33
  - https://github.com/theforeman/ldap_fluff/blob/master/lib/ldap_fluff/generic_member_service.rb#L28 
4. The method raised an UIDNotFoundException, because clearly the DN for the group could not be found as an user.

We provided a hotfix to the customer in which in this situation groups are skipped. I would recommend this to be the behavior on the next implementation as the users can be fetched just fine and the groups can be ignored safely.

I will submit a PR to ignore groups in this situation and release a patch version of ldap_fluff ASAP. I've also disconnected the upstream issue from this ticket as the fix provided to the customer is not related.

Comment 17 Daniel Lobato Garcia 2017-02-20 19:37:34 UTC
https://github.com/theforeman/ldap_fluff/pull/56

Comment 18 Daniel Lobato Garcia 2017-02-23 11:43:28 UTC
This is now released upstream and pending merge downstream.

Comment 21 Peter Ondrejka 2017-11-29 14:27:06 UTC
Verified in Sat6.3 snap 26, using an LDAP auth source with custom filter does not prevent user groups from being edited.

Comment 22 Bryan Kearney 2018-02-21 17:05:36 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:0336

Comment 23 Red Hat Bugzilla 2023-09-15 00:00:52 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days