Firebase Audit
Produce an evidence-based, severity-ranked report answering three questions:
- Who can access what?
- What rules, data, and auth configuration exist?
- Where do rules, data shape, and identities disagree?
Stay read-only. Propose remediation in the report; apply changes only when the
user asks.
Steps
Collect rules. Read firestore.rules and database.rules.json from the
project, or pull deployed state through the Firebase Console or
firebase-tools. Complete when every service in scope has a ruleset in
hand (or a finding that none exists, which is itself critical).
Collect data shape. Map real paths by listing collections with
firestore_list_documents, drilling into what you find; for RTDB use
rtdb_crawl_structure. Complete when each top-level collection/path has a
known shape and sample.
Collect auth posture. Read provider configuration from the Firebase
Console or firebase-tools (pyric mirrors sandbox auth state, not project
provider configuration). Note which identities the rules assume (anonymous,
signed-in, owner, custom claims) and whether the enabled providers can
actually produce them. Complete when every request.auth assumption in the
rules maps to a real provider or a finding.
Cross-reference. For each data path, pair it with the rule that governs
it and the identity that reaches it. Flag:
- data paths with no meaningful rule (default-open or root grants)
- rules matching paths where no data exists (dead rules)
- user-writable paths without validation
- claimed auth boundaries with no identity able to exercise them
Complete when every path appears in exactly one of: protected, flagged, or
dead-rule.
Verify the sharp findings. Prove each critical/high finding with
firestore_lint_rules, firestore_simulate_rules (vary the auth context:
signed-out, owner, other user, claim-holder), the hosted Rules Test API
(pyric verify --engine rules-test-api|both), or rtdb_simulate_access.
Complete when every critical/high finding cites a simulation, test, or
lint result, not just a reading of the rules.
Report by severity.
## Firebase Audit
### Summary
### Critical Findings (public/root writes, auth bypasses)
### High Findings (missing validation, broad reads on sensitive paths)
### Medium Findings (dead rules, shape drift)
### Low Findings (style, structure)
### Positive Observations
### Recommended Next Steps
Complete when each finding names its evidence and its fix.
Severity anchors
- Critical: unauthenticated write, root-level grant, or rule logic an attacker
controls (authorization read from
request.resource.data).
- High: user-controlled writes without validation; sensitive reads open to any
signed-in user.
- Medium: rules and data shape disagree but no direct exposure.
- Low: naming, duplication, unused functions.
Scope honesty
State in the summary exactly which evidence backs the audit (rules files,
discovered paths, simulations run). Traffic and denial history are visible in
the Pyric Playground today but not yet exposed to external agents through the
pyric tool surface — when live-traffic evidence would change a finding, say so
rather than inferring it.
1---2name: firebase-audit3description: Audit a Firebase project's security and data posture — who can access what, what rules/data/auth exist, and where they disagree. Use when the user asks for a Firebase audit, a security review of rules and data, or "find the gaps" across Firestore/RTDB/Auth.4---56# Firebase Audit78Produce an evidence-based, severity-ranked report answering three questions:9101. Who can access what?112. What rules, data, and auth configuration exist?123. Where do rules, data shape, and identities disagree?1314Stay read-only. Propose remediation in the report; apply changes only when the15user asks.1617## Steps18191. **Collect rules.** Read `firestore.rules` and `database.rules.json` from the20 project, or pull deployed state through the Firebase Console or21 `firebase-tools`. Complete when every service in scope has a ruleset in22 hand (or a finding that none exists, which is itself critical).23242. **Collect data shape.** Map real paths by listing collections with25 `firestore_list_documents`, drilling into what you find; for RTDB use26 `rtdb_crawl_structure`. Complete when each top-level collection/path has a27 known shape and sample.28293. **Collect auth posture.** Read provider configuration from the Firebase30 Console or `firebase-tools` (pyric mirrors sandbox auth state, not project31 provider configuration). Note which identities the rules assume (anonymous,32 signed-in, owner, custom claims) and whether the enabled providers can33 actually produce them. Complete when every `request.auth` assumption in the34 rules maps to a real provider or a finding.35364. **Cross-reference.** For each data path, pair it with the rule that governs37 it and the identity that reaches it. Flag:38 - data paths with no meaningful rule (default-open or root grants)39 - rules matching paths where no data exists (dead rules)40 - user-writable paths without validation41 - claimed auth boundaries with no identity able to exercise them4243 Complete when every path appears in exactly one of: protected, flagged, or44 dead-rule.45465. **Verify the sharp findings.** Prove each critical/high finding with47 `firestore_lint_rules`, `firestore_simulate_rules` (vary the auth context:48 signed-out, owner, other user, claim-holder), the hosted Rules Test API49 (`pyric verify --engine rules-test-api|both`), or `rtdb_simulate_access`.50 Complete when every critical/high finding cites a simulation, test, or51 lint result, not just a reading of the rules.52536. **Report by severity.**5455 ```56 ## Firebase Audit57 ### Summary58 ### Critical Findings (public/root writes, auth bypasses)59 ### High Findings (missing validation, broad reads on sensitive paths)60 ### Medium Findings (dead rules, shape drift)61 ### Low Findings (style, structure)62 ### Positive Observations63 ### Recommended Next Steps64 ```6566 Complete when each finding names its evidence and its fix.6768## Severity anchors6970- Critical: unauthenticated write, root-level grant, or rule logic an attacker71 controls (authorization read from `request.resource.data`).72- High: user-controlled writes without validation; sensitive reads open to any73 signed-in user.74- Medium: rules and data shape disagree but no direct exposure.75- Low: naming, duplication, unused functions.7677## Scope honesty7879State in the summary exactly which evidence backs the audit (rules files,80discovered paths, simulations run). Traffic and denial history are visible in81the Pyric Playground today but not yet exposed to external agents through the82pyric tool surface — when live-traffic evidence would change a finding, say so83rather than inferring it.