Bug 1318169

Summary: Tree-root domains in a trusted AD forest aren't marked as reachable via the forest root
Product: Red Hat Enterprise Linux 7 Reporter: Sudhir Menon <sumenon>
Component: ipaAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: Kaleem <ksiddiqu>
Severity: urgent Docs Contact: Aneta Šteflová Petrová <apetrova>
Priority: urgent    
Version: 7.2CC: abokovoy, ekeck, mbabinsk, mkosek, pvoborni, rcritten, sumenon
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ipa-4.4.0-9.el7 Doc Type: Bug Fix
Doc Text:
Tree-root domains in a trusted AD forest are now marked as reachable through the forest root When an Active Directory (AD) forest contained tree-root domains (a separate DNS domain), Identity Management (IdM) sometimes failed to correctly route authentication requests to the tree-root domain's domain controllers. Consequently, users from a tree-root domain failed to authenticate against services hosted in IdM. This update fixes the bug, and users from a tree-root domain can authenticate as expected in this situation.
Story Points: ---
Clone Of:
: 1369103 (view as bug list) Environment:
Last Closed: 2016-11-04 05:52:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 1375269    
Bug Blocks: 1366991, 1369103    
Attachments:
Description Flags
trust console log
none
idrange-sssd logs
none
error log none

Description Sudhir Menon 2016-03-16 08:32:15 UTC
Created attachment 1136927 [details]
trust console log

Description of problem: Tree-root domains in a trusted AD forest aren't marked as reachable via the forest root


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

