This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2127089 - Satellite removes users from groups if the membership uses uniqueMember
Summary: Satellite removes users from groups if the membership uses uniqueMember
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Authentication
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
: 2153529 2185681 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-15 10:12 UTC by Evgeni Golov
Modified: 2024-06-13 11:03 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-06 12:31:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   SAT-21129 0 None Migrated None 2024-06-06 12:31:12 UTC
Red Hat Knowledge Base (Solution) 7006861 0 None None None 2024-05-09 14:14:48 UTC

Description Evgeni Golov 2022-09-15 10:12:07 UTC
Description of problem:
I have a Satellite system that consumes a rather interesting LDAP tree for obtaining its users.

The config is roughly:
type: POSIX
baseDN: ou=users,dc=redhat,dc=com
groupBaseDN: dc=redhat,dc=com
usergroup_sync: true

Now, the groups come from two sub-trees (and that's why the above group base is so broad): ou=Groups,dc=redhat,dc=com and ou=adhoc,ou=managedGroups,dc=redhat,dc=com.

The first one is a rather normal thing full of posixGroups like this:
dn: cn=desingh,ou=Groups,dc=redhat,dc=com
memberUid: desingh
gidNumber: 105596
cn: desingh
objectClass: top
objectClass: posixGroup

The second one is dynamically generated from an external app, and looks like this (abbreviated):
dn: cn=satellite-qe,ou=adhoc,ou=managedGroups,dc=redhat,dc=com
uniqueMember: uid=desingh,ou=users,dc=redhat,dc=com
owner: uid=desingh,ou=users,dc=redhat,dc=com
description: Groups consists members from Satellite QE team
cn: satellite-qe
objectClass: groupOfUniqueNames
objectClass: top

Now, as you can see, the user "desingh" is member of both these groups.

In Satellite, I have an external usergroup "satellite-qe" that is linked to cn=satellite-qe,ou=adhoc,ou=managedGroups,dc=redhat,dc=com.
When I hit "refresh" in the UI (or run the "ldap:refresh_usergroups" cronjob), the user "desingh" is listed as being a member of this external group and everything is fine.

However, once the user logs in, an additional group sync is performed and the user is loosing this additional group (and all permissions inherited by it).

This seems to be because the "group_list(user)" method doesn't find the qe group:
irb(main):012:0> l = AuthSource.find_by(name: 'Red Hat')
=> #<AuthSourceLdap id: 4, type: "AuthSourceLdap", name: "Red Hat", ...
irb(main):013:0> l.ldap_con.group_list('desingh')
=> ["desingh"]

I think this is because the underlying library is only looking for "memberuid", but not "uniquemember" relationships (https://github.com/theforeman/ldap_fluff/blob/master/lib/ldap_fluff/posix_member_service.rb):
  def find_user_groups(uid)
    groups = []
    @ldap.search(:filter => Net::LDAP::Filter.eq('memberuid', uid), :base => @group_base).each do |entry|
      groups << entry[:cn][0]
    end
    groups
  end

However, the "other way round" (find all members of a group), *does* support looking up by uniquemember, resulting in this discrepancy:
  def select_member_method(search_result)
    if @use_netgroups
      :nisnetgrouptriple
    else
      %i[member memberuid uniquemember].find { |m| search_result.respond_to? m }
    end
  end

Given support for groupOfUniqueNames was explicitly introduced in https://github.com/theforeman/ldap_fluff/commit/14f0d0fdeb3205d4e9b6b5afc6a2b5ccc74e2f6b, I would think this is a bug and find_user_groups should be able to find the same data.


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

How reproducible:
100%

Steps to Reproduce:
1. setup ldap source
2. setup a group based on groupOfUniqueNames
3. let a user of such a group log in
4. refresh the group
5. let the user login again

Actual results:
User not member of group

Expected results:
User member of group

Additional info:

Comment 1 Brad Buckingham 2023-10-04 21:43:14 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 3 Brad Buckingham 2023-11-02 17:09:33 UTC
Based upon feedback during auto-closure, leaving this bugzilla open a while longer for additional investigation; however, it may be closed in a future iteration.

Comment 5 Adam Ruzicka 2024-05-09 14:12:58 UTC
*** Bug 2185681 has been marked as a duplicate of this bug. ***

Comment 6 Adam Ruzicka 2024-05-09 14:14:49 UTC
*** Bug 2153529 has been marked as a duplicate of this bug. ***

Comment 7 Adam Ruzicka 2024-05-09 14:41:02 UTC
A note after looking at several BZs in this area:
RHDS/389DS seems to use uniqueMember-groupOfUniqueNames attributes to represent user-group relationships. This however deviates from the posix standard per rfc2307 that Satellite expects. A similar situation happens when the LDAP server uses member-groupOfNames attributes. uniqueMember-groupOfUniqueNames and member-groupOfNames come from rfc4519 and while it is true that code for this was explicitly added into ldap_fluff, the implementation is only partial. The discussion on the upstream PR steers us towards either having a completely new flavor of ldap or at least exposing these extensions in a similar way to how we allow the use of nis netgroups.

Comment 8 Eric Helms 2024-06-06 12:31:13 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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