Skip to content

Secure manual Firestore setup rules - #34

Draft
qayshp wants to merge 2 commits into
BlueBubblesApp:masterfrom
qayshp:agent/secure-firestore-manual-rules
Draft

Secure manual Firestore setup rules#34
qayshp wants to merge 2 commits into
BlueBubblesApp:masterfrom
qayshp:agent/secure-firestore-manual-rules

Conversation

@qayshp

@qayshp qayshp commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the manual setup's globally open Firestore rule with the scoped rules installed by the server's automatic Firebase setup
  • allow unauthenticated reads only for server/config and unauthenticated writes only for server/commands
  • explain default denial for unmatched paths, the service-account Admin SDK bypass, and the remaining public access boundary
  • link the server implementation that is the source of truth for the policy and require maintainers to compare the two when either changes

Why

The written manual setup currently instructs users to change Firebase's default rule to allow read, write: if true;. That exposes every Firestore document to unauthenticated reads and writes. The server's automatic setup already uses a narrower rule set, but the manual guide never adopted it.

User impact

New manual-setup users will grant only the two client operations BlueBubbles needs instead of opening the entire database. Existing users can also replace their permissive rule with the documented rule. This limits exposure but does not authenticate the two public client operations.

Coordination

PR #31 edits the database-creation steps on the same page for a separate issue. Merge simulations pass with #31 and #34 applied in either order, and the combined result preserves both changes.

Validation

  • git diff --check origin/master...HEAD passes
  • the documented rules are byte-for-byte identical to FCMService.setFirestoreRulesForApp on current server master and development
  • a local Firestore Emulator access matrix passed for the documented policy: public config read and commands write were allowed; the inverse operations and unmatched-path reads/writes were denied
  • the old globally open rule no longer appears in this branch

The emulator test did not read or modify a production Firebase project. No production deployment was performed or required.

Fixes BlueBubblesApp/bluebubbles-server#783

@qayshp qayshp left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review focused on keeping the manual rule safe as the server evolves.

Comment thread server/installation-guides/manual-setup.md
@qayshp

qayshp commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Validation update

  • git diff --check origin/master...HEAD passes.
  • The documented rules remain byte-for-byte identical to the rules currently installed by FCMService.
  • The rules passed a local Firestore Emulator access matrix:
    • unauthenticated server/config read: allowed (404 because the test document did not exist)
    • unauthenticated server/config write: denied (403)
    • unauthenticated server/commands write: allowed (200)
    • unauthenticated server/commands read: denied (403)
    • unmatched-path read and write: denied (403)

The test used only the local emulator and did not read or modify a production Firebase project.

This page overlaps PR #31. Any rebase or conflict resolution must preserve both #31's live-validated database-creation labels and this PR's scoped rules.

@qayshp qayshp changed the title Secure manual Firebase setup rules Secure manual Firestore setup rules Jul 28, 2026
@qayshp

qayshp commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Merge-readiness update: 8e7bbad adds a direct policy source-of-truth link and maintenance instruction. The documented rule is byte-for-byte identical to current server master and development; the recorded emulator access matrix remains applicable because the rule bytes are unchanged. Structural checks pass, and merge simulations with PR #31 pass in both orders. No production Firebase state was touched.

@qayshp
qayshp marked this pull request as ready for review July 28, 2026 07:02
@qayshp
qayshp marked this pull request as draft July 28, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bluebubbles Server Manual Firebase Setup Rule Is Insecure

1 participant