Search⌘ K

Security Rules

Explore the implementation of security rules in Cloud Firestore to protect your web application's data. Understand how to allow read access to posts while restricting write access to authenticated users only. Learn best practices for configuring Firestore rules to prevent data leaks and ensure safe database operations within your cloud-native web app.

Security rules for your web application

As mentioned in the “Write data” lesson earlier, we never authenticated in order to persist data. When we initialized the Firebase CLI a while ago, a default security rules file was created that grants read/write permissions to anyone. It’s time to fix this.

The file is located at services/web/firebase/firestore.rules.

 ...