-
Notifications
You must be signed in to change notification settings - Fork 270
Passwordless-gdm #8212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passwordless-gdm #8212
Conversation
|
@alexey-tikhonov we discovered that passkey with no PIN and LDAP server wasn't working at all (not even in master branch) while developing this feature. The first commit from that PR is also present in this branch, so once one of them is merged the other PR will remove it. That's all the relation there is between one and the other. |
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces the passwordless-gdm feature, enabling a more modern authentication experience. The changes are substantial, involving significant refactoring of the Kerberos authentication flow to better separate pre-authentication and authentication steps. A new JSON-based protocol is implemented for communication with GDM, handled by the new pamsrv_json.c file. While the refactoring improves code structure, I've identified a couple of critical security vulnerabilities related to buffer over-reads when parsing data from other SSSD components. These must be addressed. I've also noted an issue with error handling in the new JSON parsing logic that could mask problems and make debugging difficult.
|
@ikerexxe , if SSSD is updated to a version that includes those patches, but GDM and authselect aren't, does old functionality works seamlessly? |
|
Is there a patch that contains RNs? |
2fd1628 to
23663d6
Compare
I was testing this the other day. If any package with this functionality is missing then the old functionality works without any user interaction.
As a side note, except for four checks that were in red, CI was in green until I submitted the latest changes. I checked the failing checks and they were not related to these changes. |
Try to imagine how it will read in an automatically generated notes. I would re-phrase to something like re: As a nitpick: it should start with a capital letter. I guess option is described in the man page, so I would reference in the style "please see <this> man page description for additional information and examples". Also please add
etc |
23663d6 to
740fa1c
Compare
|
Rebased on top of master once #8176 has been merged.
Done
Added a new RN for |
|
system tests in PRCI seemed to be stuck, so I am re-running CI jobs |
It won't help until CI is fixed. |
|
I'm removing 'backport-to' label as automation will add a little value here. |
|
I am ready to approve but first would like to see full PRCI runs for fedora-43 and fedora-44. Based on Slack discussion there is out of disk space events occurring on f43 + f44 as a result of a GDM bug. If I understand correctly SSSD/sssd-ci-containers#155 will workaround this |
Thank you. Please don't forget to replace link to SSSD/sssd.io#79 with a link to actual page once doc PR is merged. |
|
@ikerexxe, please rebase. |
Rerun and everything is green except for system/centos-10 test, which has a known issue in the
Why? If you are asking this because #8150 was merged, those tests don't run in PRCI (at least not now): |
justin-stephenson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your large effort on this feature.
|
Covscan reported issues: |
Call JSON message generation function and fill the data structure containing the response_data linked list. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Forward the available authentication mechanisms and their associated data message to the GUI login using a PAM conversation. Then, obtain the reply and forward it to the responder, so that it can parse it. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Ray Strode <halfline@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Parse GUI reply and set the appropriate data in `sss_auth_token` structure. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Include JSON message where applies. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
It returns NULL on error, but this wasn't checked. Fixes: ceeffa9 ("Responder: generate JSON message for GUI") Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Integration with GDM requests two prompts for smartcard so modifying the prompt_config structure. In addition, implement all the functions needed to manipulate the structure for these new prompts. Finally, add unit-tests for the new functions. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
This API gets all the elements with the selected response type data from the response_data linked list. Includes unit tests. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Implement a set of functions to retrieve the smartcard data and generate the JSON message with it. Implement new unit test and adapt the existing ones to take into account the new data. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Parse GUI reply for smartcard and set the appropriate data in `sss_auth_token` structure. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Several of the functions in `pamsrv_json` had lots of arguments and I'm about to add more for the passkey authentication mechanism. Reduce these arguments by creating a structure that will contain all these data. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Include the certificate data in the JSON messages to set it in the authtok structure more easily. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Include the certificate data in the JSON message to set it in the authtok structure more easily. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
This is needed by `pamsrv_json.c`, so let's make it public. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Implement a set of functions to retrieve the passkey data and generate the JSON message with it. Implement new unit test and adapt the existing ones to take into account the new data. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
`sss_authtok_set_local_passkey_pin` provides a way to set the passkey PIN in the authtok structure for local passkey authentication. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Parse GUI reply for passkey and set the appropriate data in `sss_auth_token` structure. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
During the `preauthentication` phase krb5_child checks for the available authentication methods for the given user, advertises them and the process is kept alive. Once the state is change to `authentication` the same krb5_child process processes the credentials and proceeds with the authentication itself. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
When authenticating with a passkey, different PAM code paths within SSSD
can result in the `authtok` containing data even when the user did not
enter a PIN. Depending on the flow (e.g., triggered by `gdm` vs. `su`),
this data might be an empty string or non-printable characters like `^L`
(form feed).
The previous code had two issues:
1. It only checked if the `authtok` was non-empty
(`sss_authtok_get_type(...) != SSS_AUTHTOK_TYPE_EMPTY`). If user
verification was disabled, this check would incorrectly pass for
these 'junk' `authtok` values. This caused SSSD to prepare and send
an erroneous PIN to the passkey helper.
2. In the case where the `authtok` *was* correctly empty, the check
would fail, `write_buf_len` would remain 0, and the `if
(write_buf_len != 0)` block containing the `write_pipe_send` call
would be skipped. This stalled the authentication flow, as the
callback to continue the process was never set.
This patch fixes both issues:
1. The `user_verification` setting is now stored in the state struct.
The logic is updated to only prepare the PIN buffer if the `authtok`
is non-empty *and* user verification is required
(`state->user_verification != PAM_PASSKEY_VERIFICATION_OFF`).
2. The `write_pipe_send` call is moved outside the conditional block so
it always runs. This ensures that the asynchronous child
communication (via `passkey_child_write_done`) is always triggered,
even if the write buffer is empty (0-length).
This resolves both failure modes: junk PINs are no longer sent when
verification is off, and the auth flow no longer stalls when no PIN is
present.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
defaults The `pam_p11_allowed_services` option now includes `gdm-switchable-auth` as one of the default allowed PAM services for smartcard authentication. The service was added alongside the other GDM-related services (gdm-smartcard and gdm-password) for logical grouping. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
When a user's password expires after successful JSON authentication, the fallback to traditional password change fails. Add PAM_CLI_FLAGS_CHAUTHTOK_PREAUTH flag to distinguish password change preauth from normal authentication preauth. When this flag is set, the PAM responder skips JSON message generation and returns traditional preauth data instead. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Use `pam_get_auth_types()` to detect the available mechanisms for a user. Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
Add a note to clarify that 2FA isn't supported in JSON protocol and fix
man page compilation for `pam_json_services` option.
:feature: Unified passwordless login in the GUI. SSSD now supports a
rich authentication selection interface. Users can login with
smartcards, passkey, External IdPs and passwords directly
within the graphical user interface.
:packaging: SSSD now supports authentication mechanism selection through
PAM using a JSON-based protocol. This feature enables
passwordless authentication mechanisms in GUI login
environments that support the protocol.
Feature will be supported by GNOME Display Manager (GDM)
starting with GNOME 50. While currently optimized for GNOME,
the JSON protocol design allows for future support in other
display managers.
authselect is the recommended approach and will handle the
necessary PAM stack modifications automatically starting
with version 1.7 through the new option `with-switch-auth`
which provides a new PAM service called `switchable-auth`.
Manual PAM configuration is also possible.
For more technical details and implementation specifications,
see the design documentation:
SSSD/sssd.io#79
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
Port the pre-authentication retry logic from the IPA provider to the krb5 provider, making it available to all krb5-based authentication flows. Relates: 6c1272e ("krb5: Add fallback password change support") Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com> Reviewed-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
8348d32 to
e420ade
Compare
This is the implementation for the so called passwordless-gdm feature. The design page for this feature is available at SSSD/sssd.io#79.
The original patches were reviewed at ikerexxe#9 and ikerexxe#12 by Justin and Sumit. I've had done some minor modifications to those patches:
As a reminder you can use https://copr.fedorainfracloud.org/coprs/ipedrosa/passwordles-gdm/ for testing and update sssd, authselect, mutter, gdm and gnome-shell packages.
authselect brings a new feature called
with-switchable-auththat you should enable to use this feature. In addition, you should add the following configuration to sssd.conf:Known limitations: