Skip to content

Firebase

Scope: web apps, mobile apps and games whose clients read and write Firebase directly: Cloud Firestore, Realtime Database, Cloud Storage for Firebase, Firebase Authentication, App Check and Cloud Functions for Firebase (2nd gen), with the current SDKs and tools (Firebase JavaScript SDK 13, firebase-functions 7 and the Firebase CLI 15). Because clients reach the data without a server of your own in between, Firebase Security Rules carry the server-side authorisation that SEC-1 asks for, and everything in the client is public (SEC-11 in Security). Sign-in in general is covered in Authentication and sessions, consent and personal data in Privacy and personal data, browser apps in Web front end, and store purchases, integrity checks and live operations with Remote Config in Mobile games. A Firebase project is a Google Cloud project, so Google Cloud also applies to its IAM, secrets and billing. For a PostgreSQL-based backend of the same kind, see Supabase.

Entries are sorted by score from 1 to 10 (criteria): 9โ€“10 start here or strongly recommended, 6โ€“8 recommended, 1โ€“5 further reading or conditional.

Adopted references

Key rules

Security Rules

App Check, API keys and Authentication

Projects and environments

Firestore data and cost

Cloud Functions

Costs

Privacy

How to enforce

Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.

  • 7 Security Rules unit tests: @firebase/rules-unit-testing runs your tests against the emulators, and firebase emulators:exec starts the emulators for them in CI and stops them afterwards. Checks FIREBASE-3, and partly FIREBASE-1, FIREBASE-4, FIREBASE-5 and FIREBASE-6, as far as the tests cover them.
  • 6 GitHub secret scanning push protection: blocks pushes that contain Google Cloud service account credentials. Partly checks FIREBASE-8.
  • 5 @firebase/eslint-plugin-security-rules: Firebase's ESLint plugin for .rules files, first released in 2026. Its no-open-reads and no-open-writes rules flag reads and writes allowed with if true. Partly checks FIREBASE-1.

Tutorials and further reading