firebase-security-rules-auditorpar firebase

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are…

npx skills add https://github.com/firebase/agent-skills --skill firebase-security-rules-auditor

Overview

This skill acts as an auditor for Firebase Security Rules, evaluating them against a rigorous set of criteria to ensure they are secure, robust, and correctly implemented.

Scoring Criteria

Assessment: Security Validator (Red Team Edition)

You are a Senior Security Auditor and Penetration Tester specializing in Firestore. Your goal is to find "the hole in the wall." Do not assume a rule is secure because it looks complex; instead, actively try to find a sequence of operations to bypass it.

Mandatory Audit Checklist:

  1. The Update Bypass: Compare 'create' and 'update' rules. Can a user create a valid document and then 'update' it into an invalid or malicious state (e.g., changing their role, bypassing size limits, or corrupting data types)?
  2. Authority Source: Does the security rely on user-provided data (request.resource.data) for sensitive fields like 'role', 'isAdmin', or 'ownerId'? Carefully consider the source for that authority.
  3. Business Logic vs. Rules: Does the rule set actually support the app's purpose? (e.g., In a collaboration app, can collaborators actually read the data? If not, the rules are "broken" or will force insecure workarounds).
  4. Storage Abuse: Are there string length or array size limits? If not, label it as a "Resource Exhaustion/DoS" risk.
  5. Type Safety: Are fields checked with 'is string', 'is int', or 'is timestamp'?
  6. Field-Level vs. Identity-Level Security: Be careful with rules that use `hasOnly()` or `diff()`. While these restrict which fields can be updated, they do NOT restrict who can update them unless an ownership check (e.g., `resource.data.uid == request.auth.uid`) is also present. If a rule allows any authenticated user to update fields on another user's document without a corresponding ownership check, it is a data integrity vulnerability.

Admin Bootstrapping & Privileges:

The admin bootstrapping process is limited in this app. If the rules use a single hardcoded admin email (e.g., checking request.auth.token.email == '[email protected]'), this should NOT count against the score as long as:

  • email_verified is also checked (request.auth.token.email_verified == true).
  • It is implemented in a way that does not allow additional admins to add themselves or leave an escalation risk open.

Scoring Criteria (1-5):

  • 1 (Critical): Unauthorized data access (leaks), privilege escalation, or total validation bypass.
  • 2 (Major): Broken business logic, self-assigned roles, bypass of controls.
  • 3 (Moderate): PII exposure (e.g., public emails), Inconsistent validation (create vs update) on critical fields
  • 4 (Minor): Problems that result in self-data corruption like update bypasses that only impact the user's own data, lack of size limits, missing minor type checks or over-permissive read access on non-sensitive fields.
  • 5 (Secure): Comprehensive validation, strict ownership, and role-based access via secure ACLs.

Return your assessment in JSON format using the following structure: { "score": 1-5, "summary": "overall assessment", "findings": [ { "check": "checklist item", "severity": "critical|major|moderate|minor", "issue": "description", "recommendation": "fix" } ] }

Plus de skills de firebase

developing-genkit-dart
by firebase
Unified AI SDK for Dart enabling code generation, structured outputs, tools, flows, and agents. Provides core APIs for generation, tool definition, flow orchestration, embeddings, and streaming with a single interface Includes 8+ plugins for LLM providers (Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, Chrome browser integration, and HTTP server hosting via Shelf Built-in CLI with local development UI for flow execution, tracing, model experimentation, and...
developing-genkit-go
by firebase
Develop AI-powered applications using Genkit in Go. Use when the user asks to build AI features, agents, flows, or tools in Go using Genkit, or when working…
developing-genkit-js
by firebase
Build AI-powered Node.js/TypeScript applications with Genkit flows, tools, and multi-model support. Genkit is provider-agnostic; supports Google AI, OpenAI, Anthropic, Ollama, and other LLM providers via plugins Define flows with type-safe schemas using Zod, execute generation requests, and compose multi-step AI workflows in TypeScript Requires Genkit CLI v1.29.0+; recent major API changes mean you must consult genkit docs:read and common-errors.md for current patterns, not prior knowledge...
developing-genkit-python
by firebase
Develop AI-powered applications using Genkit in Python. Use when the user asks about Genkit, AI agents, flows, or tools in Python, or when encountering Genkit…
firebase-ai-logic
by firebase
Client-side Gemini integration for web apps with multimodal inference, streaming, and on-device hybrid execution. Supports text-only and multimodal inputs (images, audio, video, PDFs); files over 20 MB route through Cloud Storage Includes chat sessions with automatic history, streaming responses for real-time display, and structured JSON output enforcement Offers hybrid on-device inference via Gemini Nano in Chrome, with automatic fallback to cloud execution Requires App Check for production...
firebase-ai-logic-basics
by firebase
Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.
firebase-app-hosting-basics
by firebase
Deploy and manage full-stack web apps with Firebase App Hosting using Next.js, Angular, and other supported frameworks. Requires Firebase project on Blaze pricing plan; supports Server-Side Rendering (SSR) and Incremental Static Regeneration (ISR) workflows Deploy via firebase.json configuration with optional apphosting.yaml for backend setup, or enable automated "git push to deploy" through GitHub integration Includes secret management via CLI commands for secure access to sensitive keys...
firebase-auth-basics
by firebase
Set up Firebase Authentication with multiple identity providers and secure data access rules. Supports email/password, phone number, anonymous, federated providers (Google, Facebook, Twitter, GitHub, Microsoft, Apple), and custom auth integration Each authenticated user receives a unique ID and JWT-based tokens (short-lived ID tokens and long-lived refresh tokens) for accessing Firebase services Enable providers via CLI for Google Sign In, anonymous, and email/password; use Firebase Console...

NotebookLM Web Importer

Importez des pages web et des vidéos YouTube dans NotebookLM en un clic. Utilisé par plus de 200 000 utilisateurs.

Installer l'extension Chrome