有没有办法找出 GCP 服务帐户可以访问哪些项目?

Is there a way to find out to which projects a GCP service account has access to?

看来我不能只在body中写出与标题相同的问题。因为不符合质量标准。

运行: gcloud projects list --impersonate-service-account=<your-service-account-email-address>

这需要启用云资源管理器 API (cloudresourcemanager.googleapis.com) 和服务帐户的 resourcemanager.projects.list 权限。

该标志非常不言自明:它以给定的服务帐户而不是您配置的凭据运行命令。