Free Firebase Security Checklist for Firestore, Database and Storage Rules
Say who may read and write each path, and get a test matrix of allow and deny cases for your Cloud Firestore, Realtime Database or Cloud Storage rules. It runs in your browser.
Last updated 15 November 2026
This Firebase security checklist turns your own answers about each path into a test matrix for your security rules. Pick Cloud Firestore, Realtime Database or Cloud Storage, list up to 30 paths, and say for each operation who may perform it: nobody, the signed-in owner, any signed-in user or anyone. The tool writes three cases for every operation of every path (signed out, signed in as the owner, signed in as another user), each expecting allow or deny as your answer says, and adds cases beyond those, such as an anonymous account or a query that does not match the rules. Paste your rules as well and it lists the match blocks or database paths it read (the first 100), puts the rule text that names a path and operation beside the case, and raises flags, each marked for review or as a note. It does not run your rules, evaluate a condition or connect to Firebase. The cases are for you to run in the Firebase Local Emulator Suite or a staging project, with invented records.
How to use this tool
- 1
Choose the product and list your paths
Pick Cloud Firestore, Realtime Database or Cloud Storage under Firebase product. Under Paths to check, type one path per line with wildcards in place of IDs. The list takes up to 30 paths of up to 200 characters each.
- 2
Answer each path
A card appears for each path. For every operation the product's rules name, choose who may perform it: nobody, the signed-in owner, any signed-in user or anyone. Then say where the owner's user ID is recorded, name that segment or field, and list any fields that must be validated.
- 3
Paste your rules if you want them compared
The Your rules box is optional and takes up to 50,000 characters of one product's rules. Leave out project IDs, API keys and service account keys: the checklist has no use for them.
- 4
Build the matrix and read the flags
Press Build test matrix. The flags come first, then the cases. Each row gives the path, the operation, the caller, what to do, the expected result and the answer or documentation page it rests on, with rule text beside it when you pasted rules.
- 5
Copy the matrix and run it
Copy the Markdown version into your test plan, then run each case in the Firebase Local Emulator Suite or a staging project, with invented records.
What a Firebase security rules checklist has to cover
Firebase's page "How Security Rules work" says the rules let you specify path-based permissions for clients that connect to your data directly, so a checklist for them works path by path. Its page "Avoid insecure rules" lists the scenarios to look for. Open access: it says that if you are not authenticating users and configuring security rules, anyone who guesses your project ID can steal, modify or delete the data, and it lists read and write access for all users as not recommended. Access for any authenticated user: it says that if one of your rules includes auth != null, you should confirm that you want any logged-in user to have access to the data. Improperly inherited rules, which it marks as a Realtime Database scenario: a rule written at a child node can only grant additional privileges. The same page covers closed access, where every read and write is denied and, it says, the Firebase Admin SDKs and Cloud Functions can still access the database. This tool asks the question those scenarios turn on. For each path and each operation you say whether nobody, the signed-in owner, any signed-in user or anyone may perform it. Writes open to anyone and access for any signed-in user are marked for review, and reads open to anyone get a note, because the same page shows public reads beside owner-only writes as one of its solutions. Firebase's security checklist adds two habits the matrix is built for: write the rule first whenever you need a new document type or path structure, treating rules like a database schema, and unit test your rules with the Firebase Local Emulator Suite. A flag here is a prompt to look, not a verdict. Every flag is marked for review or as a note, and none says a rule is right.
How rules reach nested data in each product
The three products do not treat nested data alike, and Firebase's pages state each product's rule separately. Cloud Firestore: "Structuring Cloud Firestore Security Rules" says security rules apply only at the matched path, so in its example the access controls defined on the cities collection do not apply to the landmarks subcollection, and it says to write explicit rules for subcollections. For rules that apply to an arbitrarily deep hierarchy, it gives the recursive wildcard syntax, as in {document=**}. It says security rules use version 1 by default, in which recursive wildcards match one or more path items, and that in version 2, which you opt in to with rules_version = '2', they match zero or more. The "Security Rules language" page says to avoid recursive wildcards unless you intend for permissive security rules to propagate to all nested paths. Realtime Database works the other way. Its core syntax page says .read and .write rules work from the top down, that a rule granting read or write permissions at a path also grants access to all child nodes under it, and that child rules cannot revoke a read or write privilege. Validation is the exception: the page says .validate rules do not cascade, and that all validate rules must be satisfied at all levels of the hierarchy for a write to be allowed. The conditions page adds that .validate rules run only after a .write rule succeeds to grant access, and are ignored when data is deleted. Cloud Storage: its core syntax page says Cloud Storage Security Rules do not cascade, and that rules are only evaluated when the request path matches a path with rules specified. Two more differences matter for a matrix. For Cloud Firestore and Cloud Storage, each product's page says that where multiple allow expressions match a request, access is allowed if any of the conditions is true. And for Cloud Storage, list rules are only available in projects that use Security Rules version 2. The tool shows the notes for the product you chose with every matrix, each with its page and section.
Why a Firestore rules checklist asks about get and list separately
A Firestore rules checklist that asks only who can read misses a decision the rules let you make. "Structuring Cloud Firestore Security Rules" says a read rule can be broken into get and list, and a write rule into create, update and delete: get applies to single document read requests, and list to queries and collection read requests. It gives allowing single document reads while denying large queries as one reason. Cloud Storage rules use the same five names with their own meanings: create applies to writes to file contents, and update to updates to pre-existing file metadata. For access, Realtime Database rules name .read and .write, so for that product the tool asks about those two and nothing else. List cases deserve their own rows because of how queries are judged. "Securely query data" says security rules are not filters: a query is evaluated against its potential result set, and if it could return documents the client does not have permission to read, the entire request fails. Its example is a query for a whole collection that fails even if the current user is the author of every document, while a query that includes the same constraint as the rules succeeds. For Cloud Firestore, the tool adds that case when you answer the signed-in owner for list and name a field that records the owner. Cloud Storage's core syntax page gives a matching rule for list requests; there the tool adds a note, not a case. Realtime Database has its own rule. Its core syntax page says a read fails immediately if there is no rule at that location or at a parent location that grants access, and that reading at the parent location fails completely even if every affected child path is accessible. The tool adds a parent-read case when you answer the signed-in owner for .read on a path that ends in a wildcard and the parent is not in your list. Where your answers do not settle a result, such as an anonymous account under any signed-in user, the row says decide.
Running the matrix: the emulator, staging and invented records
The matrix is a plan to run, and Firebase's documentation says where. "Get started with Firebase Security Rules" says that to fully validate your app's behaviour and verify your rules configurations, you use the Firebase Emulator to run and automate unit tests in a local environment. It says the Rules Simulator in the Firebase console can quickly validate behaviour, and recommends more thorough testing with the emulator before you deploy changes to production. "Build unit tests" describes the rules unit testing library the cases map onto. RulesTestEnvironment.withSecurityRulesDisabled sets up test data without triggering Security Rules, which is how you seed the invented records a case needs. unauthenticatedContext gives the signed-out caller, and authenticatedContext gives a signed-in one, optionally with custom claims or overrides for the token payload. assertSucceeds and assertFails state the expected result: an allow row should resolve with no Security Rules violations, and a deny row should be rejected with one. The page says the version 9 library is always aware of the emulators and never touches your production resources. If you test against a deployed project instead, Firebase's security checklist says to set up separate Firebase projects for development, staging and production, so use the staging one. Either way, use records you made up: the owner test user and the other user are accounts you create for the run. The unit tests page notes one thing to check first. The emulator loads the rules named in the firestore.rules or storage.rules field of firebase.json, and if that file does not exist and you do not use the loadFirestoreRules or loadStorageRules method, it treats all projects as having open rules. With open rules an allow row succeeds whatever your rules say, so confirm that a deny row fails before you trust the allow rows. In its list of differences between the database emulators and production, the same page says each new database is started with closed rules, so non-admin users will not be able to read or write. Where that applies, confirm that an allow row succeeds too.
What the tool reads from pasted rules, and what it cannot tell you
For Cloud Firestore and Cloud Storage a small parser lists each match block with its full path, the outer paths joined on and the /databases/{database}/documents or /b/{bucket}/o opening left off, then the methods each allow statement names and the condition as text. It steps over function bodies and lists the first 20 names. For Realtime Database the tool removes comments, reads a line break inside a quoted rule as a space and drops a comma before a closing brace or bracket, then reads the JSON and lists each path's .read, .write, .validate and .indexOn. What it does not recognise, or cannot read with confidence, is counted, with the first 20 items listed by line or path as not read, unquoted. Beside each case it puts the statements whose path text is the case's path, wildcard names aside, and whose methods cover the operation: read stands for get and list, and write for create, update and delete. A statement whose path differs only where a wildcard meets a fixed name, or whose recursive wildcard could reach the path, is listed and labelled, as is any Realtime Database rule above the path. That comparison is text only. The tool does not run the rules. It cannot evaluate a condition, follow a function, look up another document or read a custom claim, so it cannot say whether a case would be allowed. It cannot see what is deployed: "Avoid insecure rules" says the Firebase console always shows the most recently deployed version of your rules. The paste is refused whole above 50,000 characters, when blocks nest more than 12 deep, or for Realtime Database when it is not JSON with a top-level rules object, nests deeper than 32 levels or holds more than 2,000 keys. A path, condition or rule longer than 300 characters is cut and ends in three dots, a row lists up to four statements, and the summary lists the first 100 match blocks or database paths. A private key block and the credential fields of a service account file are replaced before anything is read or shown.
Sources
- Google Firebase: How Security Rules work
- Google Firebase: Avoid insecure rules
- Google Firebase: Security Rules language
- Google Firebase: Get started with Firebase Security Rules
- Google Firebase: Structuring Cloud Firestore Security Rules
- Google Firebase: Securely query data
- Google Firebase: Control access to specific fields
- Google Firebase: Learn the core syntax of the Realtime Database Security Rules language
- Google Firebase: Use conditions in Realtime Database Security Rules
- Google Firebase: Firebase Realtime Database Security Rules API
- Google Firebase: Index your data
- Google Firebase: Understand Firebase Security Rules for Cloud Storage
- Google Firebase: Learn the core syntax of the Firebase Security Rules for Cloud Storage language
- Google Firebase: Build unit tests
- Google Firebase: Firebase security checklist
Worked example
An invented example: a booking app keeps each booking as a Cloud Firestore document at /bookings/{bookingId}, with the customer's user ID in a customer_uid field. No rules are pasted.
- Firebase product
- Cloud Firestore
- Path
- /bookings/{bookingId}
- get, list, create, update
- The signed-in owner
- delete
- Nobody
- Owner recorded in
- A field: customer_uid
- Fields to validate
- starts_at
18 cases: 15 from three callers for each of the five operations, and 3 added cases.
The owner rows for get, list, create and update expect allow, and every other row of the 15 expects deny. The added cases are a query with no filter on customer_uid (deny), an update that changes customer_uid to another user (decide) and a write that breaks a check on starts_at (deny). With no rules pasted, the matrix has no rule text column.
Who uses this tool
Founders who built on an AI app builder
List a document path for each collection your app created, such as /orders/{orderId}, answer who should reach each one, and hand the matrix to whoever maintains the rules before real users sign up.
Developers changing a rule
Rebuild the matrix for the paths the change touches, paste the new rules, and compare the rule text beside each case before you write the unit tests.
Reviewers of a pull request
Paste the rules from the branch to list the match blocks (the first 100), the flags for open access, sign-in-only conditions and recursive wildcards, and what the parser did not read (the first 20 items).
Teams preparing for a security test
Write down the access each kind of user should have, path by path, so the expected results exist before anyone starts testing.
Frequently asked questions
Does this Firebase security checklist connect to my project?
No. It runs in your browser, has no field for a project ID, an API key or a service account, and never connects to Firebase. Nothing you type or paste is sent to a server or saved on your device. When a matrix is built, the page sends one analytics event that names the tool and the page, and nothing from your input.
Can it tell me whether my Firebase rules are right?
No. It does not run rules or evaluate conditions, so it cannot say whether a request would be allowed or denied. The expected results are your own answers written out as cases, and for an added case that cites a Firebase page, your answers read with that page. Pasted rule text is shown beside them for you to compare. To see what the rules do, run the cases in the Firebase Local Emulator Suite or a staging project.
Why does the matrix ask about get and list separately?
Because Cloud Firestore and Cloud Storage rules can decide them separately. For Cloud Firestore, Firebase says a read rule can be broken into get, which applies to single document read requests, and list, which applies to queries and collection read requests. Cloud Storage rules split read the same way. A statement written with read covers both. If your answers for the two differ and a pasted statement that names the path uses read, the tool flags it for review.
Which Firebase security best practices does the checklist reflect?
Those in Firebase's own pages. Its security checklist says to initialise rules to deny all access by default and add rules that grant access to specific resources as you develop, to write a rule first when you need a new document type or path structure, and to unit test rules with the Local Emulator Suite. Its page on insecure rules covers open access and access for any authenticated user.
What happens if I paste a service account key by mistake?
A paste that declares "type": "service_account" is refused, and nothing from it is read or shown. Inside other text, a private key block and the values of the private_key, private_key_id, client_email, client_id, client_secret and refresh_token fields are replaced with a placeholder before anything is read. Firebase's security checklist says service account private keys are sensitive and must be kept secret. The tool recognises no other kind of secret.
Does it work for Realtime Database rules?
Yes. Choose Realtime Database and the tool asks about .read and .write for each path, and reads pasted rules as JSON after removing comments. It flags a rule set below a path that already has the same rule type, because Firebase says a rule at a child node can only grant additional privileges. When you list fields to validate and let someone write, it adds a delete case, because Firebase says .validate rules are ignored when data is deleted.