-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
auth: implement a full pam conversation #205
Conversation
some rebasing fails, I sense |
0d916e2
to
c8b2caf
Compare
7413e5a
to
07e9baf
Compare
what about handling this messages? that's if i set currently input is blocked (which is okay) but it is stuck at if i do faillock --user bvr --reset from another tty it does nothing, only killing with |
Displaying if the account gets locked would be nice I think. But not in this PR probably. I assume that previously doing Also the default Thanks for the input and testing! |
I was not able to directly reproduce your problem @bvr-yr. But I fixed some issues that might have caused it beeing stuck at checkWaiting. The Invalid Key down logs are currently a problem when switching to a different tty. Regarding displaying if the account is locked: test "$(faillock --user $my_user | wc -l)" -ge "$max_attempts_plus_two" && echo "Locked"` |
yeah can confirm now works correctly, unlocking by |
closed by accident xD. hyprlock_2fa.mp4 |
how you configured this 2fA by using pam can you give some insight or direct me to the docs? |
This is google-authenticator-libpam. |
This reverts commit 8970294. Without the backup we avoid rendering the prompt placeholder for one frame when the failText is not available. Looks better this way.
rare occasion where a path check even works on nix
690cf4e
to
9cec507
Compare
Idk the Prompt being empty might be related to a weird pam config. Should not happen normally, since we are not setting a new placeholder when the prompt text is empty. I think it is ready @vaxerski Will make a wiki mr later today! |
alr wiki mr then |
@vaxerski done |
Nevermind I just reproduced the empty placeholder and noticed I did some dumb stuff. let me check that again. 😅 |
tag me when done then |
Alright @vaxerski ready for review Reason I needed to revision some stuff is that I noticed that not restarting the authentication immediately on a failure was dump. Now I tested multiple authentication stages, as well as the weird su pam config on fedora. |
Edge case, but would it also be possible to allow the setting of the path for the PAM module directory that is checked here or does that have to be hardcoded? I noticed from your wiki PR:
If I declare
If we can delcare the path then when the nix module is updated the path can also be set more in a more nix-friendly manner through that? Not sure if that would be in scopre for this PR. |
When you add a pam configuration via NixOs, it gets added to /etc/pam.d. |
You're better than me ;) Let me take a look, nice one. |
top |
@PaideiaDilemma can I get a wiki mr for the auth opt |
I'm not 100% sure if this is the correct place to address this, but i have been following this PR quite some time and am happy to see it is finally happening. Thanks in advance!! I just updated hyprlock and I am using my own pam-module (#209) and noticed the following... I wanted to ask if this is expected behaviour because of this PR and the option to specify your own pam_module in config?
|
I also noticed something else because of https://github.com/hyprwm/hyprlock/pull/205/files/43b13bfb71899f73dba80567e5dae8216f21cdb1#r1559789603 I'm not 100% sure if this is the root cause, but it's my best guess... I am using the following pam_module:
and when I lock my screen, the fingerprint starts to expect "input" and times out after x seconds. After it times out, it starts to query my yubikey (u2f) if present, which then also times out (in a scenario where I lock my screen and leave the yubikey plugged in). |
Apparently there it is a known issue with pam_fprintd.so that you can't disable the timeout. There is a PR for that. For now, there should be a mechanism to test user presence before starting auth. Something like press any key to unlock. Something that can easily be added and removed via config. |
this keeps troubling me, I was getting faillocks pretty often cause I use hyprlock with grace when smth is playing. I tried to dig a bit and it seems like |
I do not understand why faillock would be involved at all, when a grace unlock happens. Can you open an issue for that? |
Hi!
Currently, on paper, we don't handle the pam conversation fully like it is intended by pam. (#107)
This is an implementation where we actually would handle it properly. At least I think so from what I gathered.
BUT, this kinda has diminishing returns, since you would only need this if you use a weird custom pam config or 2FA and I don't know if there are people who want a 2FA lockscreen.
I think fingerprint and yubikeys should work fine with the current solution (pls correct me if I am wrong).
Also having a fallback pam module is not really feasible this way. (To be fair personally I am not a fan of the su fallback, since it makes me have to wait longer when I fat finger my password)
What it gives you is the pam prompt and the ability to input multiple things in order to authenticate with pam.
Implementation Notes
Thought about using a socket like @Mikilio tried in #200.
But it seemed a bit overkill and I don't really want to send raw passwords over a socket if I don't have to.
This just uses a CV to wait for input.
I put this out to discuss. Still needs double checking. Also sorry for the single fat commit.
Question
I kinda think it would be cool to support a full conversation like this. But Idk if anyone would use it. Do we want it or no?
And sorry to @Mikilio for just overtaking this. I hope you don't mind ❤️
Closes #170