Security

Passkeys and second factors, brute-force locks, security emails, and what single sign-on guarantees.

Authentication#

  • Passwords: bcrypt (12 rounds), Laravel's Password::defaults() in production (12+ chars, mixed case, numbers, symbols, not in known breaches).
  • Passkeys / security keys: WebAuthn via laravel/passkeys, bound to APP_URL's host, user handle derived from PASSKEYS_USER_HANDLE_SECRET. Registration requires password confirmation.
  • Second factor after the password, whichever the person set up: the authenticator app (TOTP, Fortify, confirmed on enrolment, recovery codes), a passkey or security key of the same account (only its own credentials are offered), or a code by email (6 digits, 10 minutes, this browser only, 5 attempts, stored as an HMAC). A passkey used without a password, with user verification, counts as both factors.
  • CHECKIN_REQUIRE_SECOND_FACTOR (none, admins — the default —, everyone): until a second factor is set up, the person reaches only Settings → Security; applications and /oauth/authorize wait. The last second factor cannot be removed while one is required.
  • Google / GitHub / Microsoft (optional, Socialite): only identities connected to an existing account sign in (no account creation); state checked on every callback; the second factor still applies; no provider token stored; e-mail matching off by default and never for Microsoft. See social-login.md.
  • Rate limits (per minute): 5 logins per e-mail+IP and 20 per IP, 5 second-factor attempts per account and 20 per IP, 10 passkey ceremonies, 20 code-by-email requests, 20 social sign-in requests per IP, 120 token requests per IP.
  • Brute force (App\Security\BruteForce), on a longer window: wrong passwords, codes and passkeys are counted per account (from anywhere) and per address (whatever the account). Past CHECKIN_LOCK_ACCOUNT_FAILURES (8) in CHECKIN_LOCK_WINDOW_MINUTES (15) the account is locked — even against the right password —, past CHECKIN_LOCK_ADDRESS_FAILURES (25) the address is blocked. Every new lock within a day lasts twice as long (5, 10, 20… minutes up to a day). Resetting the password stays open. Administration → Security lists the locks and lifts them.
  • Emails: a sign-in from a browser or network not seen in 90 days, and a locked account, are sent to the person with a "This was not me" link (signed, 7 days). Reporting signs the account out everywhere (sessions, "remember me", access and refresh tokens of every application), sends a link to choose a new password and alerts the administrators, who also hear of every lock (once an hour per account or address). Settings → Security shows the recent activity with Not me on each line.
  • Changing the password closes every other session.
  • Session regenerated at login; AuthenticateSession on the admin panel; secure/HttpOnly cookies in production.
The second step of a sign-in: a passkey or a security key, the authenticator app, or a code by email
Settings → Security: the passkeys of the account, codes by email, and the recent activity
The email of a sign-in from a new browser, with its “This was not me” button
“Was this you?”: one click signs the account out everywhere and sends a link for a new password

Single sign-on#

  • Authorization Code only (no implicit, no password grant, device code off). PKCE S256 supported for all clients and required for public ones.
  • Redirect URIs matched exactly; secrets stored hashed (Passport); client secrets shown once.
  • ID tokens RS256 with nonce, at_hash, auth_time, and the amr/acr of the sign-in really made (password, one-time code, passkey, federated; mfa when two factors were used): applications can require a second factor. Access tokens 1 h; refresh tokens 14 days, revoked on use (Passport default).
  • roles scope: the roles of the person in that application (Administration → Applications → Roles), for the products of the family and any client that maps groups to roles.
  • Consent screen for untrusted applications; per-application access control; suspended people refused at /oauth/authorize and logged.
  • RP-initiated logout accepts redirects only to registered origins; id_token_hint is verified with our own key.
  • /oauth/token, /oauth/userinfo, discovery and JWKS run without session or CSRF; /oauth/logout is CSRF-exempt by design (cross-origin POST), it only ends a session.

Administration#

  • No separate admin login or UI: the same passkey/2FA-protected session; the admin middleware (User::canAdminister()) enforces the role on every /admin/* route.
  • Updates: only administrators can ask for one; the updater verifies that a release's VERSION matches its tag, never installs an older build, and refuses tracked files changed by hand unless forced.
  • Administrators cannot suspend or demote themselves.
  • Every security-relevant event — and every change an administrator makes to people and applications, with who made it — is written to the audit log (access_logs) with IP and user agent. GDPR: entries are deleted after CHECKIN_AUDIT_RETENTION_DAYS (365) by model:prune, addresses can be shortened (CHECKIN_AUDIT_MASK_IP: IPv4 /24, IPv6 /48), secrets never reach the log, and a deleted account leaves only a pseudonym (Deleted account #…) in its entries and in the failed attempts typed with its address.

Known limits / to-do candidates#

  • Suspending a person does not revoke sessions already open in applications (they expire by themselves). Back-channel logout to the applications would close this gap.