简体   繁体   English

如何安全地访问包含服务帐户凭据的 json 文件?

[英]How can I securely access json file containing service account credentials?

I am trying to create Django project that uses Google Cloud Storage bucket, and deploy it on Heroku or other cloud services.我正在尝试创建使用 Google Cloud Storage 存储桶的 Django 项目,并将其部署在 Heroku 或其他云服务上。

In order to use Cloud Storage, I need to authenticate myself using the service account.为了使用 Cloud Storage,我需要使用服务帐户对自己进行身份验证。 So I got json file containing service account credentials.所以我得到了包含服务帐户凭据的 json 文件。

In the application, I need to provide a path to that json file, which means that I must save json file within the application.在应用程序中,我需要提供 json 文件的路径,这意味着我必须在应用程序中保存 json 文件。

I can use environment variable to hide the path itself, but I still need the json file saved somewhere in the Django project and when deployed in the remote server.我可以使用环境变量来隐藏路径本身,但我仍然需要将 json 文件保存在 Django 项目中的某处以及部署在远程服务器中时。 I was not sure if this is safe...我不确定这是否安全...

How can I access Google Cloud Storage safely during production?如何在生产期间安全访问 Google Cloud Storage?

The reason why one uses environment variables is to make sure sensitive credentials are not shared by an accident via for example GitHub.使用环境变量的原因是为了确保敏感凭据不会被意外共享,例如 GitHub。 If someone has access to your server then everything is compromised no matter what.如果有人可以访问您的服务器,那么无论如何都会受到损害。

暂无
暂无

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

相关问题 如何使用 REST API 从服务帐户凭据创建访问令牌? - How do I create an Access Token from Service Account Credentials using REST API? 如何使用 JSON 服务帐户密钥在 GO 中获取 Kubernetes 客户端集? - How can I get a Kubernetes clientset in GO using a JSON service account key? 无法让 Google Cloud Platform 识别 JSON 服务帐户密钥文件。 错误:PyOpenSSL 不可用。 建议使用 JSON,但我使用的是 JSON 密钥 - Can't get Google Cloud Platform to recognize JSON service account key file. Error: PyOpenSSL is not available. Suggests JSON but I'm using a JSON key 如何删除由服务帐户创建的 Google 表格? - How can I delete a Google Sheets created by a service account? 我可以使用 GCP VM (xxx-compute@developer.gserviceaccount.com) 的服务帐户而不是 SA json 文件来使用 python 进行 api 调用吗? - Can I use the service account of a GCP VM (xxx-compute@developer.gserviceaccount.com) instead of SA json file to make api calls using python? 如何使用 Terraform 在不同项目中为 Google Cloud 中的其他项目服务帐户添加 IAM 角色 - How can I add IAM role for other project service account in Google Cloud in different project using Terraform 如何允许用户成为 Google Cloud Platform (GCP) 中服务帐户的参与者? - How can I allow a user to become an actor of a service account in Google Cloud Platform (GCP)? 如何获取 GCP 服务帐户 SignedJWT,以便我可以调用接受 GCP 身份验证的第 3 方服务 - How to Get GCP Service Account SignedJWT so I can call a 3rd party service that accepts GCP auth 如何向本地 apache 光束提供谷歌凭证 json 文件? - How to provide google credentials json file to local apache beam? 如何在 Docker 中使用 GCP 服务帐号 json 文件 - How to use GCP service account json files in Docker
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM