Using Firestore and Firebase storage for image upload Functionality on Angular 11 website results to insecure rules notification from Firebase

Viewed 121

On some websites, I include a contact page where users can upload a specific image along with completing a contact form that will be sent to website merchant. I use cloud firestore along with firebase storage to retrieve that image through the dynamic transactional email template that is sent to the owner of the website. Clients should not be required to log-in in order to use this service. In other words, anyone whom visits the website should be able to complete the form and voluntarily upload an image related to the content of the contact form (In this case, a career application which may be accompanied by an applicant's resume). However, my Firebase security rules must allow all reads and writes for this to service to function (allow read, write: if true;).

This recently resulted in firebase sending me an email notification concerning my security rules being insecure.

My question is: Is there a way to allow all users (Unauthenicated or not) to use this service without firebase recognizing the rules as insecure?

1 Answers

Regarding your question, I do not think there is a way to allow all users (unauth or not) to use your service without firebase alerts you about the insecure rules you are using.

Firebase Security Rules protect your data from malicious users. Apparently you are using the rules that normally are used during development that allow open access but once you deploy it to prod those rules should be reviewed and updated before you deploy your app.

As it is mentioned on the firebase docs, your app and service is available to everyone on the internet and If you're not authenticating users and configuring security rules, then anyone who guesses your project id can steal, edit/modify, or even delete your data. You can take a look to the docs here Firestore Open Access

Related