RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1765246 - Impossible to enforce GID on the AD's "domain users" group in the IPA-AD trust setup
Summary: Impossible to enforce GID on the AD's "domain users" group in the IPA-AD trus...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd
Version: 7.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pavel Březina
QA Contact: ipa-qe
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-24 15:34 UTC by Ming Davies
Modified: 2023-03-24 15:57 UTC (History)
14 users (show)

Fixed In Version: sssd-1.16.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-29 19:49:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 5085 0 None closed Impossible to enforce GID on the AD's "domain users" group in the IPA-AD trust setup 2021-01-26 08:03:08 UTC
Red Hat Issue Tracker SSSD-2358 0 None None None 2023-03-24 15:57:20 UTC
Red Hat Product Errata RHBA-2020:3904 0 None None None 2020-09-29 19:49:41 UTC

Description Ming Davies 2019-10-24 15:34:52 UTC
Description of problem:
It' impossible to enforce GID on the AD's "domain users" group in the IPA-AD trust setup. This is one of the requirements for replacing an existing software with sssd for AD integration.


Version-Release number of selected component (if applicable):
sssd: 1.16.4-21
ipa: 4.6.5.11


How reproducible:
The issue can easily be reproduced.


Steps to Reproduce:
*******************
On the IPA server
*******************
- Create a one way trust between AD and IPA
- Create an AD user
# id -a 'AD\amorgan'
uid=130801107(amorgan.com) gid=130801107(amorgan.com) groups=130801107(amorgan.com),130801111(managers.com),130800513(domain users.com)

- Create a mapping
# ipa idoverridegroup-add 'Default Trust View' "domain users.com" --gid=40000000
--------------------------------------------------------
Added Group ID override "domain users.com"
--------------------------------------------------------
  Anchor to override: domain users.com
  GID: 40000000

- Stop the sssd, clear the cache, restart the sssd

- Attempt to retrieve the user again:
# id -a 'AD\amorgan'
uid=130801107(amorgan.com) gid=130801107(amorgan.com) groups=130801107(amorgan.com),130801111(managers.com),40000000(domain users.com),130800513
<<<<Notice that the "domain users.com" has two gids, 40000000(new gid) and 130800513(old gid)


*******************
On the IPA client
*******************
id -a 'AD\amorgan' cannot no longer find the user on the IPA client despite stopping sssd, clear the cache and restart sssd.

- Delete the existing mapping on the IPA server, stop sssd, clear the cache and restart sssd on both IPA server and IPA client, all works again.

*******************
On the IPA server
*******************
- Create a new AD group called "Special Users" and assigned the user amorgan to the group.
# id -a 'AD\amorgan'
uid=130801107(amorgan.com) gid=130801107(amorgan.com) groups=130801107(amorgan.com),130801133(special users.com),130801111(managers.com),130800513(domain users.com)

- Create a new mapping
# ipa idoverridegroup-add 'Default Trust View' "Special Users.com" --gid=40000000
---------------------------------------------------------
Added Group ID override "Special Users.com"
---------------------------------------------------------
  Anchor to override: special users.com
  GID: 40000000

- Able to retrieve the user on the IPA server after stopping sssd, clearing the cache and restart the sssd service:
# id -a 'AD\amorgan'
uid=130801107(amorgan.com) gid=130801107(amorgan.com) groups=130801107(amorgan.com),40000000(special users.com),130801111(managers.com),130800513(domain users.com)


*******************
On the IPA client
*******************
'id -a 'AD\amorgan' worked equally fine on  the IPA client, so the white space between the groupname is not the issue.

Actual results:


Expected results:


Additional info:

Comment 3 Pavel Březina 2019-12-02 13:15:27 UTC
Upstream ticket:
https://pagure.io/SSSD/sssd/issue/4124

Comment 5 Pavel Březina 2019-12-03 11:46:53 UTC
The problem is that Domain Users is also user's primary group (primaryGroupID attribute is 513). This is then converted to linux gid (= 130800513) in sdap_get_idmap_primary_gid() during sdap_save_user() and return as user's primary group in nss_protocol_fill_initgr().

Obviously, we should return overriden value (= 40000000) instead of original value (= 130800513).

Comment 6 Pavel Březina 2019-12-03 12:39:25 UTC
Upstream PR:
https://github.com/SSSD/sssd/pull/954

Comment 8 Michal Zidek 2019-12-14 01:24:39 UTC
master:
03bc962

sssd-1-16
80e6f71

Comment 18 Bijesh Thekkepat 2020-04-23 06:02:41 UTC
Hello,

