I don't understand how Firebase security work
Hello there, I'm working on a React Native project using Firebase backend. I've finished it, and before uploading it to the app store, I wanted to review the security aspects, but there are a few things I don't understand.
1-If I store the Firebase keys in a .env file, won't they be visible to someone who downloads the application?
2-I'm using Cloud Functions to access the database. How can I prevent the HTTP request link from being visible and ensure that anyone can't make requests with the address?
3-Is it necessary to implement the authentication system from the client side? Or can I do it solely from cloud functions? I ask this because that way I wouldn't need to expose my Firebase keys in my client.
4- I hardly understand anything about cybersecurity and what attackers can or cannot do to my application if I publish it. If someone could send me a helpful video or post, I would appreciate it.
thanks.
If I store the Firebase keys in a .env file, won't they be visible to someone who downloads the application?
Yes, but the firebase keys are meant to be public. Security comes through a few different things:
How can I prevent the HTTP request link from being visible
It's going to be visible in the sense that someone can probably figure out what url you're hitting and can attempt to send their own POST to that url, but you can use #2 and/or #3 to deny access.
Is it necessary to implement the authentication system from the client side?
Not always. If everyone is going to have access to exactly the same things then you don't need it. But if you want some people to have access which other people do not, you'll need them to sign in.