docs: document limiting what the build can see - #277
Open
dash14 wants to merge 1 commit into
Open
Conversation
…nts work through the remote driver
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An allowlist decides which destinations a build can reach; it can't tell a legitimate use of an allowed one from an abusive one. A compromised dependency can read
~/.npmrc, take the npm token, and publish toregistry.npmjs.org— which has to be allowlisted fornpm cito work at all. Nothing in the rule set stops that, and the docs didn't say what does.Adds a
Limiting What the Build Can Seesection todocs/security.md: don't put a token in the build unless the build needs it, and scope the ones it does need to the singleRUNthat needs them.README.md's Scope section gets the short version and links there.Companion to buildcage/isolated-run#27, where the same problem is solved by splitting the step instead — this repo can't, since one builder serves the whole build and the allowlist doesn't vary per
RUN.Verifying the claim
The guidance depends on
RUN --mount=type=secretstill working through the remote driver, which wasn't covered.test/Dockerfile.transparent-restrictnow asserts the secret is readable in theRUNthat mounts it and absent from a later one, following the existing per-RUNexit 1pattern rather than adding a matrix entry.The secret is passed for every matrix entry; an unmounted secret is never materialized, so the other three are unaffected.
Test plan
make test_integration_buildkit_transparent_restrictpasses, with both new steps confirmed in the build logvp check