← Back to Guides

    How to Secure Firebase

    Step-by-step guide to securing your Firebase backend. Master Security Rules and protect your data.

    Critical: Disable Test Mode

    Test mode rules allow anyone to read and write all data. This is the most common Firebase security mistake. Replace test rules with production Security Rules before launch.

    Security Checklist

    1

    Disable test mode rules

    Critical

    Replace test mode rules that allow all reads/writes with production security rules.

    2

    Write Security Rules

    Critical

    Create specific rules for Firestore, Realtime Database, and Storage.

    3

    Test Security Rules

    Critical

    Use Firebase Emulator Suite to test rules before deployment.

    4

    Understand API key visibility

    Firebase API keys are public by design - security comes from Security Rules, not key secrecy.

    5

    Configure App Check

    Enable App Check to prevent unauthorized API access.

    6

    Set up Authentication

    Configure Firebase Auth with appropriate providers and settings.

    7

    Review Cloud Functions

    Audit Cloud Functions for security vulnerabilities and proper authentication.

    8

    Enable audit logging

    Set up Cloud Audit Logs for Firebase operations.

    9

    Configure Storage rules

    Set appropriate access rules for Firebase Storage buckets.

    10

    Review hosting configuration

    Ensure proper headers and redirects in firebase.json.

    11

    Enable rate limiting

    Configure rate limiting on Cloud Functions and API endpoints.

    12

    Set up monitoring

    Enable Firebase Performance Monitoring and Crashlytics.

    13

    Run security scan

    Use VibeEval to test Security Rules automatically.

    Related Resources

    Test Your Security Rules Automatically

    VibeEval can automatically test your Firebase Security Rules to find misconfigurations.

    Scan Your Firebase App