Recently I've received bunch of Firebase notifications regarding:
[Firebase] Your Cloud Firestore database has insecure rules
We've detected the following issue(s) with your security rules:any user can write to your entire database. Because your project does not have strong security rules, anyone can access your entire database. Attackers can steal, modify, or delete your data, and they can drive up your bill.`
Edit2: What I need, is to allow write for everyone without any need to sign in, but only the admin account should be able to read it from Firebase console.
Realtime Database rules:
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
Cloud Firestore rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow write;
}
}
}
Edit: One of the Databases structure in JSON, others looks similar:
{
"battles" : {
"-KjiAFLI8oE_12345678" : {
"full" : true,
"player1" : {
"movement" : {
"down" : false,
"left" : false,
"right" : false,
"up" : false
},
"position" : {
"x" : 0,
"y" : 0
}
},
"player2" : {
"movement" : {
"down" : false,
"left" : false,
"right" : false,
"up" : false
},
"position" : {
"x" : 0,
"y" : 0
}
}
},
"-KjiAMVvJydR12345678" : {
"full" : true,
"player1" : {
"movement" : {
"down" : false,
"left" : false,
"right" : false,
"up" : false
},
"position" : {
"x" : 0,
"y" : 0
}
},
"player2" : {
"movement" : {
"down" : false,
"left" : false,
"right" : false,
"up" : false
},
"position" : {
"x" : 0,
"y" : 0
}
}
}
}
}
Edit3: In contrast to the Firebaser's answer to Firebase email saying my realtime database has insecure rules I don't want to/use Firebase Authentication/SSO.
Given these scenario do I have to/shall I modify them somehow?
Realtime Database
. In both cases the logic is the same. – Daniel Danielecki