New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elaborate on force clean checkouts #397

Closed
nhooyr opened this Issue Feb 6, 2019 · 1 comment

Comments

2 participants
@nhooyr
Copy link

nhooyr commented Feb 6, 2019

https://buildkite.com/docs/agent/v3/securing#forcing-clean-checkouts

By default Buildkite will reuse (after cleaning) a previous checkout. This may not be safe if building commits from untrusted sources (e.g. 3rd party pull requests). To force a clean checkout every time, set BUILDKITE_CLEAN_CHECKOUT=true in the environment.

Its not clear to me why building a commit from an untrusted source would be insecure when reusing a previous checkout.

@toolmantim

This comment has been minimized.

Copy link
Member

toolmantim commented Feb 13, 2019

Being able to place code into that directory, which might carefully take into account git clean rules, might mean that a file from a previous build might be included in a compiled binary for example. It's hard to describe all the attack vectors, but they're all part of the "cache poisoning" variety.

The ultimately "clean build" is an entire VM for each job, with no shared checkout cache. But we've included this instruction for people wanting to run third-party PRs from the other direction… starting with the standard agent setup.

I hope that clarifies things!

@toolmantim toolmantim closed this Feb 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment