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 1827729 - subdomain lookup fails when certmaprule contains DN
Summary: subdomain lookup fails when certmaprule contains DN
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Sumit Bose
QA Contact: ipa-qe
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-24 16:18 UTC by Alexey Tikhonov
Modified: 2020-11-04 02:09 UTC (History)
9 users (show)

Fixed In Version: sssd-2.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 02:05:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 4730 0 None closed subdomain lookup fails when certmaprule contains DN 2021-01-14 15:09:50 UTC
Github freeipa/freeipa/blob/ipa-4-8/ipatests/test_integration/test_sssd.py#L452 0 None None None 2020-08-25 06:31:56 UTC
Red Hat Product Errata RHBA-2020:4569 0 None None None 2020-11-04 02:05:21 UTC

Description Alexey Tikhonov 2020-04-24 16:18:49 UTC
This bug was initially created as a copy of Bug #1568083

I am copying this bug because: to track fix for RHEL8



Description of problem:

I'm seeing AD Trust lookups fail when I have certmaprules using DNs for the rule names.

#  Start with a working AD Trust in IPA:

[root@rhel7-1 ~]# id aduser1
uid=1627001114(aduser1) gid=1627001114(aduser1) groups=1627001114(aduser1),1627000513(domain users)

[root@rhel7-1 ~]# ipa certmaprule-add 'CN=adca,DC=ad,DC=test' --maprule='(userCertificate;binary={cert!bin})' --matchrule='<ISSUER>CN=adca,DC=ad,DC=test' --domain=ipa2.test
---------------------------------------------------------------
Added Certificate Identity Mapping Rule "CN=adca,DC=ad,DC=test"
---------------------------------------------------------------
  Rule name: CN=adca,DC=ad,DC=test
  Mapping rule: (userCertificate;binary={cert!bin})
  Matching rule: <ISSUER>CN=adca,DC=ad,DC=test
  Domain name: ipa2.test
  Enabled: TRUE

[root@rhel7-1 ~]# systemctl stop sssd; rm -rf /var/lib/sss/{db,mc}/*; systemctl start sssd

[root@rhel7-1 ~]# id aduser1
id: aduser1: no such user


Version-Release number of selected component (if applicable):
sssd-1.16.0-19.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.  Setup IPA Master with AD Trust
2.  Add certmaprule with name set to a DN matching AD
3.  reset SSSD and try a lookup

Actual results:
fails

Expected results:
works

Additional info:

sssd_domain log entries seen

(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [sysdb_certmap_add] (0x0040): ldb_add failed.
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [sysdb_error_to_errno] (0x0020): LDB returned unexpected error: [Invalid DN syntax]
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [sysdb_certmap_add] (0x0400): Error: 14 (Bad address)
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [sysdb_update_certmap] (0x0040): sysdb_certmap_add failed.
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [ldb] (0x4000): cancel ldb transaction (nesting: 0)
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [ipa_certmap_parse_results] (0x0040): sysdb_update_certmap failed(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [ipa_subdomains_certmap_done] (0x0040): Unable to parse certmap results [14]: Bad address
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [ipa_subdomains_refresh_certmap_done] (0x0020): Failed to read certificate mapping rules [14]: Bad address
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [sdap_id_op_destroy] (0x4000): releasing operation connection
(Mon Apr 16 13:01:49 2018) [sssd[be[ipa2.test]]] [ipa_subdomains_handler_done] (0x0020): Unable to refresh subdomains [14]: Bad address

Comment 1 Alexey Tikhonov 2020-04-24 16:21:57 UTC
* `master`
    * 27a3c0cf354bf2e85f50d7b4650d8a22120a5691 - sysdb: sanitize certmap rule name before using it in DN
    * 0003eda98b1db04bb3410af5f65d62e2426e426a - ipa: add missing new-line in debug message

Comment 4 Scott Poore 2020-08-19 20:25:25 UTC
Manual Verification:

Version ::

sssd-2.3.0-7.el8.x86_64

Results ::

[root@rhel8-7 ipatests]# id testuser
uid=1627001135(testuser) gid=1627001135(testuser) groups=1627001135(testuser),1627000513(domain users)

[root@rhel8-7 ipatests]# ipa certmaprule-add 'CN=adca,DC=ad,DC=test' --maprule='(userCertificate;binary={cert!bin})' --matchrule='<ISSUER>CN=adca,DC=ad,DC=test' --domain=smartcard.test
---------------------------------------------------------------
Added Certificate Identity Mapping Rule "CN=adca,DC=ad,DC=test"
---------------------------------------------------------------
  Rule name: CN=adca,DC=ad,DC=test
  Mapping rule: (userCertificate;binary={cert!bin})
  Matching rule: <ISSUER>CN=adca,DC=ad,DC=test
  Domain name: smartcard.test
  Enabled: TRUE

[root@rhel8-7 ipatests]# id testuser
uid=1627001135(testuser) gid=1627001135(testuser) groups=1627001135(testuser),1627000513(domain users)

[root@rhel8-7 ipatests]# systemctl stop sssd; rm -rf /var/lib/sss/{db,mc}/*; systemctl start sssd

[root@rhel8-7 ipatests]# id testuser
uid=1627001135(testuser) gid=1627001135(testuser) groups=1627001135(testuser),1627000513(domain users)

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


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