1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/accounts
catborise c2fea2aa39 feat(accounts): failed logins lock a user for the address they come from
Nothing limited failed logins: a password could be guessed at the speed
the server answers. django-axes (8.3.1, Django 5.2, Python 3.10-3.13)
now counts them.

- A user is locked for the address the failed logins come from
  (username and IP together), so an attacker cannot lock someone out
  from elsewhere and users behind one NAT address do not share a lock.
  A successful login resets the count. axes sits in front of every
  authentication: the login page with or without OTP, LDAP and the API.
- The number of failed logins (default 5) and the lock time in minutes
  (default 15) are on the Settings page (LOGIN_FAILURE_LIMIT,
  LOGIN_LOCKOUT_MINUTES, added by migration appsettings.0014) and apply
  at once; an invalid value falls back to the default. Unlock with
  "manage.py axes_reset_username <username>".
- Behind the bundled nginx every request comes from 127.0.0.1; the
  client address is read from X-Real-IP, which nginx sets, but only for
  requests from a loopback address or from LOGIN_TRUSTED_PROXIES, so a
  forged header does not escape a lock.

settings.py.template gets the app, middleware, backend and AXES_*
settings; README tells existing installations what to copy. Tests that
call client.login now pass a request, which the axes backend needs.
The new tests fail with axes disabled.
2026-10-06 11:05:03 +03:00
..
migrations fix(accounts): migrate no longer overrides the change-password permission 2026-10-04 20:26:53 +03:00
templates fix: require POST for user block/unblock and OTP email, flag console cookie 2026-10-02 22:44:00 +03:00
templatetags lint with black python. convert f style strings to old one. some small fixes 2020-11-05 12:34:31 +03:00
__init__.py Fixe migrations for new deployments 2020-05-28 18:19:25 +06:00
apps.py fix(accounts): migrate no longer overrides the change-password permission 2026-10-04 20:26:53 +03:00
checks.py fix(accounts): migrate no longer overrides the change-password permission 2026-10-04 20:26:53 +03:00
forms.py format python code with black 2022-11-02 08:54:35 +03:00
lockout.py feat(accounts): failed logins lock a user for the address they come from 2026-10-06 11:05:03 +03:00
middleware.py fix(accounts): first-login password change is stored, not in the session 2026-10-04 01:08:11 +03:00
models.py fix(accounts): first-login password change is stored, not in the session 2026-10-04 01:08:11 +03:00
test_admin_email_otp.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_admin_password.py feat(accounts): failed logins lock a user for the address they come from 2026-10-06 11:05:03 +03:00
test_change_password_permission.py fix(accounts): migrate no longer overrides the change-password permission 2026-10-04 20:26:53 +03:00
test_checks.py feat(accounts): Django's LoginRequiredMiddleware replaces the package 2026-10-04 01:08:11 +03:00
test_email_otp.py fix(accounts): the "Lost OTP?" page cannot be used to flood or break 2026-10-05 20:06:02 +03:00
test_first_login_password.py feat(accounts): failed logins lock a user for the address they come from 2026-10-06 11:05:03 +03:00
test_login_lockout.py feat(accounts): failed logins lock a user for the address they come from 2026-10-06 11:05:03 +03:00
test_security_fixes.py feat(security): enforce require_POST on power actions, prevent open redirects, and isolate instance permissions 2026-09-27 13:20:45 +03:00
test_utils.py ci: replace super-linter with ruff 2026-10-04 01:08:11 +03:00
tests.py feat(accounts): failed logins lock a user for the address they come from 2026-10-06 11:05:03 +03:00
urls.py fix(tests): decouple tests from local libvirt, support configurable test host, and fix URL/logging bugs 2026-09-25 11:51:45 +03:00
utils.py feat(security): enforce require_POST on power actions, prevent open redirects, and isolate instance permissions 2026-09-27 13:20:45 +03:00
views.py fix(accounts): the "Lost OTP?" page cannot be used to flood or break 2026-10-05 20:06:02 +03:00