-
Notifications
You must be signed in to change notification settings - Fork 0
Add explicit "Require authentication" option #5
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
Conversation
|
(With #4 merged, this now targets syncthing#9175 directly) |
|
Wow, this is a rather elaborate change. I'd frankly get the WebAuthn stuff merged first before starting on this refinement. At least in this level of detail / sophistication, I don't see an immediate need or it being a blocker for the main PR. |
|
One more thing that comes to mind, but should also be punted off for a later PR: We do show a message and block WebAuthn login when no credentials are configured. But I think we don't do the same for the opposite case when no user / password is configured but only WebAuthn. Should be discussed whether giving that indication would actually weaken security. |
Ok, you'll have to debate that with @imsodin who requested it be part of the WebAuthn PR. Or alternatively, I guess we could also isolate this as a standalone change on the main branch.
Yeah, this does leak the information that WebAuthn is not configured, which - without this explicit "require auth" option - implies that password auth is configured, which is likely an easier target to break. When WebAuthn is configured, there is no indication of whether or not password is configured. In order to efficiently support external security keys with limited storage space, we need to first query the server for the There are a few ways we could eliminate the information leak:
Weighed against these concerns, my personal opinion is that the information leak seems fine. I don't think it seems like much of a problem in Syncthing's case. I assume that most Syncthing instances are only accessible via loopback or within a restricted intranet, and very few are exposed to the internet, so it doesn't seem very useful to be able to probe around for Syncthing instances that allow password auth (which, by the way, is currently every Syncthing instance that requires auth, unless it uses LDAP). Actually - as I alluded to at the beginning - this very PR is a kind of 4th option: add the option to disable password auth, while still requiring auth even if no authentication method is configured. I hadn't considered it before writing this, but this actually also mitigates the impact of the information leak, because the fact that auth is required no longer necessarily tells you whether or not password auth is enabled. |
|
OK, this is a lot to get my head around, but I've taken some time to rethink this whole "conditional authentication" thing.
That is definitely an undesired state (total lock-out). Sure, it doesn't disclose to an attacker which vector would be feasible, but to get the same usability (none), one could simply block the GUI access completely. 😉 So let's put aside the information leak for now. I really don't like this additional "require auth" boolean option, mainly because it does open all these possibilities for inconsistent configuration (a.k.a. footguns). I do however support moving the WebAuthn config to the regular
I propose the following logic, instead of adding this additional boolean config: This results in: Main difference to the current state of syncthing#9175: Ineligible credentials (with RP ID mismatch) still lead to requiring auth, but do not facilitate logging in. Preventing lock-out could be done by requiring a new, eligible, WebAuthn credential to be added simultaneously when changing RP ID, or all now ineligible credentials being deleted, or having password auth available as a fall-back. These conditions could be checked upon saving, or simply stated in the documentation. I expect anyone changing the RP ID in advanced settings to have read the docs first, so avoiding lock-out programmatically could very well be excluded from the big WebAuthn PR (at first). |
|
Leaking that password auth is available is not any worse than the pre-webauthn state, so it's definitely not a blocker. Beyond that I don't care about details and in case of tradeoffs would go in favor of UX or simplicity/feasibility (getting this change done). Notably I did not forget security, I do mean to say I don't care, see first point. Just my opinion. As for using some criteria like proposed by acolomb over this additional config flag: Fine as well with me, combined with a warning in the UI whenever a config change causes the "auth required state" to go from true to false. Not even needed to be targeted, just put something like "Continuing will disable auth for the web UI, are you sure you want that?" in the users face before actually saving the config change. I just want it to be very hard resp. have the user be very explicit in their intent, before making the web UI world accessible when it was previously not. |
|
Ok, so what I'm hearing is we drop this PR and instead add a pre-config-save warning before saving config changes that would disable the authentication requirement. Did I get that right? If not, let me know and we can re-open this and reconsider. |
|
Yes, in principle. Let's first concentrate on #7 and as I said above, that reduces the risk significantly already. The remaining potential for lock-out or accidentally leaving the GUI completely open should be checked while saving the config. But IMHO that part could be punted off for a later PR, not needing to block the WebAuthn integration in general. |
This is a meta-PR into:
@imsodin I believe this should address the first half of syncthing#9175 (comment).
To help the user understand the subtleties of how these settings interact, I added a box of warnings and validation messages that may appear in the modal footer while editing settings. If validation fails (red messages), the "Save" button is also disabled. Warnings do not disable the button, but are visible in the footer no matter which settings tab is open. I also added conditional highlights and indicator icons in the GUI settings to help the user identify which settings are in conflict.
Screenshots
Initial state
Password set but not enabled
WebAuthn set but not enabled
Authentication enabled but not possible
Authentication enabled but WebAuthn credentials ineligible
Warnings always visible