Security Rules

Learn about security rules in Firebase.

We'll cover the following

Security rules

Firebase Security Rules allow us to write rules for our database CRUD operations, the Cloud Firestore, the Firebase Realtime Database, or even Cloud Storage. In production, properly writing security rules is very important because it will prevent attacks from hackers on our app. Also, it allows users to read or update data relevant to themselves and not others.

In this lesson, we’ll cover the rules for our database, which is Cloud Firestore.

When we open the “Rules” tab in the Cloud Firestore, we get a screen like the one below, which allows us to read and write on any collection till the date mentioned in that rule. This is possible because we’ve chosen a test mode for security rules while initializing Firestore.

Get hands-on with 1200+ tech skills courses.