This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 1685912 - When more than one certificate is stored in an LDAP object, the 'ipa' tool always shows data that belongs to the old certificate
Summary: When more than one certificate is stored in an LDAP object, the 'ipa' tool al...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: ipa
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: beta
: ---
Assignee: Florence Blanc-Renaud
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-06 09:46 UTC by Thorsten Scherf
Modified: 2023-09-18 17:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-18 17:52:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-8046 0 None None None 2022-03-23 16:25:50 UTC
Red Hat Issue Tracker   RHEL-4818 0 None Migrated None 2023-09-18 17:49:32 UTC

Description Thorsten Scherf 2019-03-06 09:46:08 UTC
Description of problem:
An IdM object can contain more than one certificate. When you use 'ipa service-show <principal> or 'ipa service-find', both certificates are displayed, but the 'serial' and 'expiry' date shows the data from the old rather than the renewed certificate. This is very confusing. 

I suppose the same is also true for host and user objects, but I didn't verify this.

Version-Release number of selected component (if applicable):
ipa-server-4.6.4-10.1ts.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Renew any service certificate 
2.Make sure the service entry has more than one certificate attached
3.Call 'ipa service-show <service-principal>

Actual results:
The output shows data that belongs to the old certificate.

Expected results:
The output should show data that belongs to the new certificate.

Additional info:

Comment 2 Florence Blanc-Renaud 2019-03-11 13:51:04 UTC
The issue happens because the entry can contain multiple certificates (entry_attrs['usercertificate'] is multi-valued), but the code is using only the first value to build the fields subject, serial_number, issuer, valid_not_before, valid_not_after etc..
See in the set_certificate_attrs method of ipaserver/plugins/server.py which is called in the post_callback method of service_show:

    if type(entry_attrs['usercertificate']) in (list, tuple):
        cert = entry_attrs['usercertificate'][0]
    else:
        cert = entry_attrs['usercertificate']
    entry_attrs['subject'] = unicode(DN(cert.subject))
    [...]

As ldap does not guarantee any ordering when returning multivalued attributes, we need to have a different strategy. It could be possible to read all the certificates and pick the one issued the most recently, for instance, and display the data for this one only.

Comment 3 Florence Blanc-Renaud 2019-03-11 14:17:32 UTC
Hi Thorsten,

there could be multiple ways to fix this issue, and I would like to get your opinion.

We could either keep the current interface, i.e. display information only for the one of the certs (= the most recent cert)
OR
display information for all the certificates.

In the first case, we need to agree on the way to pick the cert for which we want to display the information:
is it the one with the most recent not_valid_before (=date of issuance), or the one with the furthest expiration date?

In the second case, the CLI output could become heavy and we may want to show the info only when a --displaycertinfo param is provided. 

So what's your opinion on this?

Comment 4 Florence Blanc-Renaud 2019-03-11 14:40:00 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7878

Comment 5 Thorsten Scherf 2019-03-11 15:05:43 UTC
(In reply to Florence Blanc-Renaud from comment #3)
> there could be multiple ways to fix this issue, and I would like to get your
> opinion.
> 
> We could either keep the current interface, i.e. display information only
> for the one of the certs (= the most recent cert)
> OR
> display information for all the certificates.

I think the output for the most recent cert is good enough.

> In the first case, we need to agree on the way to pick the cert for which we
> want to display the information:
> is it the one with the most recent not_valid_before (=date of issuance), or
> the one with the furthest expiration date?

Why not just the one with the higher serial number?

> In the second case, the CLI output could become heavy and we may want to
> show the info only when a --displaycertinfo param is provided.

Comment 6 Rob Crittenden 2019-03-11 15:10:19 UTC
The question is how to define most recent. Is it the one with the latest notBefore, or the latest notAfter?

It is likely the serial numbers will be randomized at some point, plus with multiple CA's issuing certs each with their own ranges this would favor one CA over others.

It's not clear how meaningful it would be to pick one cert over another beyond the most basic use case (one cert in an entry).

I'd rather propose not providing the output by default and adding a new option to show cert data and when that is provided then include the cert output for all certs.

This would be a rather disruptive change with a pretty major impacts to the web UI.

Comment 7 Thorsten Scherf 2019-03-11 15:24:31 UTC
Rob had some good arguments. I did not think about randomized serials maybe even issued by different CA's.

I like the idea to not displaying the cert details by default and introduce a new option instead which has to be used to explictly request the cert related information. When this option is used we can then indeed show the data from all the certificates stored in the object.

Comment 8 Florence Blanc-Renaud 2019-06-19 07:41:16 UTC
RHEL-7.7 is already near the end of a Development Phase and development is being wrapped up. I am bulk-moving to RHEL 8 the Bugs which were already triaged, but to which we did not commit (without devel_ack) and we cannot keep them even as a stretch goal for RHEL-7.7.

If you believe this particular bug should be reconsidered for 7.7, please let us know.

Comment 13 RHEL Program Management 2023-09-18 17:47:08 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 14 RHEL Program Management 2023-09-18 17:52:08 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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