Security and rules

Last updated

Client access to Firestore is controlled by Security Rules — a declarative rule language, written and deployed separately from your application code, that Firestore evaluates against every read or write request from a client SDK.

  • Rules can check the requesting user's authentication state, compare fields in the incoming write against existing document data, and reference other documents, all without a custom backend in the middle
  • Server-side access through the Admin SDK bypasses Security Rules entirely and is instead governed by Google Cloud IAM roles on the underlying service account
  • Data is encrypted at rest and in transit by default; there's no separate configuration step required to enable that baseline encryption

Because Security Rules are the only access control for client SDK traffic, they need to be tested as carefully as backend authorization code — a permissive rule is directly exploitable from any client.

Use cases

Security governance examples

  1. Define read/write rules per collection
  2. Enforce owner access to documents
  3. Log changes for compliance
  4. Integrate with IAM policies
  5. Audit rule evaluations

Need help with Google Cloud Firestore?

Tell us what you're working with. We'll follow up to schedule a free consultation and map out the fastest path to real adoption.

Book a free consultation

Tell us about your team and the software you need help with. We'll follow up to schedule a time to talk.

Open the form on its own page

Get help