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.

Bug 1658813

Summary: PKINIT with KCM does not work
Product: Red Hat Enterprise Linux 8 Reporter: Jakub Hrozek <jhrozek>
Component: sssdAssignee: SSSD Maintainers <sssd-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Steeve Goveas <sgoveas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: atikhono, grajaiya, jhrozek, lslebodn, mzidek, pbrezina, sgoveas, spoore, tscherf
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-2.0.0-31.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1781539 (view as bug list) Environment:
Last Closed: 2019-06-14 01:08:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1781539    

Description Jakub Hrozek 2018-12-12 21:53:07 UTC
Description of problem:
In case of Smart Card authentication, the krb5_child of sssd runs as root in order to be able to access the pcscd socket and relies on setting the KRB5CCNAME environment variable to access the ccache on behalf of the user.

However, with KCM, root cannot access another user's ccache, see e.g. this explanation by MIT krb5 upstream:
https://github.com/krb5/krb5/pull/557#issuecomment-254834623

Therefore we need to obtain the credentials as a user who can talk to pcscd (typically root) but then drop the privileges to the user who is logging and and save the credentials to the ccache as that user.

Version-Release number of selected component (if applicable):
up to sssd-2.0-24

How reproducible:
always

Steps to Reproduce:
1. login to an IPA client with a smart card
2. klist
3.

Actual results:
credential cache KCM:$uid not found

Expected results:
a valid credential cache

Additional info:
see e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1441764#c8 or a thread on freeipa-users titled "smartcard auth + kerberos ticket?" from Nov-15 2018.

Comment 1 Jakub Hrozek 2018-12-12 21:57:06 UTC
Upstream ticket:
https://pagure.io/SSSD/sssd/issue/3903

Comment 2 Jakub Hrozek 2018-12-13 11:10:52 UTC
* master: e49e9f727e4960c8a0a2ed50488dac6e51ddf284

Comment 3 Jakub Hrozek 2018-12-13 11:12:23 UTC
Hi Scott, can you please qa_ack this bug? You found the original issue in https://bugzilla.redhat.com/show_bug.cgi?id=1441764#c8 so I guess you know how to reproduce.

Comment 6 Scott Poore 2019-02-11 20:57:02 UTC
Verified.

Version ::

sssd-2.0.0-43.el8.x86_64
sssd-kcm-2.0.0-43.el8.x86_64

Results ::


# p11tool --provider /usr/lib64/opensc-pkcs11.so --export 'pkcs11:model=PKCS%2315;manufacturer=Aventra%20Ltd.;serial=7055056447986431;token=singleuser1-01%20%28MyEID%29;id=%01;object=cert.01;type=cert' --outfile /tmp/card.crt

# ipa certmap-match /tmp/card.crt
---------------
2 users matched
---------------
  Domain: EXAMPLE.COM
  User logins: singleuser1

  Domain: ad.test
  User logins: adcertsingleuser1
----------------------------
Number of entries returned 2
----------------------------

# su - singleuser1 -c "kdestroy -A"

# su - singleuser1 -c "su - singleuser1 -c klist"
PIN for singleuser1-01 (MyEID)
Ticket cache: KCM:614800473:39355
Default principal: singleuser1

Valid starting       Expires              Service principal
02/11/2019 14:50:28  02/12/2019 14:50:21  krbtgt/EXAMPLE.COM