【问题标题】:Grant your originating account the Service Account Token Creator role on the target service account授予您的原始帐户目标服务帐户上的服务帐户令牌创建者角色
【发布时间】:2022-05-01 04:59:08
【问题描述】:

我使用以下命令在 MAC OS 终端中进行身份验证

gcloud auth login

它重定向到谷歌登录页面并显示认证过程成功。

使用命令时

gsutil -i fetebird-storage@fetebird.iam.gserviceaccount.com ls

获取异常

AccessDeniedException: Service account impersonation failed. Please go to the Google Cloud Platform Console (https://cloud.google.com/console), select IAM & admin, then Service Accounts, and grant your originating account the Service Account Token Creator role on the target service account.

但是,在云上,我确实给予了如下所示的权限

授权列表

【问题讨论】:

  • 链接到另一个问题。你可以执行gcloud config list 并粘贴结果吗?
  • 我这边也是这样。我建议提出一个错误。根据谷歌文档,它应该通过“发送反馈”按钮(cloud.google.com/storage/docs/…)来完成,我认为这是页面cloud.google.com/storage/docs/gsutil/addlhelp/…,其中描述了-i 选项
  • 我写了几篇关于服务帐户模拟的文章:jhanley.com/google-cloud-improving-security-with-impersonation 您没有在正确的资源上设置所需的角色。我的文章显示了所需的步骤。
  • @JohnHanley 如果我从云 shell 运行命令,一切正常,但是,从 MAC OS 终端我无法运行
  • gcloud auth list 为每个环境显示什么?他们是否使用相同的“活动帐户”?

标签: google-cloud-platform google-cloud-storage gcloud service-accounts google-iam


【解决方案1】:

当前登录用户 (fetebird@gmail.com) 必须具有服务帐户访问令牌创建者角色。

您可能认为所有者角色就足够了,但是,当我自己对此进行测试时,您需要将其显式添加到模拟服务帐户的帐户中。

https://cloud.google.com/iam/docs/service-accounts#token-creator-role

【讨论】:

    猜你喜欢
    • 2021-12-19
    • 2021-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-15
    • 2021-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多