Firebase 实时数据库安全规则(读取和写入)
好的,我有一个连接到应用程序的实时数据库,直到今天,规则(读写)都设置为True,一切正常。...但是每次弹出消息时,
您的安全规则定义为公共,因此任何人都可以在数据库中窃取,修改或删除数据
我尝试了几件事,但没有访问数据...只有在将规则设置为true
时才可以访问数据修改规则以使其更安全的任何方法
我希望仅通过少数已知的应用程序(我的应用程序)访问这些数据
Ok I have a Realtime database connected to a app and till today the rules ( read and write ) were set to true , everything was working fine ....but every time a message pops up saying
Your security rules are defined as public, so anyone can steal, modify, or delete data in your database
I tried few things but data was not accessed...data was only accessible when the rules were set to true
but is there any way to modify the rules to make it more secure
I want this Data to be accessed by only few known apps ( My Apps )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从文档中的此处开始,然后逐步完成。它非常实用且易于理解。
Firebase RTDB 具有公共 URL,因此任何人都可以尝试连接到它。您的工作是决定他们是否可以这样做。如果您的任何路径/节点的规则如下所示,则任何发出请求的人都可以使用它:
如果您只想允许应用程序的用户连接到 RTDB,则可以使用 Firebase Auth 并使用如下条件:
访问权限是在用户级别而不是应用程序上确定的。从文档中的此处开始。
在 Firebase 控制台中或通过 CLI 部署它们。如果您对此不熟悉,请从 Firebase 控制台开始,然后使用规则园地来测试不同的规则。 有关详细信息,请参阅文档。
您的数据库不是“集成的”。它是一个可通过公共 URL 访问的已部署实例 - 这就是您的客户端连接到 RTDB 的方式。如果您的规则允许任何读取或写入操作,那么您的数据库就是广泛的并且对每个人开放。因此,您收到的电子邮件通知您这不安全。
Start here in the docs and work your way through. It's very practical and easy to understand.
Firebase RTDB has a public URL, so anyone can try connecting to it. It is your job to decide whether they can do this or not. If your rules for any path/node look like this, it is available to anyone who makes a request:
If you only want to allow users of your app to connect to RTDB, you can use Firebase Auth and use conditions like this:
Access is determined on a user level, not by app. Start here in the docs.
Either in the Firebase Console, or deploy them via the CLI. If you're new to this, start with the Firebase Console and use the Rules Playground to test different rules. See docs for more information.
Your database is not "integrated". It is a deployed instance that is reachable via a public URL - that's how your clients connect to RTDB. If your rules allow any read or write operation, then your database is wide and open for everyone. Hence, the email that you have received informing you that this is not secure.
当前接受的规则
Currently accepted Rule docs