# Firebase rules not clear

**URL:** https://community.thunkable.com/t/firebase-rules-not-clear/2364310
**Category:** Questions about Thunkable X
**Created:** [April 9, 2023, 9:51am UTC](https://community.thunkable.com/t/firebase-rules-not-clear/2364310 "2023-04-09T09:51:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)
#### Post date: [April 9, 2023, 9:51am UTC](https://community.thunkable.com/t/firebase-rules-not-clear/2364310/1 "2023-04-09T09:51:04Z")

</div>

I have an app where i allow read and write the firebse db. Hoever it is insecure i am told.  
I have no users that login. Only the app is accessing the db and updates db acc to any users activity. How can iset the fb rules to be more secure ?  
I find fb information is poor in explain how i can set it up. Any ideas…???

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [April 9, 2023, 4:26pm UTC](https://community.thunkable.com/t/firebase-rules-not-clear/2364310/2 "2023-04-09T16:26:56Z")

</div>

What are your current rules and what is the message you’re getting about insecure rules?

Have you tried using #3 here? [10 Firebase Realtime Database Rule Templates | by Julio Marín | Medium](https://medium.com/@juliomacr/10-firebase-realtime-database-rule-templates-d4894a118a98)

Are you storing unique data for each user? Is there a reason you’re not having users login?

---

<div class="post-metadata">

### Author: ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)
#### Post date: [April 11, 2023, 6:12am UTC](https://community.thunkable.com/t/firebase-rules-not-clear/2364310/3 "2023-04-11T06:12:58Z")

</div>

The current rules are set:  
{  
“rules”: {  
“.read”: true,  
“.write”: true  
}  
}

With this the DB is updates as long as someone is using the app (this is for pure statistics.  
In other words i am not interested what each individual is doing. Only how much it is played each day.  
because of thjis i need to have “write” set to “true”

Now, this is then unsecure - So how can i set that to “write” is OK by the app when used.

In other word - i am not storing data at all - on a user level. And at this stage i do not want to have a user login…

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [April 24, 2023, 11:29am UTC](https://community.thunkable.com/t/firebase-rules-not-clear/2364310/4 "2023-04-24T11:29:17Z")

</div>

This means that your DB is open to public.

I would suggest to have a user with an email and password and once your app starts login to the database using this email and password. Change the rules to allow read and write only to authenticated users.

This should make your DB secured or at least in a better security position.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [July 23, 2023, 11:29am UTC](https://community.thunkable.com/t/firebase-rules-not-clear/2364310/5 "2023-07-23T11:29:47Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
