Allow disabling local password through broker.conf - #1234
Conversation
Signed-off-by: Shiv Tyagi <shivtyagi3015@gmail.com>
…rd` in broker.conf Signed-off-by: Shiv Tyagi <shivtyagi3015@gmail.com>
5495017 to
ba71c03
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
==========================================
- Coverage 87.64% 80.54% -7.10%
==========================================
Files 91 20 -71
Lines 6231 987 -5244
Branches 111 0 -111
==========================================
- Hits 5461 795 -4666
+ Misses 714 192 -522
+ Partials 56 0 -56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
adombeck
left a comment
There was a problem hiding this comment.
Thank you for working on this, @shiv-tyagi! There's still a bit of work for us to do here, most notably we will have to figure out how to unlock the keyring when there's no local password.
| session.nextAuthModes = []string{authmodes.NewPassword} | ||
|
|
||
| return AuthNext, nil | ||
| // Only require password creation if local password authentication is not disabled |
There was a problem hiding this comment.
| // Only require password creation if local password authentication is not disabled | |
| // Require password creation unless local password authentication is disabled |
| ## | ||
| ## When enabled: | ||
| ## - Users will not be able to create or use local passwords | ||
| ## - Device authentication will be required for every login |
There was a problem hiding this comment.
| ## - Device authentication will be required for every login | |
| ## - Device authentication will be required for every authentication attempt, | |
| ## including logins and privileged operations (e.g. sudo, polkit actions) |
| ## - Device authentication will be required for every login | ||
| ## - Local password authentication mode will not be offered | ||
| ## | ||
| ## Important: Enabling this option prevents offline login entirely. |
There was a problem hiding this comment.
| ## Important: Enabling this option prevents offline login entirely. | |
| ## Important: Enabling this option prevents offline authentication entirely. |
| if !b.cfg.disableLocalPassword { | ||
| session.nextAuthModes = []string{authmodes.NewPassword} | ||
| return AuthNext, nil | ||
| } |
There was a problem hiding this comment.
Another consequence of not creating a local password is that the keyring can't be unlocked. #1190 also won't fix it in that case.
There was a problem hiding this comment.
Okay. We can discuss about this. I will post here if I get an idea about this.
| ## When enabled: | ||
| ## - Users will not be able to create or use local passwords | ||
| ## - Device authentication will be required for every login | ||
| ## - Local password authentication mode will not be offered |
There was a problem hiding this comment.
Note to self: We should probably point users to force_provider_authentication here, and maybe briefly discuss the use cases of force_provider_authentication and disable_local_password.
There was a problem hiding this comment.
Yes, force_provider_authentication only comes into play when the user tries logging in through local password.
Maybe we can add an explanation mentioning about when force_provider_authentication makes sense.
| if !b.cfg.disableLocalPassword { | ||
| session.nextAuthModes = []string{authmodes.NewPassword} | ||
| return AuthNext, nil | ||
| } |
There was a problem hiding this comment.
Note to self: Manually test:
- ssh
- sudo
- pkexec
- unlocking keyring
Ideally we should add e2e tests for those.
There was a problem hiding this comment.
Also test what happens when you lock the screen when there's no local password. Can the screen even be locked? Does it offer device authentication to unlock the screen? Document the behavior (and point out the terrible UX of having to use device authentication to unlock the screen).
|
Hey, @shiv-tyagi! Are you still around? Can you address @adombeck's comments on the PR and rebase it on main so we can move forward with this? |
|
Hey @denisonbarbosa, yes I am working on it. Will do it tonight. Thanks. |
|
I would think we could manage this on per-service options instead (as per #1675) so that we could also disable a particular UI daemon-side, depending on the service. |
I agree that it should be possible to disable the local password per service (e.g. disable it for ssh but enable for sudo). See also #726 (comment) I'm not sure if it belongs in the authd.yaml though or the broker.conf. It requires some more thought. However, I'm out of office until August 10, so I won't be able to finish the design or review a proposal until then. |
|
@adombeck will this be in this PRs scope or could be a follow up? If in the scope of this PR, I will hold it off till you return. |
|
Yeah I think it makes sense to first finish the design and then implement it (possibly iteratively). We don't want to merge something that is configured via a setting that we might change soon after, possibly invalidating existing config files. Note that everyone else in the team will also be out of office the next two weeks, so we wouldn't be able to continue here anyway. |
Closes #726
This adds the
disable_local_passwordoption to the broker.conf. When set to true, the local password authentication mode is disabled completely and the user is forced to authenticate with device authentication.In device authentication mode, the set local password step after successful authentication is skipped as well because it is not needed anymore.
I have tested this locally and it works as described.