public 回购的 CircleCI 2.0 私有环境密钥

CircleCI 2.0 private environment keys for public repos

我有一个 目前 私有的存储库。我的 Firebase 部署令牌作为 Env Var 存储在 CircleCI GUI 中。 CircleCI 2.0 文档明确指出

Do not add keys or secrets to a public CircleCI project

此外,根据我在 FAQ 中可以找到的内容,如果关联的 GitHub 回购 public.

,则将创建一个 CircleCI 项目 public

现在,我打算在GitHub上开源项目,CircleCI项目将成为public后,是否会使任何人都可以看到CircleCI中的Env Var?

如果 Env Var public仅可见,建议如何让我的部署令牌对其他人隐藏?我是否必须求助于 GCP KMS 之类的解决方案?

听起来您正在使用 CircleCI 作为您的存储库,但您的项目的开源版本不需要像 Firebase 这样的部署工具。如果那是对的,那么您应该将 Firebase 部署令牌保存在方便和安全的地方。

这听起来也像是您现在只是将部署令牌直接保存在您的存储库中,因为它是私有的。如果您的回购协议中只有少数秘密,那么 git-crypt might meet your needs. Once you hit a larger volume, you're probably going to want something centralized, and using Cloud KMS to encrypt secrets 是一种选择。

一位 CircleCI 员工澄清了 this for me on their forums

That warning is meant for the config[.yml]. You can use UI-based CircleCI environment variables safely.

If the repo/project is public, you'll just want to make sure that:

  • envars in forked builds are turned off in settings
  • you don't echo/print those variables to build output at all since that might be visible to the public

因此可以在 CircleCI GUI 中安全配置部署密钥的 public 回购(因此 public CircleCI 项目)。