Bug 2251709 - Update to sssd-2.9.3 breaks user authentication via smartcard
Summary: Update to sssd-2.9.3 breaks user authentication via smartcard
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: sssd
Version: 39
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: sssd-maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-27 09:28 UTC by Ralf Schneider
Modified: 2023-11-28 07:13 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-27 13:12:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
p11_child.log requested in comment #1 (5.18 KB, text/plain)
2023-11-27 10:04 UTC, Ralf Schneider
no flags Details
Extended p11_child.log requested in comment #4 (8.76 KB, text/plain)
2023-11-27 11:17 UTC, Ralf Schneider
no flags Details
sssd_pam.log requested in comment #4 (63.30 KB, text/plain)
2023-11-27 11:17 UTC, Ralf Schneider
no flags Details

Description Ralf Schneider 2023-11-27 09:28:35 UTC
Description of problem:

I have set up a sssd / pam authentication via a pkcs15 certificate stored on a Nitrokey Pro smartcard. Everything worked until doing a dfn update which upgraded sssd to version 2.9.3.

Downgrading sssd-dbus and its dependencies to version 2.9.2 made things working again.

Version-Release number of selected component (if applicable):

sssd-2.9.3-1.fc39.x86_64

How reproducible:

Steps to Reproduce:
1. dnf update
2. Using pamtester to check login and authentication procedure:
pamtester login $USER authenticate
3. Giving the user pin of the card leads to:
pamtester: Authentication failure
4. Giving the user's password leads to:
pamtester: successfully authenticated
5. Downgrading sssd-dbus
sudo dnf install sssd-dbus-2.9.2
6. Using pamtester to check login and authentication procedure:
pamtester login $USER authenticate
PIN for OpenPGP card (User PIN): 
pamtester: successfully authenticated

Actual results:

User not able to authenticate with pkcs15 certificate via smartcard

Expected results:

User should be able to authenticate with pkcs15 certificate via smartcard

Additional info:
--

Comment 1 Alexey Tikhonov 2023-11-27 09:35:56 UTC
Could you please provide '/var/log/sssd/p11_child.log' that covers failed attempt?

Comment 2 Ralf Schneider 2023-11-27 10:04:08 UTC
Created attachment 2001675 [details]
p11_child.log requested in comment #1

Comment 3 Alexey Tikhonov 2023-11-27 10:26:05 UTC
Is this a local user (from /etc/passwd)?

Unfortunately, there is no enough information with the default debug level.

Could you please add 'debug_level = 9' to the '[pam]' section of 'sssd.conf', clear SSSD logs and restart SSSD, repeat attempt and then provide sanitized 'p11_child.log' and 'sssd_pam.log'? And relevant parts of sssd.conf itself, if possible.

Comment 4 Ralf Schneider 2023-11-27 11:15:59 UTC
Hi Alexey,

yes indeed it is a local user from /etc/passwd.

My sssd.conf with looks like 

-----------------------

[sssd]
enable_files_domain = True
services = nss, pam
domains = shadowutils
debug_level = 9

[nss]

[pam]
pam_cert_auth = True
pam_verbosity = 10
debug_level = 9

[domain/shadowutils]
id_provider = files
auth_provider = proxy
proxy_pam_target = sssd-shadowutils
proxy_fast_alias = True
debug_level = 9

[certmap/shadowutils/<snip>My user_id<snap>]
matchrule = <SUBJECT>.*CN=<snip>My user_id<snap>

-----------------------

The logs should contain two attempts to access the smartcard triggered by pamtester:

In the first one I gave the password, 

pamtester login $USER authenticate
Password: 
pamtester: successfully authenticated

In the second one I tried the user key of the smartcard which returned: 

pamtester login $USER authenticate
Password: 
pamtester: Authentication failure

Comment 5 Ralf Schneider 2023-11-27 11:17:11 UTC
Created attachment 2001678 [details]
Extended p11_child.log requested in comment #4

Comment 6 Ralf Schneider 2023-11-27 11:17:56 UTC
Created attachment 2001679 [details]
sssd_pam.log requested in comment #4

Comment 7 Sumit Bose 2023-11-27 12:40:15 UTC
Hi,

can you try if adding

    local_auth_policy = enable:smartcard

to the [domain/...] section in sssd.conf and restarting SSSD will help?

bye,
Sumit

Comment 8 Ralf Schneider 2023-11-27 13:12:17 UTC
Hi,

that did the trick!

Now everything works again as expected.

Thanks for the fast support,
Ralf

Comment 9 Alexey Tikhonov 2023-11-27 17:16:35 UTC
One more question,
any reason you use
```
id_provider = files
```
and not
```
id_provider = proxy
proxy_lib_name = files
```
?

Take a note 'id_provider = files' is a deprecated functionality and most probably will be gone starting F40.

Comment 10 Ralf Schneider 2023-11-28 07:13:52 UTC
Actually there is no special reason besides the fact that I glued the thing together based on rather old HowTo as I now realized.

I now changed to

id_provider = proxy
proxy_lib_name = files

and still everything works as expected.

Thanks a lot for the hint!


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