Apologies for late reply.

||Do you still need RHEL8 scratch-build? If so please provide sssd package version customer is currently using.
--> Scratch built is not required. Customer is keeping track of bugzilla #1649464

Thanks,
Bijesh T.

Comment 21 anuja 2020-06-22 14:07:13 UTC
*************************************************************************************
Reproduced Using comment #0 and comment #20 :
sssd-1.16.4-21.el7_7.3.x86_64
ipa-server-4.6.5-11.el7_7.4.x86_64
*************************************************************************************
[root@master ~]# rm -rf /var/lib/sss/{db,mc}/* ; systemctl restart sssd ; date
Mon Jun 22 09:11:28 EDT 2020
[root@master ~]# id testuser
uid=1864601108(testuser) gid=1864601108(testuser) groups=1864601108(testuser),1864600513(domain users),1864601111(testgroup)
[root@master ~]# date
Mon Jun 22 09:11:38 EDT 2020
[root@master ~]# 
[root@master ~]# ipa idoverridegroup-add 'Default Trust View' "domain users" --gid=4000076
----------------------------------------------
Added Group ID override "domain users"
----------------------------------------------
  Anchor to override: domain users
  GID: 4000076
[root@master ~]# rm -rf /var/lib/sss/{db,mc}/* ; systemctl restart sssd ; date
Mon Jun 22 09:12:41 EDT 2020
[root@master ~]# id testuser ; date
uid=1864601108(testuser) gid=1864601108(testuser) groups=1864601108(testuser),4000076(domain users),1864601111(testgroup),1864600513
Mon Jun 22 09:12:48 EDT 2020

*******************************************************
[root@client ~]# rm -rf /var/lib/sss/{db,mc}/* ; systemctl restart sssd; date
Mon Jun 22 09:11:48 EDT 2020
[root@client ~]# id testuser ; date
uid=1864601108(testuser) gid=1864601108(testuser) groups=1864601108(testuser),1864601111(testgroup),1864600513(domain users)
Mon Jun 22 09:11:54 EDT 2020
[root@client ~]# rm -rf /var/lib/sss/{db,mc}/* ; systemctl restart sssd; date
Mon Jun 22 09:13:00 EDT 2020
[root@client ~]# id testuser ; date
id: testuser: no such user
Mon Jun 22 09:13:05 EDT 2020

*************************************************************************************
Verified using version:
sssd-1.16.5-10.el7.x86_64
ipa-client-4.6.8-5.el7.x86_64
************************************************************************************
[root@master ~]# service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start;  date
Redirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service
Mon Jun 22 09:32:24 EDT 2020
[root@master ~]# id testuser ; date
uid=360801108(testuser) gid=360801108(testuser) groups=360801108(testuser),360800513(domain users),360801111(testgroup)
Mon Jun 22 09:32:30 EDT 2020
[root@master ~]# 
[root@master ~]# ipa idoverridegroup-add 'Default Trust View' "domain users" --gid=4000079
----------------------------------------------
Added Group ID override "domain users"
----------------------------------------------
  Anchor to override: domain users
  GID: 4000079
[root@master ~]#  rm -rf /var/lib/sss/{db,mc}/* ; systemctl restart sssd ; date
Mon Jun 22 09:33:27 EDT 2020
[root@master ~]# id testuser ; date
uid=360801108(testuser) gid=360801108(testuser) groups=360801108(testuser),4000079(domain users),360801111(testgroup)
Mon Jun 22 09:33:31 EDT 2020
***********************************************
[root@client ~]# service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start;  date
Redirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service
Mon Jun 22 09:33:04 EDT 2020
[root@client ~]# id testuser ; date
uid=360801108(testuser) gid=360801108(testuser) groups=360801108(testuser),360801111(testgroup),360800513(domain users)
Mon Jun 22 09:33:12 EDT 2020
[root@client ~]# 
[root@client ~]# service sssd stop; rm -rf /var/lib/sss/{db,mc}/*; service sssd start;  date
Redirecting to /bin/systemctl stop sssd.service
Redirecting to /bin/systemctl start sssd.service
Mon Jun 22 09:34:23 EDT 2020
[root@client ~]# id testuser ; date
uid=360801108(testuser) gid=360801108(testuser) groups=360801108(testuser),360801111(testgroup),4000079(domain users)
Mon Jun 22 09:34:28 EDT 2020

In fixed version only gid from idview is listed.
Based on this marking bz as verified.

Comment 23 errata-xmlrpc 2020-09-29 19:49:11 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 (sssd bug fix and enhancement update), 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/RHBA-2020:3904


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