简体   繁体   English

从 Bitbucket 管道访问存储在 Google Secret Manager 中的环境变量

[英]Access environment variables stored in Google Secret Manager from Bitbucket pipelines

I am using bitbucket pipeline to run test cases.我正在使用 bitbucket 管道来运行测试用例。 In order for test cases to succeed, I need secrets which is stored in google secret manager.为了使测试用例成功,我需要存储在谷歌秘密管理器中的秘密。 Is there any way I can access those secrets within bitbucket pipeline environment?有什么办法可以在 bitbucket 管道环境中访问这些秘密吗?

There are a couple of options.有几个选项。

In case if these secrets are static, the easiest solution would be adding them to your Repository or Deployment variables .如果这些秘密是 static,最简单的解决方案是将它们添加到您的存储库或部署变量中。 Make sure that they're marked as Secured, so that they will be masked, ie hidden, in the logs.确保它们被标记为安全,这样它们将被屏蔽,即隐藏在日志中。

Alternatively, if your secrets are rotated and must be fetched from the secrets manager on every build in order to stay up-to-date, you'll need to use corresponding CLI commands in the build script.或者,如果您的机密被轮换并且必须在每次构建时从机密管理器中获取以保持最新状态,您将需要在构建脚本中使用相应的CLI 命令 In order for this to work you will have to give Bitbucket Pipelines access to the secrets in your cloud.为了让它工作,你必须给 Bitbucket 管道访问你云中的秘密。 For details, check out, for example, this page .有关详细信息,请查看此页面等。

暂无
暂无

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

相关问题 无法从 Google Cloud 访问存储在 Secrets Manager 中的机密 Function - Can't access secret stored in Secrets Manager from Google Cloud Function 无法从环境变量(AWS_ACCESS_KEY_ID(或 AWS_ACCESS_KEY)和 AWS_SECRET_KEY(或 AWS_SECRET_ACCESS_KEY))加载 AWS 凭证 - Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)) 无法从独立的 go 应用程序访问 gcp 秘密管理器 - Not able to access gcp secret manager from standalone go application 将 google secret manager secret 挂载到 KubernetesPodOperator - Mount google secret manager secret to KubernetesPodOperator 如何使用无服务器从 Google Secrets Manager 获取秘密? - How to get secret from Google Secrets Manager using Serverless? 在 docker 环境中设置 AWS Secret Manager 值 - Set AWS Secret Manager value in docker environment GKE Secrets 或 Google 机密管理器 - GKE Secrets OR Google Secret manager 如何使用 Google Cloud Deployment Manager 设置自定义环境变量? - How to set custom environment variables using Google Cloud Deployment Manager? 使用 Secret Manager 中存储的秘密初始化 Firebase Admin SDK - Initialize Firebase Admin SDK using secret stored in Secret Manager Kube.netesPodOperator 无法访问存储在 Google Secrets Manager 中的 Airflow 连接 - KubernetesPodOperator is not able to access the Airflow Connections stored in Google Secrets Manager
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM