Skip to content

driver: set network.host entitlement by default for container drivers - #2266

Merged
crazy-max merged 1 commit into
docker:masterfrom
crazy-max:container-driver-host-entl
Feb 23, 2024
Merged

driver: set network.host entitlement by default for container drivers#2266
crazy-max merged 1 commit into
docker:masterfrom
crazy-max:container-driver-host-entl

Conversation

@crazy-max

Copy link
Copy Markdown
Member

fixes#2255

@AkihiroSuda

Copy link
Copy Markdown
Collaborator

This seems to be a potentially breaking change (from security perspective), and has to be documented?

Comment threadbuilder/builder.go Outdated

if !hasNetworkHostEntitlement {
// always set network.host entitlement as container network is
// isolated for docker-container and kubernetes drivers

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the comment could you explain the purpose of setting the entitlement by default?

@tonistiigi

Copy link
Copy Markdown
Member

This seems to be a potentially breaking change (from security perspective),

It is not. The default networking for build step containers if builder was in container was already host (meaning host inside the container, not host of machine) and will remain like this in v0.13. This was without setting any --network=host.

Comment threadbuilder/builder.go Outdated
@crazy-max
crazy-maxforce-pushed the container-driver-host-entl branch from ae3436e to 48ab88dCompareFebruary 23, 2024 10:14
@crazy-max
crazy-maxforce-pushed the container-driver-host-entl branch 3 times, most recently from 2d6ae5c to 4d88ca6CompareFebruary 23, 2024 10:56
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-maxforce-pushed the container-driver-host-entl branch from 4d88ca6 to e008b84CompareFebruary 23, 2024 21:23
@crazy-max
crazy-max merged commit d891634 into docker:masterFeb 23, 2024
@crazy-max
crazy-max deleted the container-driver-host-entl branch February 23, 2024 21:41
@crazy-maxcrazy-max added this to the v0.13.0 milestone Sep 11, 2024
djdomi added a commit to wiki-mod/lancache-ng that referenced this pull request Jul 10, 2026
--allow network.host on a plain 'docker build' invocation only works
if the runner's Docker daemon was separately started with
--allow-insecure-entitlement network.host -- an infrastructure-level
flag this workflow doesn't control. The docker-container builder
driver has had network.host entitlement enabled by default since
buildx v0.13 (docker/buildx#2266), with no daemon-side dependency, so
add an explicit docker/setup-buildx-action step and switch from
'docker build' to 'docker buildx build --load' for this scan step.
Addresses the review finding that the entitlement flag's actual effect
was asserted, not verified, on the plain docker driver.
djdomi added a commit to wiki-mod/lancache-ng that referenced this pull request Jul 10, 2026
* ci(_Issue565): allow host network scan builds
* ci: use explicit docker-container Buildx builder for local scan build
--allow network.host on a plain 'docker build' invocation only works
if the runner's Docker daemon was separately started with
--allow-insecure-entitlement network.host -- an infrastructure-level
flag this workflow doesn't control. The docker-container builder
driver has had network.host entitlement enabled by default since
buildx v0.13 (docker/buildx#2266), with no daemon-side dependency, so
add an explicit docker/setup-buildx-action step and switch from
'docker build' to 'docker buildx build --load' for this scan step.
Addresses the review finding that the entitlement flag's actual effect
was asserted, not verified, on the plain docker driver.
---------
Co-authored-by: codex <codex@lancache-ng.local>
Co-authored-by: djdomi <djdomi@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v0.13] allow network.host daemon entitlement by default in container drivers

3 participants

@crazy-max@AkihiroSuda@tonistiigi