TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Build Pipeline Security

2 点作者 oxinabox大约 4 年前

1 comment

oxinabox大约 4 年前
While I am posting this, i disagree with its conclusion. A seperate repo for your config is neither the only solution, nor is a particularly comprehensive one.<p>For one, your deployment scripts, and other things that can escape the container, are almost certainly using Secrets. E.g. secured enviroment variables. Your CI server should be configured to only share those Secrets with PRs coming from trusted branches.<p>*Otherwise they can simply `println(DEPLOY_KEY)` even if the CI config is on another branch*; unless you also don&#x27;t show the logs etc.<p>TravisCI for example only trusts PRs from your own repo. It doesn’t give secrets to PRs from forks. <a href="https:&#x2F;&#x2F;docs.travis-ci.com&#x2F;user&#x2F;pull-requests&#x2F;#pull-requests-and-security-restrictions" rel="nofollow">https:&#x2F;&#x2F;docs.travis-ci.com&#x2F;user&#x2F;pull-requests&#x2F;#pull-requests...</a><p>---<p>I feel like it is a thing to not use the CI configuration of the branch, but to always use the CI configuration of master&#x2F;main. At least for untrusted branches. This ensures that someone has code-reviewed the CI config before it runs. (Still doesn’t help with malicious tests though, but nor does a seperate repo. But see above re: secrets that allow escaping container)<p>I thought this was the default for TravisCI but it seems not. You can turn it on though, it is the same mechanism as for a seperate repo. <a href="https:&#x2F;&#x2F;docs.travis-ci.com&#x2F;user&#x2F;build-config-imports#importing-configs-from-the-same-repository" rel="nofollow">https:&#x2F;&#x2F;docs.travis-ci.com&#x2F;user&#x2F;build-config-imports#importi...</a>