Replies: 3 comments 5 replies
-
Are you sure you want that? This means that an already-logged-in user who gets logged out for reasons outside of their control (for example a mobile app version upgrade) who isn't connected to the 'blessed' network won't be able to log in again, and will not have access to their vault contents. |
Beta Was this translation helpful? Give feedback.
-
|
From my point of view that is more an item for a reverse proxy than Vaultwarden. |
Beta Was this translation helpful? Give feedback.
-
|
This can be implemented using nginx + fail2ban |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know that this was already discussed, like here for admin panel access: #5954 and the solution was to resolve this with a reverse proxy filter.
This is a different feature request because it can't be solved with a reverse proxy filter.
I want to allow logins/signups only from allowed IP ranges but allow external access for already logged in users. Looking at the logs I can see that when a user logins it make a request to
/identity/accounts/preloginand probably all/identity/accounts/could be blocked from external IP to limit new logins and signups.But the endpoint
/identity/connect/tokenis constantly accessed by already logged in users and could not be blocked. The problem is that this endpoint allows making a login right there too! See https://github.com/dani-garcia/vaultwarden/blob/main/src/api/identity.rs#L47So, restricting access only to
/identity/accounts/is useless.I can see that all login methods "password", "client_credentials" and "authorization_code" finally call
check_limit_loginfor rate limiting. This isn't called when "refresh_token" is needed, I think that's ok. So, to limit logins to some IP we should only changecheck_limit_loginto check if IP is in a valid range, that would require a new config variable likeLOGIN_ALLOWED_IP_RANGES.This can also be done if there was a whitelist for login rate limits, like
LOGIN_RATELIMIT_WHITELIST, so that we can allow some IP ranges there and block all others settingLOGIN_RATELIMIT_MAX_BURST=0.Beta Was this translation helpful? Give feedback.
All reactions