Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionAlexey Tikhonov
2021-10-08 19:01:43 UTC
This bug was initially created as a copy of Bug #1992432
I am copying this bug because: to track fix for RHEL8
Description of problem:
Cockpit has initial support for client certificate (aka smart card) logins. This is currently only supported for machines joined to IdM (FreeIPA or AD) where you import and compare against the full client certificate with org.freedesktop.sssd.infopipe.Users.FindByCertificate(). There is no further validation of the certificate right now.
We'd like to make this both more robust and also allow this with certmap matchrules. For the latter it's absolutely crucial to ensure that the certificate is signed by an admin-specified CA, plus the usual extra checks (CRL file or OCSP, as configured). It's not strictly necessary for full certificate imports, but it'd be a desirable hardening step anyway.
For that we would like to have a D-Bus API that exposes sssd's cert validation. Right now that's done internally by pam_sss and the like, they apparently do cert validation and cert mapping as two distinct steps. There are reasons why they are separate (@sumit-bose mentioned on the meeting that mapping is done more often and is much cheaper than validation), so it should have a separate API as well. Something like org.freedesktop.sssd.infopipe.Users.ValidateCertificate s → void which gets the certificate PEM and throws a DbusError on failures, or alternatively returns a success/error code.
cockpit could then attempt to use that new API, and if the method does not exist, fall back to the current behaviour or do something more heuristic (like, erroring out when the mapped user is local, as then it's most likely a certmap one), and eventually require the new API.
The most important aspect of this is that this keeps the configuration like pam_cert_db_path, crl_file, ocsp_* etc. in sssd.conf and conf.d. cockpit-tls neither should (too complex) nor could (files are readable for root only) inspect these. It also avoids code duplication, as sssd already has all that validation logic.
As a kind of bonus it would be nice to expose the CA as a property on the InfoPipe object (or a GetCA() method), if it was set in the config. This would allow the server to send the expected CAs (or at least its properties) with the TLS handshake, using gnutls-x509-trust-list-add-cas() or a similar function. This may allow the web browser a more intelligent pre-selection of available certificates. But that's not crucial, and I'm also happy to split that out into a separate issue.
Version-Release number of selected component (if applicable):
sssd-2.5.2-2.el8.x86_64
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-2022:2070