Gate privileged mode and docker socket mount behind an annotation - #50
Open
sagar1312 wants to merge 1 commit into
Open
Gate privileged mode and docker socket mount behind an annotation#50sagar1312 wants to merge 1 commit into
sagar1312 wants to merge 1 commit into
Conversation
Every build container was unconditionally started with Privileged: true and the host's /var/run/docker.sock bind-mounted in, allowing any build step to escape the container and compromise the host. Both now default off and only apply when a job sets the screwdriver.cd/dockerEnabled annotation, following the same hoek.reach(config, 'annotations>...') pattern already used for screwdriver.cd/timeout.
sagar1312
force-pushed
the
fix/gate-privileged-docker-socket-mount
branch
from
August 14, 2026 01:17
7c84f61 to
7bb3a71
Compare
sagar1312
marked this pull request as ready for review
August 14, 2026 01:18
minghay
approved these changes
Aug 14, 2026
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
What changed
Privileged: trueand the host's/var/run/docker.sockbind-mounted in unconditionally.screwdriver.cd/dockerEnabledannotation, using the samehoek.reach(config, 'annotations>...')pattern already used forscrewdriver.cd/timeout.Why
Example (before → after)
Before — every build's
HostConfig, regardless of job config:After — default (no annotation):
After — job opts in with
annotations: { 'screwdriver.cd/dockerEnabled': true }:Test plan
npm test— full suite passes (22 tests), including two new tests covering the default-off behavior and the annotation opt-in.npx eslint index.js test/index.test.js— no new errors (pre-existing max-lines-per-function warnings only).Out of scope
_stop,_findContainers,_removeContainer,_startContainer, or the fusebox/breaker wiring — none of these touchHostConfig.screwdriver.cd/timeoutalready works.