[root@host2 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.2 (Maipo)

ipa-server-dns-4.2.0-15.el7_2.10.x86_64
ipa-server-trust-ad-4.2.0-15.el7_2.10.x86_64
ipa-server-4.2.0-15.el7_2.10.x86_64
sssd-1.13.0-40.el7_2.2.x86_64

How reproducible:Always

Steps to Reproduce:
1. Setup forest  i.e pne.qe
2. Setup child domain i.e chd.pne.qe
3. Setup a tree domain i.e test.qa
4. Installed IPA. ipa-adtrust-install
5. Setup two-way trust
6. Ensure child domain and tree-root domain is listed.
7. run id <username@tree-rootdomain> on IPA server

Actual results:
"id <username>" when executed on IPA server/client doesn't display users 
present in the tree domain.

[root@host2 ~]# id user5@test.qa
id: user5@test.qa: no such user
[root@host2 ~]# id user6@test.qa
id: user6@test.qa: no such user

Expected results:
id <username> output should display users present in the tree domain as well.

Additional info:
Attaching the console logs and sssd logs.

Comment 1 Sudhir Menon 2016-03-16 08:33:43 UTC
Created attachment 1136929 [details]
idrange-sssd logs

Comment 3 Alexander Bokovoy 2016-03-16 09:12:52 UTC
When analyzing trust topology we fill in ipanttrustpartner value to point to the forest root. Unfortunately, the code actually uses the domain's name, not the forest root domain's name here. It works fine with child domains but doesn't work for tree-root domains within the forest. A fix would be a one-line to change how ipanttrustpartner is filled in. ipaNTTrustPartner value is then used by SSSD in IPA server mode to identify which Kerberos principal to use to talk to the trusted domain's DC.

Comment 6 Petr Vobornik 2016-03-16 09:49:00 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/5738

Comment 14 Sudhir Menon 2016-09-09 13:41:13 UTC
Tree root domain is not listed even after having two-way trust established.
only child domains are listed.
Tried ipa trust-domain-find command as well, which says no trust

Verified on RHEL73 using
ipa-server-4.4.0-10.el7.x86_64
ipa-server-trust-ad-4.4.0-10.el7.x86_64
sssd-1.14.0-36.el7.x86_64


[root@master ~]# ipa trust-add --two-way=true
Realm name: pne.qe
Active Directory domain administrator: Administrator
Active Directory domain administrator's password: 
-----------------------------------------------
Added Active Directory trust for realm "pne.qe"
-----------------------------------------------
  Realm name: pne.qe
  Domain NetBIOS name: PNE
  Domain Security Identifier: S-1-5-21-3912719521-1967590360-1136226524
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified
[root@master ~]# ipa trust-find
---------------
1 trust matched
---------------
  Realm name: pne.qe
  Domain NetBIOS name: PNE
  Domain Security Identifier: S-1-5-21-3912719521-1967590360-1136226524
  Trust type: Active Directory domain
  UPN suffixes: qa.in, qa.io, qa.pne, qa.test, qa.org, test.qa
----------------------------
Number of entries returned 1
----------------------------
[root@master ~]# ipa trustdomain-find
Realm name: pne.qe
  Domain name: chd.pne.qe
  Domain NetBIOS name: CHD
  Domain Security Identifier: S-1-5-21-725505228-2944741108-2454985349
  Domain enabled: True

  Domain name: chd2.pne.qe
  Domain NetBIOS name: CHD2
  Domain Security Identifier: S-1-5-21-1720992857-1892626802-862641562
  Domain enabled: True

  Domain name: pne.qe
  Domain NetBIOS name: PNE
  Domain Security Identifier: S-1-5-21-3912719521-1967590360-1136226524
  Domain enabled: True
----------------------------
Number of entries returned 3
----------------------------

[root@master ~]# ipa trustdomain-find
Realm name: test.qa
ipa: ERROR: test.qa: trust not found

Comment 16 Sudhir Menon 2016-09-12 13:57:58 UTC
Created attachment 1200213 [details]
error log

Comment 18 Petr Vobornik 2016-09-13 15:10:37 UTC
Moving back to ON_QA according to comment 17.

Comment 20 Sudhir Menon 2016-09-16 18:44:53 UTC
Verified on RHEL73 using 

ipa-server-4.4.0-12.el7.x86_64
ipa-server-trust-ad-4.4.0-12.el7.x86_64
sssd-1.14.0-41.el7.x86_64

[root@master ~]# ipa trust-add --two-way=true 
Realm name: pne.qe
Active Directory domain administrator: Administrator
Active Directory domain administrator's password: 
-----------------------------------------------
Added Active Directory trust for realm "pne.qe"
-----------------------------------------------
  Realm name: pne.qe
  Domain NetBIOS name: PNE
  Domain Security Identifier: S-1-5-21-3912719521-1967590360-1136226524
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified

[root@master ~]# ipa idrange-find
----------------
5 ranges matched
----------------
  Range name: CHD.PNE.QE_id_range
  First Posix ID of the range: 632800000
  Number of IDs in the range: 200000
  First RID of the corresponding RID range: 0
  Domain SID of the trusted domain: S-1-5-21-725505228-2944741108-2454985349
  Range type: Active Directory domain range

  Range name: CHD2.PNE.QE_id_range
  First Posix ID of the range: 1786200000
  Number of IDs in the range: 200000
  First RID of the corresponding RID range: 0
  Domain SID of the trusted domain: S-1-5-21-1720992857-1892626802-862641562
  Range type: Active Directory domain range

  Range name: PNE.QE_id_range
  First Posix ID of the range: 558000000
  Number of IDs in the range: 200000
  First RID of the corresponding RID range: 0
  Domain SID of the trusted domain: S-1-5-21-3912719521-1967590360-1136226524
  Range type: Active Directory domain range

  Range name: TEST-RELM.TEST_id_range
  First Posix ID of the range: 539000000
  Number of IDs in the range: 200000
  First RID of the corresponding RID range: 1000
  First RID of the secondary RID range: 100000000
  Range type: local domain range

  Range name: TEST.QA_id_range
  First Posix ID of the range: 330800000
  Number of IDs in the range: 200000
  First RID of the corresponding RID range: 0
  Domain SID of the trusted domain: S-1-5-21-4204873575-1158510886-1449965812
  Range type: Active Directory domain range
----------------------------
Number of entries returned 5
----------------------------

[root@master ~]# ipa trust-find
---------------
1 trust matched
---------------
  Realm name: pne.qe
  Domain NetBIOS name: PNE
  Domain Security Identifier: S-1-5-21-3912719521-1967590360-1136226524
  Trust type: Active Directory domain
  UPN suffixes: qa.org
----------------------------
Number of entries returned 1
----------------------------

[root@master ~]# ipa trustdomain-find
Realm name: pne.qe
  Domain name: chd.pne.qe
  Domain NetBIOS name: CHD
  Domain Security Identifier: S-1-5-21-725505228-2944741108-2454985349
  Domain enabled: True

  Domain name: chd2.pne.qe
  Domain NetBIOS name: CHD2
  Domain Security Identifier: S-1-5-21-1720992857-1892626802-862641562
  Domain enabled: True

  Domain name: pne.qe
  Domain NetBIOS name: PNE
  Domain Security Identifier: S-1-5-21-3912719521-1967590360-1136226524
  Domain enabled: True

  Domain name: test.qa
  Domain NetBIOS name: TEST
  Domain Security Identifier: S-1-5-21-4204873575-1158510886-1449965812
  Domain enabled: True
----------------------------
Number of entries returned 4
----------------------------

Users/Groups from tree-root domain are also resolved
[root@master ~]# id test1@test.qa
uid=330801112(test1@test.qa) gid=330801112(test1@test.qa) groups=330801112(test1@test.qa),330801110(group2@test.qa),330800513(domain users@test.qa)

[root@master ~]# getent group group2@test.qa
group2@test.qa:*:330801110:test1@test.qa,test2@test.qa,test3@test.qa

Comment 24 errata-xmlrpc 2016-11-04 05:52:06 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://rhn.redhat.com/errata/RHBA-2016-2404.html