fix(gateway): honor container network restrictions by doringeman · Pull Request #611 · docker/mcp-gateway · GitHub
Skip to content

fix(gateway): honor container network restrictions - #611

Open
doringeman wants to merge 1 commit into
docker:mainfrom
doringeman:fix/rt-345-block-network
Open

doringeman wants to merge 1 commit into
docker:mainfrom
doringeman:fix/rt-345-block-network

Conversation

@doringeman

@doringeman doringeman commented Oct 21, 2026 •

Copy link
Copy Markdown

What I did

Honor explicit network restrictions in both gateway-launched container paths. Previously, ordinary MCP containers retained inherited gateway networks alongside their allow-host proxy, or inherited/default networking without a proxy. Tool containers ignored the global block flag.

Share network argument selection: --block-network selects only the configured proxy network or none; tool containers have no allow-host configuration and select none. Per-server disableNetwork takes precedence, suppresses proxy configuration, and avoids starting proxy sidecars. Unblocked networking and defaults stay unchanged.

This controls local container launch arguments. Remote/static backends, shared proxy-network trust and isolation, and host capabilities exposed through mounts remain outside this fix.

Related issue

Fixes #610.

Review status

The required upstream Copilot bot request was rejected because the author has READ access to this repository. An upstream maintainer must submit it. Local Copilot CLI review is complete and clear; CodeRabbit and a different-human agent review were requested. The PR remains draft.

Validation

  • make test and make lint pass, including Linux/Darwin/Windows lint targets.
  • Focused gateway regression tests pass 20 shuffled race runs on macOS. They verify complete ordinary-container arguments and actual tool-container argv through an isolated benign executable. The argv fixture skips Windows; native Windows runtime behavior and live blocked-network connectivity were not exercised locally.
  • Separate security, engineering and product plan/diff reviews and a full intended-diff Copilot CLI review found no actionable issues.

Manual verification: run make test. Both network-policy tests should pass: unblocked launches preserve inherited/default networking; blocked launches select only the proxy or none; disableNetwork suppresses all proxy options. The prior implementation fails the new blocked and precedence assertions. No host daemon or credential changes are required.

Gateway-launched MCP and tool containers now honor explicit network blocking without retaining inherited or default network access.

@doringeman

Copy link
Copy Markdown
Author

@doringeman

Copy link
Copy Markdown
Author

[Dorin Geman / rt-security-fixes] REVIEW-REQUEST: please review current head 2bde27a with security, engineering and product perspectives, covering both ordinary/POCI container callers and proxy/default precedence. Comment-only agent review requested; humans approve.

@doringeman BLOCKED on upstream review-request permissions: the required Copilot GraphQL request was rejected because this account has READ access to docker/mcp-gateway. An upstream maintainer must request that bot review. Local full-diff Copilot CLI review completed cleanly, CodeRabbit was requested, and CI is running. No repository settings or permissions were changed.

@doringeman

Copy link
Copy Markdown
Author

@doringeman
doringeman marked this pull request as ready for review October 22, 2026 09:11
@doringeman
doringeman requested a review from a team as a code owner October 22, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Honor network restrictions in both container launch paths

1 participant