Bug 1300420

Summary: Screen locks and smart card is removed - must show a message to insert the correct smartcard
Product: Red Hat Enterprise Linux 7 Reporter: Roshni <rpattath>
Component: sssdAssignee: SSSD Maintainers <sssd-maint>
Status: CLOSED ERRATA QA Contact: Steeve Goveas <sgoveas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: cobrown, grajaiya, jhrozek, ksiddiqu, lslebodn, mkosek, mzidek, pbrezina, sbose
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.14.0-0.1.alpha.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1300421 (view as bug list) Environment:
Last Closed: 2016-11-04 07:15:00 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: 1300421    

Description Roshni 2016-01-20 18:08:05 UTC
Description of problem:
Screen locks and smart card is removed must show a message to insert the correct smartcard

Version-Release number of selected component (if applicable):
sssd-1.13.0-40.el7

How reproducible:
always

Steps to Reproduce:
1. ipa-client-install
2. sssd.conf should have the following
[pam]
pam_cert_auth = True

3. add ipa user and add the signing cert on the smartcard to the ipa user
4. gdm login using smartcard pin
5. Smartcard is removed from the reader
6. Screen locks due to inactivity or manually 


Actual results:
Locked screen prompts for ipa user password.

Expected results:
Locked screen should show a message to insert the correct smartcard and when inserted it should prompt for the smartcard pin

Additional info:

Comment 2 Jakub Hrozek 2016-01-27 15:01:02 UTC
Upstream ticket:
https://fedorahosted.org/sssd/ticket/2941

Comment 3 Sumit Bose 2016-06-02 09:21:07 UTC
Please note that SSSD can only go so far as to support the Smartcard support of gdm. Since SSSD does not track the user session it cannot know which authentication method was used at login but gdm can. Afaik there is currently no gdm option to require that the screen-saver will use the same authentication method as used at the login prompt. But the functionality can roughly be achieved by disabling all authentication methods except Smartcard authentication in the gdm configuration.

This ticket will track the SSSD support of the gdm Smartcard feature.

Comment 4 Lukas Slebodnik 2016-06-09 11:12:30 UTC
master:
* d86224608ff60ec5cc7e7cbf9e53d8a04e083530
* 325ed9f92f1ea1f348fd7913229faecf3dc1d40b

Comment 6 Roshni 2016-09-01 17:29:22 UTC
Sumit,

Could you provide with the testing instructions?

Comment 8 Roshni 2016-09-08 15:22:45 UTC
Hi Sumit,

When I am testing this bug using pkcs15 cards, I do not have pam_pkcs11 installed because of https://bugzilla.redhat.com/show_bug.cgi?id=1367919. So I see the following

[root@dhcp129-88 ~]# authconfig --enablesmartcard --smartcardmodule=no_module --update
authconfig: Authentication module /lib64/security/pam_pkcs11.so is missing. Authentication process might not work correctly.

I also do not see a prompt to insert the smartcard in the gdm login screen, it is still prompting for ipa user password.

Comment 9 Sumit Bose 2016-09-16 16:34:03 UTC
Please ignore the instructions from comment #7, calling authconfig with the smartcard options has too may unwanted side effects. It is easier to only set the gdm relates options directly. Nevertheless the change to smartcard-auth must be done as well.

Please comment out the line containing pam_pkcs11 in /etc/pam.d/smartcard-auth and add
    auth        sufficient    pam_sss.so allow_missing_name
to the auth section in /etc/pam.d/smartcard-auth directly before or after the commented out pam_pkcs11 line.

Then check /etc/dconf/db/distro.d/10-authconfig, there should be no line like "enable-smartcard-authentication=false" in the [org/gnome/login-screen]. If there is one please remove it and remove /org/gnome/login-screen/enable-smartcard-authentication from /etc/dconf/db/distro.d/locks/10-authconfig-locks as well. After that the files might look like:

/etc/dconf/db/distro.d/10-authconfig:
    [org/gnome/login-screen]
    enable-fingerprint-authentication=false
/etc/dconf/db/distro.d/locks/10-authconfig-locks:
    /org/gnome/login-screen/enable-fingerprint-authentication

If you want to enable screen-locking if the Smartcard is removed the files should look like:

/etc/dconf/db/distro.d/10-authconfig:
    [org/gnome/login-screen]
    enable-fingerprint-authentication=false
    [org/gnome/settings-daemon/peripherals/smartcard]
    removal-action='lock-screen'
/etc/dconf/db/distro.d/locks/10-authconfig-locks:
/org/gnome/login-screen/enable-fingerprint-authentication
/org/gnome/settings-daemon/peripherals/smartcard

After changing the files below /etc/dconf please call

    dconf update

and restart gdm.

Comment 10 Roshni 2016-09-23 15:15:30 UTC
[root@dhcp129-34 ~]# rpm -qi sssd
Name        : sssd
Version     : 1.14.0
Release     : 43.el7
Architecture: x86_64
Install Date: Fri 23 Sep 2016 10:04:00 AM EDT
Group       : Applications/System
Size        : 35147
License     : GPLv3+
Signature   : RSA/SHA256, Wed 21 Sep 2016 03:10:55 AM EDT, Key ID 938a80caf21541eb
Source RPM  : sssd-1.14.0-43.el7.src.rpm
Build Date  : Tue 20 Sep 2016 09:45:51 AM EDT
Build Host  : x86-017.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://fedorahosted.org/sssd/
Summary     : System Security Services Daemon

Verified using the workaround mentioned in comment 9. Sumit has an authconfig patch that will fix this issue without the authconfig workaround which will go into RHEL 7.4 https://bugzilla.redhat.com/show_bug.cgi?id=1378943

Comment 12 errata-xmlrpc 2016-11-04 07:15:00 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://rhn.redhat.com/errata/RHEA-2016-2476.html