What problem does it solve?
This skill provides a comprehensive blueprint for implementing security features across Better Auth, including secret management, rate limiting, CSRF protection, trusted origins, session and cookie security, OAuth safeguards, IP-based controls, and auditing.
Core Features & Use Cases
- Secret Management: manage and validate signing secrets, rotate keys safely, and enforce secure storage practices.
- Rate Limiting: protect endpoints from brute-force attacks with configurable per-endpoint rules, storage options, and automatic protections.
- CSRF Protection: multi-layer defenses including origin checks, fetch metadata analysis, and safe defaults.
- Trusted Origins: enforce allowed origins, wildcards, and dynamic origin computation for secure redirects.
- Session & Cookie Security: robust session expiration, cookie attributes, and cross-subdomain settings.
- OAuth / Social Provider Security: PKCE enforcement, secure state handling, and token encryption.
- IP-Based Security: header-based IP tracking, IPv6 subnet grouping, and trusted proxy headers.
- Database Hooks for Security Auditing: hooks to emit audit events on key operations.
- Background Tasks for Timing Attack Prevention: ensure operations complete in constant time where possible.
- Account Enumeration Prevention: uniform responses and dummy operations to obscure user existence.
- Complete Security Configuration Example: end-to-end sample configuration.
Quick Start
Configure your Better Auth instance with a strong secret, trusted origins, and enabled security features to start securing your app.