【问题标题】:How to give the correct permissions to a GCP service account to update Firestore and Storage rules?如何为 GCP 服务帐户提供正确的权限以更新 Firestore 和 Storage 规则?
【发布时间】:2021-10-18 23:46:08
【问题描述】:

我有一个自动更新 Firebase 项目的 Firestore 和存储规则的流程。它总是通过权限被拒绝错误。我尝试了预定义 IAM 角色的组合,例如 Firebase Rules AdminFirebase Rules SystemFirebase Rules Viewer。甚至三者的组合都失败了。

当为服务帐户提供Firebase Admin IAM 角色时,它起作用了;但是,由于遵循最小权限原则的最佳安全实践,我想避免为此服务帐户授予过多权限。

我找到了需要特定权限的文档:https://firebase.google.com/docs/projects/iam/permissions#security-rules,但在创建具有所有 13 个权限的新 IAM 角色后,它仍然被拒绝。

仅允许服务帐户更新规则和仅规则所需的正确最小权限集是什么? (Firestore 和存储)

【问题讨论】:

    标签: firebase google-cloud-platform google-cloud-firestore firebase-security service-accounts


    【解决方案1】:

    我不知道答案,但这是我的解决方法。

    Firebase 管理员在 Firebase 级角色下定义:

    https://firebase.google.com/docs/projects/iam/roles-predefined-all-products

    注意抱歉,无法在移动设备上获取指向特定角色的链接

    这显示了所有的权限。

    您应该能够通过检查您尝试过的其他角色的权限来确定缺少哪些权限。

    如果您包含命令和您收到的具体错误,将会很有帮助。通常 (!) 这些有助于确定缺少的权限范围。

    【讨论】:

      猜你喜欢
      • 2022-11-23
      • 2019-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多