fix(docker): harden supervisor startup and gateway routing#1128
Open
fix(docker): harden supervisor startup and gateway routing#1128
Conversation
TaylorMutch
previously approved these changes
May 2, 2026
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
26ee521 to
4aae038
Compare
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
Hardens Docker sandbox supervisor startup against user-controlled
PATHoverrides and routes local Docker sandbox callbacks over Docker-managed networking instead of host network mode. This is a better-named, single signed-commit branch carrying the same tree as #1115.Docker sandboxes now use
host.openshell.internal:<gateway-port>for supervisor callbacks. Native Linux Docker gets a private bridge gateway listener, while Docker Desktop uses Docker'shost-gatewayalias because its bridge gateway IP belongs inside the Docker Desktop VM rather than the host OS.Related Issue
Fixes #1113
Changes
PATHdriver-owned after user environment merge.ipandnsenterhelpers from fixed absolute path allowlists instead of processPATH.--docker-network-name/OPENSHELL_DOCKER_NETWORK_NAME.host-gatewaymapping forhost.openshell.internalinstead of overriding it to the VM bridge gateway IP.OPENSHELL_ENDPOINTathost.openshell.internal:<gateway-port>.--bind-address/OPENSHELL_BIND_ADDRESS, defaulting to loopback, with Docker/Helm deployments explicitly binding0.0.0.0.PATHoverride attempts, helper-path lookup behavior, Docker bridge gateway parsing, Docker Desktop routing, loopback bind defaults, and multi-listener gateway binding.Testing
mise run pre-commitpassesAdditional targeted checks previously run against this tree:
cargo test -p openshell-driver-dockercargo test -p openshell-server gateway_listener_addressescargo check -p openshell-server -p openshell-driver-dockeropenshell sandbox create --name desktop-routing-final --no-keep --no-tty -- trueagainst Docker Desktop gatewaydocker inspectconfirmed Docker Desktop containers useExtraHosts=["host.openshell.internal:host-gateway"]lsof -nP -iTCP:18080 -sTCP:LISTENconfirmed the local Docker gateway listens on127.0.0.1:18080cargo test -p openshell-sandbox find_trusted_binary(macOS host compiles crate but Linux-only tests are filtered)cargo zigbuild -p openshell-sandbox --target aarch64-unknown-linux-gnucargo zigbuild -p openshell-sandbox --target aarch64-unknown-linux-gnu --testsChecklist