You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GCP中执行gcloud scc findings list命令遇权限拒绝错误

问题解决:gcloud scc findings list 权限拒绝错误

问题描述

拥有Security Command Centre(SCC)管理员权限及目标项目的只读权限,执行以下命令时返回权限拒绝错误:

gcloud scc findings list projects/<project name>

错误信息:

ERROR: (gcloud.scc.findings.list) PERMISSION_DENIED: Caller does not have required permission to use project <>.

Grant the caller the roles/serviceusage.serviceUsageConsumer role, or a custom role with the serviceusage.services.use permission,
by visiting IAM管理页面后重试。权限生效可能需要几分钟。

  • '@type': type.googleapis.com/google.rpc.
    Help links:
  • description: Google开发者控制台IAM管理页面
  • '@type': type.googleapis.com/google.rpc.ErrorInfo domain: googleapis.com metadata: consumer: projects/ service: securitycenter.googleapis.com reason: USER_PROJECT_DENIED

原因分析

尽管拥有SCC管理员权限,但调用SCC API时,还需要目标项目的服务使用消费者权限来确认你有权限使用该项目下的Security Center服务。只读权限不包含该权限,因此触发USER_PROJECT_DENIED错误。

解决步骤

  • 登录目标项目的IAM管理界面
  • 找到你的账号,点击编辑权限选项
  • 为账号添加roles/serviceusage.serviceUsageConsumer角色,或者创建包含serviceusage.services.use权限的自定义角色并关联到你的账号
  • 等待几分钟让权限生效,之后重新执行原命令

内容的提问来源于stack exchange,提问作者kumar sourav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 12:33:24