Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Firebase really Secure?

I'm looking into using Firebase for a project that's otherwise a static site with js. Is it possible to secure the connection to the database in a static site? Wouldn't all security rules, the end point url, etc all be exposed in the js code letting the user make any requests they want (good or bad).

like image 717
Kombo Avatar asked Jun 01 '14 15:06

Kombo


People also ask

Can Firebase database be hacked?

Short Answer : Yes, But it will be hard than a website.

What are the disadvantages of Firebase?

The cons of Firebase One of the main problems with it, is limited querying capabilities. Realtime database provides no way to filter capabilities, because the whole DB is a huge JSON file, which makes it pretty difficult to make complex queries.


1 Answers

The short answer is yes: by authenticating your users and writing security rules, you can fully restrict read / write access to your Firebase data.

In a nutshell, Firebase security is enforced by server-side rules, that you author, and govern read or write access to given paths in your Firebase data tree.

Firebase security rules are JavaScript-like expressions: easy-to-write expressions that have access to the credentials for the connection, and the view of the Firebase data tree as it exists, along with pending changes on write.

In most cases, your client-side logic, templates, assets, etc. will be static and public. What you're really looking to secure is user and application data, and this is where Firebase Authentication (whether using custom Firebase authentication tokens or Firebase Simple Login) comes in. Firebase Authentication is essentially token generation - taking confirmed, identifiable user data and passing it securely to Firebase so that it cannot be spoofed. This confirmed credential data is then made available in your security rules.

Check out https://stackoverflow.com/a/20842986/879295 for an example, and the Firebase Security Quickstart Video for a great overview / starting point.

like image 62
Rob DiMarco Avatar answered Nov 14 '22 23:11

Rob DiMarco