简体   繁体   English

如何下载服务帐号Json?

[英]How to download a Service Account Json?

I have a impersonated a Service Account in gcloud through the command gcloud config set auth/impersonate_service_account [SA_FULL_EMAIL] .我通过命令gcloud config set auth/impersonate_service_account [SA_FULL_EMAIL]gcloud中模拟了一个服务帐户。

Now, all my API calls are impersonating the Service Account., is there a way to download the Service Account JSON at this point?现在,我所有的 API 调用都在模拟服务帐户。此时是否有办法下载服务帐户 JSON?

Because I do not have the original Service Account JSON that was created earlier and also as an User I do not have permissions to Manage Keys for this Service Account.因为我没有之前创建的原始服务帐户 JSON,而且作为用户,我没有权限管理此服务帐户的密钥。

Please let me know, if I can download the Service Account JSON from gcloud by impersonating the Service Account.如果我可以通过模拟服务帐户从gcloud下载服务帐户 JSON,请告诉我。

Thanks in advance!提前致谢!

I do not have permissions to Manage Keys for this Service Account我无权管理此服务帐户的密钥

Without those permissions, you cannot create or download service account JSON keys.没有这些权限,您无法创建或下载服务帐户 JSON 密钥。 If the service account has those permissions, which it should not for security reasons, then yes.如果服务帐户具有这些权限(出于安全原因不应具有这些权限),则可以。

The following command will create a new JSON key and download it:以下命令将创建一个新的 JSON 密钥并下载它:

gcloud iam service-accounts keys create my-service-account.json --iam-account <EMAIL ADDRESS>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用.NET中的谷歌服务账号json文件 6 - How to use Google Service Account json file in .NET 6 如何在 Docker 中使用 GCP 服务帐号 json 文件 - How to use GCP service account json files in Docker 安全服务帐户凭据 json 密钥 kotlin - Secure Service Account Credentials json key kotlin 服务帐户模拟如何工作? - How Service Account impersonation works? 如何使用 JSON 服务帐户密钥在 GO 中获取 Kubernetes 客户端集? - How can I get a Kubernetes clientset in GO using a JSON service account key? 如何安全地访问包含服务帐户凭据的 json 文件? - How can I securely access json file containing service account credentials? 如何直接从 Go 中的 GCP 服务帐户 JSON 密钥文件创建 kube.netes.Clientset? - How can I create a kubernetes.Clientset directly from a GCP service account JSON key file in Go? 如何使用模拟服务帐户运行 python 代码 - how to run a python code with impersonated Service Account 如果省略服务帐户密钥 JSON 文件,GKE 上的 ESP 将失败 - ESP on GKE fails if the service account key JSON file is omitted 使用 GKE 中的工作负载身份访问服务帐户密钥 json - Access Service Account key json using workload identity in GKE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM