Commit Graph
11 Commits
Author SHA1 Message Date
Lucas RayanandClaude Opus 5.5 348e61ca95 fix(auth): close unauthenticated lockout and tighten the daemon's edges
Key login failures by username and client address with decay, plus a loose
per-username limit that delays every address by a bounded time. Refused
attempts write nothing. Unknown usernames share the code path. MFA and session
password checks keep a persistent user-bound count that needs a password or a
session to reach.

Also: local mode refuses a non-loopback bind outside a container; security
headers on every response; the Argon2 permit lives as long as the blocking
task; a required password change rechecks role, MFA and epoch; auth reset
works for any user; mfa_enabled in /api/auth/state; disabling MFA that is off
is refused with no side effects; StateCorrupt keeps only line and column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 21:03:27 -03:00
Lucas RayanandClaude Opus 5.5 5ad89d5be5 fix(auth): throttle bootstrap and require reauth for user changes
Bootstrap takes the client IP, is limited per IP, and writes no audit line
once an admin exists. Creating, changing the role of or deleting a user now
needs a session with recent reauthentication; API tokens are refused.
/api/analyze and /api/update return fixed messages and log the detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:56:59 -03:00
Lucas RayanandClaude Opus 5.5 2b1bc63340 feat(auth): deny-by-default HTTP layer
A global middleware wraps the router and its fallback: only PUBLIC_ROUTES
answer without a credential, and unknown paths look like protected ones.
Adds cookie sessions with per-session CSRF, scoped Bearer tokens, the
/api/auth and /api/admin handlers, Transport for client IP and Secure, and
pending-token enrollment re-checked inside one store update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:51:42 -03:00
Lucas RayanandClaude Opus 5.5 a90ff81650 fix(auth): per-session reauth and admin token lifecycle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:40:08 -03:00
Lucas RayanandClaude Opus 5.5 c2d352ae30 feat(auth): sessions and scoped API tokens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:34:37 -03:00
Lucas RayanandClaude Opus 5.5 411a21ca6e fix(auth): force a password change after reset_admin
reset_admin now sets a persisted must_change_password flag. While it is set,
login and confirm_mfa return PasswordChangeRequired, a ticket that only allows
change_required_password, instead of a session. confirm_mfa therefore returns
LoginStep. change_password clears the flag and refuses the current password
as the new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:29:52 -03:00
Lucas RayanandClaude Opus 5.5 2b71ae41c0 feat(auth): accounts, first-run setup and MFA login flow
Adds AuthService with single-use setup code, password login, TOTP and
recovery codes, enrollment, account management and local admin reset.
Attempts are reserved before Argon2 so parallel guesses cannot outrun the
per-account delay or the IP limit, and unknown usernames follow the same
schedule as real accounts. Passwords are NFC-normalized; repeated-character
and all-digit passwords are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:24:46 -03:00
Lucas RayanandClaude Opus 5.5 deea3e245b feat(auth): password hashing, TOTP and recovery codes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:10:26 -03:00
Lucas RayanandClaude Opus 5.5 fbaeeca60c fix(auth): tail audit log as bytes and check last byte by seeking
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:02:58 -03:00
Lucas RayanandClaude Opus 5.5 c757db209d fix(auth): require state version, atomic key creation, torn audit lines
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:01:11 -03:00
Lucas RayanandClaude Opus 5.5 ef25bf7eb1 feat(auth): encrypted secrets, atomic state and audit log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:57:45 -03:00