better-auth-security-best-practices

Configure Better Auth security settings for secrets, rate limiting, CSRF, and sessions.

5|1|Updated Mar 27, 2024
One-click install
npx skills add https://github.com/viclafouch/petit-meme --skill better-auth-security-best-practices-viclafouch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-security-best-practices
Source: https://github.com/viclafouch/petit-meme/tree/main/.agents/skills/better-auth-security-best-practices
Command: npx skills add https://github.com/viclafouch/petit-meme --skill better-auth-security-best-practices-viclafouch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive guidance on implementing robust security measures for authentication systems, addressing common vulnerabilities and ensuring data integrity.

Core Features & Use Cases

  • Secret Management: Securely configure and manage authentication secrets.
  • Rate Limiting & CSRF Protection: Implement defenses against brute-force attacks and cross-site request forgery.
  • Session & Cookie Security: Ensure secure session handling and cookie configurations.
  • OAuth & IP-Based Security: Harden OAuth integrations and leverage IP tracking for security.
  • Auditing & Prevention: Utilize database hooks for auditing and implement measures against account enumeration.
  • Use Case: A developer needs to ensure their Better Auth implementation is production-ready by reviewing and applying all recommended security configurations, from secret management to session handling and auditing.

Quick Start

Review the security checklist and ensure all items are addressed before deploying to production.

Frequently Asked Questions about better-auth-security-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the essential authentication security best practices for production?

Secure authentication requires strict secret management, rate limiting, CSRF protection, and robust session handling. This Skill provides configuration examples for the Better Auth framework to implement these comprehensive security measures.

How do I prevent account enumeration and timing attacks in my auth system?

Prevent account enumeration and timing attacks by utilizing database hooks for auditing and executing authentication checks as background tasks. This ensures consistent response times and obscures valid user data from attackers.

How do I configure rate limiting and CSRF protection for authentication?

Configure rate limiting and CSRF protection by applying framework-specific defense mechanisms against brute-force attacks and cross-site request forgery. This Skill details the exact configuration steps needed to secure authentication endpoints.

Does this security guidance work with my existing OAuth and social provider setup?

Yes, this guidance hardens OAuth integrations and social provider configurations. It provides specific examples to secure external authentication flows and leverages IP-based tracking to monitor and restrict malicious access attempts.

What's the best way to manage authentication secrets and session cookies?

The best way to manage authentication secrets and session cookies is to enforce secure, strict configuration policies. This Skill outlines how to properly handle session data and manage secrets to maintain robust authentication security.