Skip to content

Audit: ACCOUNT_LOCKED and SESSION_REVOKED events - #52

Open
touchfalls wants to merge 1 commit into
mainfrom
audit/lock-and-revoke-events
Open

touchfalls wants to merge 1 commit into
mainfrom
audit/lock-and-revoke-events

Conversation

@touchfalls

Copy link
Copy Markdown
Owner

Closes the audit item in ROADMAP.md.

  • The password or 2FA failure that locks an account writes ACCOUNT_LOCKED. Whether it locks is predicted from the account read before the check (Account.nextFailureLocks, same rule as the SQL in incrementFailedAttemptsAtomic). Checks for one player run one at a time, so only two players typing the same name at once could miss or double the event; marked as a shortcut in the code.
  • /sessions revoke writes SESSION_REVOKED (new AuthService.revokeSavedSessions). A failed audit write does not report the command as failed, because the sessions are already gone.
  • LOGIN_FAILURE removed: it was never written, and login_attempts already holds every failure with its reason. Stored rows are read as strings, so nothing breaks on old databases.
  • ADMIN_ACTION was already written on account deletion; the roadmap was out of date.

Tests: AccountLockStateTest, LoginServiceSecurityTest, AuthServiceSecurityTest; ./gradlew test passes locally.

…ILURE

The failure that locks an account (password or 2FA code) now writes ACCOUNT_LOCKED,
and /sessions revoke writes SESSION_REVOKED. LOGIN_FAILURE was never written and
duplicated login_attempts, which already stores every failure with its reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant