我遇到的问题与这里提到的问题相同:Securely storing environment variables in GAE with app.yaml - 即:
“我需要在app.yaml中存储API密钥和其他敏感信息作为环境变量,以便在GAE上进行部署。问题在于,如果我将app.yaml推送到GitHub,这些信息就会公开(不好)。”
另外我想查看以下方框:
我的研究得出以下结论:
Securely storing environment variables in GAE with app.yaml
How to set environment variables/app secrets in Google App Engine
GAE : How to deploy various environments with secrets?
appengine and OS environment variables
How to pass environment variables to the app.yaml using cloud build
来自GAE : How to deploy various environments with secrets? 的很多好消息,作者列出了三种解决方法及其不使用的原因:
然而,对我来说最好的解决方案来自How to pass environment variables to the app.yaml using cloud build
它允许我使用GAE灵活环境为nodejs提供以下部署流程:
这会检查我的所有盒子并且是一个相当简单的解决方案但是,这绝对不是一个流行的解决方案,所以我在这里遗漏了什么?
最重要的是有任何安全问题吗?
我对你如何进行研究感到惊讶,你实际上已经收集了所有可能的方法来实现它。
正如您所提到的,有很多方法可以将变量传递给应用程序,但我相信您提出的解决方案(将变量存储在Google云端存储中并使用Google Cloud Build检索它们)是最适合您的目的。它不需要太多代码,它很优雅,我希望这篇文章可以帮助人们了解这个解决方案。关于您的安全问题,此解决方案包括高度安全性,因为您可以从Google Cloud Build中set the file in the bucket to only be accessible和项目所有者。