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 1651834 - searching for ipa users by certificate fails
Summary: searching for ipa users by certificate fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.6
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks: 1659492
TreeView+ depends on / blocked
 
Reported: 2018-11-21 01:33 UTC by joel
Modified: 2022-03-13 16:45 UTC (History)
9 users (show)

Fixed In Version: ipa-4.6.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1659492 (view as bug list)
Environment:
Last Closed: 2019-08-06 13:09:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7995 0 None None None 2022-03-13 16:45:20 UTC
Red Hat Product Errata RHBA-2019:2241 0 None None None 2019-08-06 13:09:37 UTC

Description joel 2018-11-21 01:33:44 UTC
Description of problem:

ipa user-find --certificate='###' will return no users found

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

How reproducible:
very

Steps to Reproduce:
1.ipa user-add --certificate='###'
2.ipa user-find --certificate='###'

Actual results:
no users found

Expected results:
should find user

Additional info:

Comment 2 Florence Blanc-Renaud 2018-11-21 07:43:43 UTC
Note: issue is reproducible on 7.6 but not on 7.5, hence I am adding the Regression keyword.

Comment 4 Marco Rhodes 2018-11-21 18:49:47 UTC
Example of back-end LDAP query resulting from the query:

[20/Nov/2018:12:23:20.798191384 -0800] conn=174 op=0 BIND dn="" method=sasl version=3 mech=GSS-SPNEGO
[20/Nov/2018:12:23:20.803536777 -0800] conn=174 op=0 RESULT err=0 tag=97 nentries=0 etime=0.0005518597 dn="uid=admin,cn=users,cn=accounts,dc=ipa,dc=corp,dc=example,dc=com"
[20/Nov/2018:12:23:20.820725143 -0800] conn=174 op=1 SRCH base="cn=ipaconfig,cn=etc,dc=ipa,dc=corp,dc=example,dc=com" scope=0 filter="(objectClass=*)" attrs=ALL
[20/Nov/2018:12:23:20.821582814 -0800] conn=174 op=1 RESULT err=0 tag=101 nentries=1 etime=0.0000957180


[20/Nov/2018:12:23:20.823373463 -0800] conn=174 op=2 SRCH base="cn=users,cn=accounts,dc=ipa,dc=corp,dc=example,dc=com" scope=1 filter="(&(objectClass=posixaccount)(userCertificate=<ipalib.x509.IPACertificate object at 0x7fc0a5575b90>))" attrs="telephoneNumber sshpubkeyfp ipaSshPubKey uid krbCanonicalName title loginShell homeDirectory uidNumber gidNumber sn userCertificate mail krbPrincipalName givenName nsAccountLock"
[20/Nov/2018:12:23:20.823971607 -0800] conn=174 op=2 RESULT err=0 tag=101 nentries=0 etime=0.0000692357


[20/Nov/2018:12:23:20.824984586 -0800] conn=174 op=3 UNBIND

Comment 5 Florence Blanc-Renaud 2018-11-23 09:20:43 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7770

Comment 9 Florence Blanc-Renaud 2018-11-29 12:52:41 UTC
Automation added in
test_xmlrpc/test_host_plugin.py::TestCRUD::test_simple_update
test_xmlrpc/test_user_plugin.py::TestUser::test_find_cert

Comment 15 Sumedh Sidhaye 2019-05-15 08:26:21 UTC
Build used for verification:
[root@master ~]# rpm -qa ipa-server 
ipa-server-4.6.5-7.el7.x86_64


