Firebase Security Rules

Enforce default-deny Firebase Firestore and Storage security rules with authentication, ownership, and RBAC checks.

1|Updated Jan 5, 2026
One-click install
npx skills add https://github.com/cypxxc/RMU-Campus-X --skill firebase-security-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Firebase Security Rules
Source: https://github.com/cypxxc/RMU-Campus-X/tree/main/.agent/skills/firebase-security-rules
Command: npx skills add https://github.com/cypxxc/RMU-Campus-X --skill firebase-security-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforce secure access to Firebase Firestore and Storage by starting with a strict deny-all posture and granting access only through precise, codified rules.

Core Features & Use Cases

  • Default Deny: deny everything by default and explicitly allow only what is needed.
  • Authentication & Ownership: require authenticated users and validate ownership for sensitive data.
  • Data Validation & RBAC: enforce data schemas and role-based access for admin actions.
  • Storage protections: apply similar controls to Firebase Storage, including file type and size checks.

Quick Start

Enable a default-deny baseline for Firestore and Storage rules, then progressively add precise allow conditions for authenticated users, ownership checks, and data validation.

Frequently Asked Questions about Firebase Security Rules

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

FAQPage Schema
How do I secure Firebase Firestore with a default deny security rules posture?

To secure Firebase Firestore with a default deny posture, you deny all access by default and explicitly allow only authenticated operations, ownership checks, and data validation conditions. This ensures strict access control for sensitive user data.

What is the best way to enforce ownership validation and authentication in Firebase Storage rules?

The best way to enforce ownership and authentication in Firebase Storage rules is requiring request auth checks and validating file ownership before permitting uploads. You also apply data validation through file type and size checks for robust storage protections.

Can I implement role-based access control for admin actions using Firebase Security Rules?

Yes, you can implement role-based access control for admin actions using Firebase Security Rules. The rules enforce data schemas and validate specific user roles, ensuring only explicitly permitted admin operations are allowed under a strict default deny posture.

How do I validate data schemas and prevent unauthorized file uploads in Firebase?

You validate data schemas and prevent unauthorized file uploads by applying strict Firebase Security Rules. These rules require authentication, validate request data against expected schemas, and restrict Storage uploads by checking file type and size constraints.

Do I need App Check to implement Firebase Security Rules for Firestore and Storage?

App Check is not strictly required to implement Firebase Security Rules, but it is considered a best practice alongside default deny, authentication, and ownership validation to protect Firestore and Storage data from unauthorized access.