*IF* you app uses firebase authentication, then *all* your security rules need to do is check if their authentication exists at all - only allow authenticated users access, even if it is *all* access. I would *not* recommend all-access, since it can allow application bugs to damage your database, but then I try to thing of all the things that can go *wrong*, rather than what happens if everything works *right*.
If your back-end is itself in an authenticated environment, such as Firebase Cloud Functions, then they generally don't need further authentication - they are *already* protected.
There are a number of authentication options for the *client*/*application* side - which is where your security & stability concerns should be.
I don't know the format of security rules in RTDB, but in Firebase Firestore the *minimum* should be:
```
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth.uid;
}
}
}
```
This would allow read, write if the user is authenticated. Any other client-side access would be refused.
These rules do *not* apply to backend code running in an authenticated environment.
Most functional security rule sets are quite a bit longer than this; mine is 400 lines long.
Tracy Hall