[root@master ~]# openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout private.key -out cert.pem -subj '/CN=jdoe2'
Generating a 2048 bit RSA private key
..........................................+++
..........................................................+++
writing new private key to 'private.key'
-----
[root@master ~]# openssl x509 -outform der -in cert.pem -out cert.der
[root@master ~]#
[root@master ~]# ipa user-add jdoe2 --first=jdoe2 --last=jdoe2 --certificate="$(base64 cert.der)"
------------------
Added user "jdoe2"
------------------
  User login: jdoe2
  First name: jdoe2
  Last name: jdoe2
  Full name: jdoe2 jdoe2
  Display name: jdoe2 jdoe2
  Initials: jj
  Home directory: /home/jdoe2
  GECOS: jdoe2 jdoe2
  Login shell: /bin/sh
  Principal name: jdoe2
  Principal alias: jdoe2
  Email address: jdoe2
  UID: 811200005
  GID: 811200005
  Certificate: MIIC8zCCAdugAwIBAgIJANihM/4qpGlCMA0GCSqGSIb3DQEBCwUAMBAxDjAMBgNVBAMMBWpkb2UyMB4XDTE5MDUxNTA0MTAyMloXDTIwMDUxNDA0MTAyMlowEDEOMAwGA1UEAwwFamRvZTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC92lsqMDZkrS3IZRdJOhs3xpCpIKyTjCC03ny2rgNOegtVGP6NtnApfOBMn1tpCJfcP3WSYF/DEosWMmgyctCfGPbRwePMHLZHJXAX54nbmPiLVsRRmDKq9SChuDadaS6xhFMCkPljcbcsWNkHRK3exfVbyLMg/0D0pDy/KYvoGYhaA1hOHPVPiUSYPV33j/DFlBmIsIUKnuYENn0dppeWlzYICOEewz/y4ihI2f+h8xanFyIwnPnUyTAYbMqCML9lblDW2C72AON5v2jGxdDz6+C/72AEQmq3IfntTLX1zNIdxkM2p+Yfgl53T96TA/lOb2U7AKUiCX95Zj7B+OD1AgMBAAGjUDBOMB0GA1UdDgQWBBQ8K0ct3cl9gQe6asPHa+7AxSbGGTAfBgNVHSMEGDAWgBQ8K0ct3cl9gQe6asPHa+7AxSbGGTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB/sZvJszJHwpOOM/1aSOgCRQg8GmTG0r4bDIz5moRGLDN0TWKT2PGL4OTUxZD9Fa9z7HEjej2gB8eaP0B4T7x4Ca2IsuVvGuDbtI3JvzGDEzYaUqFERJTct27uK/TqbFbV5wH98lF22NVO5UiJDysl48miexhNjAExbx9BDFK7W6hFJ+bghIFfydqKt4ILnfIoRfKuUm2lH2fIAOcRA/f0TM693LTqdT01CyEYUUa+of7K/tx4TUC5rs5OojixyUVBvoDqSRKnEzLN/A1NtuBKVxUGUGKHhi2rVjSTQHGsOMNjJumVsWFJc0fjxMf1g3tFuEv0zGfUPnvuxP45wlAq
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False
[root@master ~]# ipa user-find --certificate="$(base64 cert.der)"
--------------
1 user matched
--------------
  User login: jdoe2
  First name: jdoe2
  Last name: jdoe2
  Home directory: /home/jdoe2
  Login shell: /bin/sh
  Principal name: jdoe2
  Principal alias: jdoe2
  Email address: jdoe2
  UID: 811200005
  GID: 811200005
  Certificate: MIIC8zCCAdugAwIBAgIJANihM/4qpGlCMA0GCSqGSIb3DQEBCwUAMBAxDjAMBgNVBAMMBWpkb2UyMB4XDTE5MDUxNTA0MTAyMloXDTIwMDUxNDA0MTAyMlowEDEOMAwGA1UEAwwFamRvZTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC92lsqMDZkrS3IZRdJOhs3xpCpIKyTjCC03ny2rgNOegtVGP6NtnApfOBMn1tpCJfcP3WSYF/DEosWMmgyctCfGPbRwePMHLZHJXAX54nbmPiLVsRRmDKq9SChuDadaS6xhFMCkPljcbcsWNkHRK3exfVbyLMg/0D0pDy/KYvoGYhaA1hOHPVPiUSYPV33j/DFlBmIsIUKnuYENn0dppeWlzYICOEewz/y4ihI2f+h8xanFyIwnPnUyTAYbMqCML9lblDW2C72AON5v2jGxdDz6+C/72AEQmq3IfntTLX1zNIdxkM2p+Yfgl53T96TA/lOb2U7AKUiCX95Zj7B+OD1AgMBAAGjUDBOMB0GA1UdDgQWBBQ8K0ct3cl9gQe6asPHa+7AxSbGGTAfBgNVHSMEGDAWgBQ8K0ct3cl9gQe6asPHa+7AxSbGGTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB/sZvJszJHwpOOM/1aSOgCRQg8GmTG0r4bDIz5moRGLDN0TWKT2PGL4OTUxZD9Fa9z7HEjej2gB8eaP0B4T7x4Ca2IsuVvGuDbtI3JvzGDEzYaUqFERJTct27uK/TqbFbV5wH98lF22NVO5UiJDysl48miexhNjAExbx9BDFK7W6hFJ+bghIFfydqKt4ILnfIoRfKuUm2lH2fIAOcRA/f0TM693LTqdT01CyEYUUa+of7K/tx4TUC5rs5OojixyUVBvoDqSRKnEzLN/A1NtuBKVxUGUGKHhi2rVjSTQHGsOMNjJumVsWFJc0fjxMf1g3tFuEv0zGfUPnvuxP45wlAq
  Account disabled: False
----------------------------
Number of entries returned 1
----------------------------


Since ipa user-find --certificate="$(base64 cert.der)" returns the appropriate user, marking this Bugzilla verified.

Comment 18 errata-xmlrpc 2019-08-06 13:09:16 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://access.redhat.com/errata/RHBA-2019:2241


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