Bug 1817219

Summary: Impossible to enforce GID on the AD's "domain users" group in the IPA-AD trust setup
Product: Red Hat Enterprise Linux 8 Reporter: Alexey Tikhonov <atikhono>
Component: sssdAssignee: Pavel Březina <pbrezina>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: grajaiya, jhrozek, lslebodn, mniranja, mzidek, pbrezina, sgoveas, thalman, tscherf
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: sssd-2.3.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:04:37 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 Alexey Tikhonov 2020-03-25 20:09:15 UTC
This bug was initially created as a copy of Bug #1765246

I am copying this bug to track fix in RHEL8



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 1 Alexey Tikhonov 2020-03-25 20:14:47 UTC
master:
03bc962

sssd-1-16
80e6f71

Comment 4 Niranjan Mallapadi Raghavender 2020-08-05 02:40:06 UTC
Versions:

Server:
ipa-server-dns-4.8.7-7.module+el8.3.0+7376+c83e4fcd.noarch
ipa-server-4.8.7-7.module+el8.3.0+7376+c83e4fcd.x86_64
ipa-server-trust-ad-4.8.7-7.module+el8.3.0+7376+c83e4fcd.x86_64
ipa-server-common-4.8.7-7.module+el8.3.0+7376+c83e4fcd.noarch
sssd-ipa-2.3.0-6.el8.x86_64



Client:
ipa-client-4.8.7-7.module+el8.3.0+7376+c83e4fcd.x86_64
ipa-client-common-4.8.7-7.module+el8.3.0+7376+c83e4fcd.noarch
sssd-client-2.3.0-6.el8.x86_64
sssd-common-pac-2.3.0-6.el8.x86_64
sssd-ipa-2.3.0-6.el8.x86_64
sssd-tools-2.3.0-6.el8.x86_64
sssd-nfs-idmap-2.3.0-6.el8.x86_64
sssd-kcm-2.3.0-6.el8.x86_64
sssd-common-2.3.0-6.el8.x86_64
sssd-dbus-2.3.0-6.el8.x86_64
sssd-krb5-common-2.3.0-6.el8.x86_64


IPA Server
==========
[root@server ~]# ipa idviepa idoverridegroup-add ^C
[root@server ~]# ipa idoverridegroup-add 'Default Trust View'  "domain users" --gid=40000000
--------------------------------------------------
Added Group ID override "domain users"
--------------------------------------------------
  Anchor to override: domain users
  GID: 40000000
[root@server ~]# systemctl stop sssd
[root@server ~]#  date; rm -rf /var/log/sssd/*  /var/lib/sss/{mc,db}/*
Wed Aug  5 07:52:22 IST 2020
[root@server ~]# systemctl start sssd
[root@server ~]# id -a foobar2
uid=1346401110(foobar2) gid=1346401110(foobar2) groups=1346401110(foobar2),40000000(domain users),1346401112(foobargroup2)


IPA 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
Wed Aug  5 08:06:03 IST 2020
[root@client ~]# id foobar2
uid=1346401110(foobar2) gid=1346401110(foobar2) groups=1346401110(foobar2),1346401112(foobargroup2),40000000(domain users)
[root@client ~]# 


The gid from GID override can is the gid of Domain Users.

Comment 7 errata-xmlrpc 2020-11-04 02:04:37 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:4569