Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase rules and how to test them

I'm working hard on putting up a Firebase backend. In the beginning it is very much straight forward but as the rules grow, it is harder to spot a security flaw. What are the options to actually test the rules? I've looked into Targaryen, which is a 3rd-party library, but can't get it up and running on OSX. Is there a more common approach to test the rules? What is the most common approach to do Firebase security tests?

like image 704
musse1 Avatar asked Oct 14 '15 10:10

musse1


1 Answers

If you haven't seen it yet, in the Firebase control panel for your app, there's a number of options down the left side; Data, Security and Rules, Simulator; Simulator is the one you want.

Once there, you can authenticate as a user and then test read and write ability on different child nodes.

We crafted our own small app to read/write to different nodes: as our app grew, so did the complexity of the rules and it just made it easier to bang through testing 20 nodes via the app then one at a time in the simulator. Our testing app is all of about 100 lines of code.

like image 63
Jay Avatar answered Nov 15 '22 09:11

Jay