feat(auth): throttle logins, close sessions on password change, password policy
All checks were successful
Deploy Gameservers Control / check (push) Successful in 6s
Deploy Gameservers Control / deploy (push) Has been skipped

- limit login attempts per IP (5 per 15 min by default, counted before the
  password check so parallel requests cannot exceed it), 429 + Retry-After,
  failed logins logged with the client IP
- TRUSTED_PROXIES env to honour X-Forwarded-For from the reverse proxy only
- changing or regenerating a group password closes that group's other
  sessions; deleting a group closes all of its sessions
- new group passwords: 12 to 256 characters and not shared with another
  group (login opens the first matching group)
- PATCH /groups/:id/password no longer echoes the password
- purge expired sessions every 10 minutes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-12-02 12:34:11 +01:00
parent 55be6bf034
commit 7d89a4e646
10 changed files with 280 additions and 16 deletions

View file

@ -16,6 +16,8 @@ Variables utiles:
- `GAMESERVERS_STATUS_FILE`: chemin du JSON de statut monte en NFS.
- `STORAGE_DIR`: dossier de stockage local, defaut `storage`.
- `SESSION_TTL_HOURS`: duree des sessions, defaut `12`.
- `TRUSTED_PROXIES`: reverse proxys de confiance (ex: `loopback,192.168.0.104`), vide par defaut.
- `LOGIN_MAX_ATTEMPTS` / `LOGIN_WINDOW_MINUTES`: tentatives de connexion par IP, defaut `5` par `15` minutes.
- `*_SSH_TARGET`: cible SSH du profil de lancement, alias SSH ou `user@host`.
- `*_SSH_PORT`: port SSH optionnel. Vide par defaut.
- `*_SSH_KEY_FILE`: chemin optionnel vers une cle SSH privee.