Bug 1741452
| Summary: | pam_sss: empty smart card pin registers as authentication attempt | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | adam winberg <adam.winberg> |
| Component: | sssd | Assignee: | SSSD Maintainers <sssd-maint> |
| Status: | CLOSED ERRATA | QA Contact: | sssd-qe <sssd-qe> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.1 | CC: | atikhono, grajaiya, jhrozek, lslebodn, mzidek, pbrezina, sbose, sgoveas, spoore, tscherf |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | sync-to-jira | ||
| Fixed In Version: | sssd-2.2.3-2.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-04-28 16:56:04 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: | |||
|
Description
adam winberg
2019-08-15 08:05:02 UTC
Upstream ticket: https://pagure.io/SSSD/sssd/issue/4068 Master: - 945970088209a1a8a75a94e600a4587fb6e8f48c - 6e759010ae43c039eeaff6a4390beb72af0d0e8e This fix does not seem to be included in 8.1? (In reply to adam winberg from comment #3) > This fix does not seem to be included in 8.1? Right, it didn't get into 8.1. Verified. Version :: sssd-2.2.3-6.el8.x86_64 Results :: With full IPA Smart Card setup, I tested using an Aventra MyEID smart card. ##################### First show successful authentication with PIN [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): ipauser1 [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:43:28 client.ipa.test su[11712]: (to ipauser1) root on pts/0 Jan 13 12:43:28 client.ipa.test su[11712]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice Jan 13 12:43:28 client.ipa.test su[11712]: pam_unix(su-l:session): session opened for user ipauser1 by root(uid=1815000132) Jan 13 12:43:28 client.ipa.test su[11712]: pam_unix(su-l:session): session closed for user ipauser1 Jan 13 12:43:28 client.ipa.test su[11711]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ##################### Next Show 2 failed attempts to authentication with incorrect PIN ### badpin 1 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:44:30 client.ipa.test [sssd[krb5_child[11831]]][11831]: Pre-authentication failed: Preauthentication failed Jan 13 12:44:30 client.ipa.test su[11797]: pam_sss(su-l:auth): authentication failure; logname=root uid=1815000132 euid=0 tty=pts/0 ruser=root rhost= user=ipauser1 Jan 13 12:44:30 client.ipa.test su[11797]: pam_sss(su-l:auth): received for user ipauser1: 17 (Failure setting user credentials) Jan 13 12:44:32 client.ipa.test su[11797]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:44:33 client.ipa.test su[11796]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### badpin 2 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:45:10 client.ipa.test [sssd[krb5_child[11881]]][11881]: Pre-authentication failed: Preauthentication failed Jan 13 12:45:10 client.ipa.test su[11847]: pam_sss(su-l:auth): authentication failure; logname=root uid=1815000132 euid=0 tty=pts/0 ruser=root rhost= user=ipauser1 Jan 13 12:45:10 client.ipa.test su[11847]: pam_sss(su-l:auth): received for user ipauser1: 17 (Failure setting user credentials) Jan 13 12:45:12 client.ipa.test su[11847]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:45:13 client.ipa.test su[11846]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ^^^ We can see "final user PIN try" in token flags after 2 failed attempts ^^^ ##################### Now show 5 attempts with no/empty pin ### no pin 1 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:45:31 client.ipa.test su[11888]: (to ipauser1) root on pts/0 Jan 13 12:45:31 client.ipa.test su[11888]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice Jan 13 12:45:31 client.ipa.test su[11888]: pam_unix(su-l:session): session opened for user ipauser1 by root(uid=0) Jan 13 12:45:46 client.ipa.test su[11889]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:45:47 client.ipa.test su[11888]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### no pin 2 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:46:09 client.ipa.test su[11935]: (to ipauser1) root on pts/0 Jan 13 12:46:09 client.ipa.test su[11935]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice Jan 13 12:46:09 client.ipa.test su[11935]: pam_unix(su-l:session): session opened for user ipauser1 by root(uid=0) Jan 13 12:46:22 client.ipa.test su[11936]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:46:23 client.ipa.test su[11935]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### no pin 3 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 -- Unit dnf-makecache.service has finished starting up. -- -- The start-up result is RESULT. Jan 13 12:46:51 client.ipa.test su[11984]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:46:52 client.ipa.test su[11982]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### no pin 4 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:47:09 client.ipa.test su[12027]: (to ipauser1) root on pts/0 Jan 13 12:47:09 client.ipa.test su[12027]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice Jan 13 12:47:09 client.ipa.test su[12027]: pam_unix(su-l:session): session opened for user ipauser1 by root(uid=0) Jan 13 12:47:21 client.ipa.test su[12028]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:47:22 client.ipa.test su[12027]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### no pin 5 [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# journalctl -xel --no-pager|tail -5 Jan 13 12:47:33 client.ipa.test su[12074]: (to ipauser1) root on pts/0 Jan 13 12:47:33 client.ipa.test su[12074]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice Jan 13 12:47:33 client.ipa.test su[12074]: pam_unix(su-l:session): session opened for user ipauser1 by root(uid=0) Jan 13 12:47:54 client.ipa.test su[12075]: FAILED SU (to ipauser1) root on pts/0 Jan 13 12:47:55 client.ipa.test su[12074]: pam_unix(su-l:session): session closed for user ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 So with no/empty pin passed to sssd, I see no particular error from sssd_pam and it doesn't lock the card while showing "final user PIN try". Now to confirm that the card should be locked: ### good first [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): ipauser1 [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### 2 bad next [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure ### check status [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, final user PIN try, PIN initialized hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 ### 3rd bad pin [root@client emptypin]# su - ipauser1 -c 'su - ipauser1 -c whoami' PIN for sctest (MyEID): su: Authentication failure ### check final status [root@client emptypin]# pkcs11-tool -T Available slots: Slot 0 (0x0): SCM Microsystems Inc. SCR 3310 [CCID Interface] (53311651713564) token label : sctest (MyEID) token manufacturer : Aventra Ltd. token model : PKCS#15 token flags : login required, rng, token initialized, PIN initialized, user PIN locked hardware version : 0.0 firmware version : 40.0 serial num : 7055056447986431 pin min/max : 4/8 [root@client emptypin]# So it does change flags when a final bad pin is received to "user PIN locked". 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://access.redhat.com/errata/RHBA-2020:1863 |