Skip to content

Feature: Login attempt rate limiting with lockout / exponential backoff #1501

Closed

Description

@larryro

Context

Compliance requires that login attempts be limited — either account lockout after N failures, or exponential backoff, or timely notification to operators. We currently have none. @convex-dev/rate-limiter is wired up for other flows in services/platform/convex/lib/rate_limiter/index.ts, but no rule exists on sign-in failures.

Proposed change

  1. Add rate-limit rules keyed by both email and ip on sign-in failures (defeats password-spray and distributed brute force).
  2. Default policy: exponential backoff (1s → 10s → 60s → 10m). Configurable via org settings.
  3. On lockout, emit an auditLogs entry with category security and send a notification email to org admins.
  4. Wire into Better Auth sign-in hooks (see services/platform/convex/auth.ts).

Acceptance criteria

  • After N failed attempts (configurable, default 5), subsequent attempts are delayed or blocked.
  • Audit log records lockout events.
  • Admins receive notification on lockout.
  • E2E test covers happy path + lockout.

Part of the security compliance baseline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featpriority: highservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions