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 2012308 - Add client certificate validation D-Bus API (dependency of cockpit CVE-2021-3698 fix)
Summary: Add client certificate validation D-Bus API (dependency of cockpit CVE-2021-3...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Iker Pedrosa
QA Contact: Scott Poore
URL:
Whiteboard: sync-to-jira
Depends On: 2011216
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-08 19:01 UTC by Alexey Tikhonov
Modified: 2022-05-10 16:47 UTC (History)
8 users (show)

Fixed In Version: sssd-2.6.2-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:26:45 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 5224 0 None open Add client certificate validation D-Bus API 2021-10-29 09:22:47 UTC
Github SSSD sssd issues 5851 0 None open Add client certificate validation D-Bus API (dependency of cockpit CVE-2021-3698 fix) 2021-10-29 09:21:02 UTC
Red Hat Issue Tracker RHELPLAN-99331 0 None None None 2021-10-08 19:04:29 UTC
Red Hat Issue Tracker SSSD-4001 0 None None None 2021-10-12 13:47:09 UTC
Red Hat Product Errata RHBA-2022:2070 0 None None None 2022-05-10 15:27:13 UTC

Description Alexey 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

Comment 2 Iker Pedrosa 2021-10-29 08:56:33 UTC
Upstream ticket:
https://github.com/SSSD/sssd/issues/5851

Comment 3 Alexey Tikhonov 2021-10-29 11:24:47 UTC
Upstream PR: https://github.com/SSSD/sssd/pull/5852

Comment 4 Alexey Tikhonov 2021-11-09 14:36:14 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/5852

* `master`
    * 50e6070e4784e4a9a01ce26bd08229a07557948a - Tests: ifp interface to validate certificate
    * cf75d897b8ef03fdc471059214e86824f19b1bd1 - ifp: new interface to validate a certificate

Comment 10 Alexey Tikhonov 2021-12-15 12:39:17 UTC
Additional patch: https://github.com/SSSD/sssd/pull/5918

Comment 12 Alexey Tikhonov 2021-12-20 10:10:13 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/5918

* `master`
    * fd0f087ada2f4a59d4b22846d06f1b19fd522e11 - ifp: improve FindByValidCertificate() error
    * 8d54b8c029d276801b323dfe045a155a4311ee49 - man: update ifp options for FindByValidCertificate

Comment 16 errata-xmlrpc 2022-05-10 15:26:45 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-2022:2070


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