Skip to content

Commit b2069a2

Browse files
authored
feat(docker): support host and bridge supervisor networking (#4016)
* feat(docker): select supervisor networking for ECI workloads Signed-off-by: Drew Newberry <anewberry@nvidia.com> * test(docker): use automatic networking in e2e Signed-off-by: Drew Newberry <anewberry@nvidia.com> * test(docker): rely on existing e2e networking coverage Signed-off-by: Drew Newberry <anewberry@nvidia.com> * docs(docker): shorten supervisor networking configuration Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(docker): let local gateway discover supervisor endpoint Signed-off-by: Drew Newberry <anewberry@nvidia.com> * refactor(docker): make supervisor networking operator-selected Signed-off-by: Drew Newberry <anewberry@nvidia.com> * refactor(docker): resolve host gateway in the driver Signed-off-by: Drew Newberry <anewberry@nvidia.com> * docs(docker): simplify host networking guidance Signed-off-by: Drew Newberry <anewberry@nvidia.com> * docs(docker): trim configuration guidance Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(docker): discover host gateway once at driver startup Signed-off-by: Drew Newberry <anewberry@nvidia.com> --------- Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 44c07da commit b2069a2

10 files changed

Lines changed: 718 additions & 39 deletions

File tree

‎crates/openshell-driver-docker/README.md‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ mediates every supported TCP and DNS operation, attributes it to the calling
4141
binary, and sends the request across the private channel. The supervisor
4242
authorizes the request before it opens an upstream connection. Docker's absent
4343
workload network is the mandatory outer fence if mediation fails or is
44-
bypassed. The trusted supervisor companion uses Docker host networking, where
45-
it reaches the gateway's primary loopback listener and originates approved
46-
egress.
44+
bypassed. The trusted supervisor companion originates approved egress. Its
45+
operator-owned `supervisor_network_mode` defaults to `host`. Set `bridge` to
46+
run the supervisor on Docker's bridge network; `auto` also selects host.
4747

4848
The driver copies trusted runtime bytes from the configured supervisor image
4949
through the Docker archive API. No workload launch depends on a host bind
@@ -158,7 +158,7 @@ openshell sandbox create \
158158
`/openshell-sandbox` binary. The driver extracts that binary as bytes and
159159
stages it into the stopped workload. `supervisor_image` contains the
160160
dynamically linked glibc `/openshell-supervisor` binary that runs in the
161-
host-networked supervisor container. Release and gateway image builds bake
161+
supervisor companion container. Release and gateway image builds bake
162162
matching image tags into the binary.
163163

164164
## Gateway session and TLS
@@ -172,7 +172,7 @@ When no endpoint is configured, the supervisor connects to
172172
Docker daemon host. A configured HTTPS server certificate must include the
173173
endpoint host in its subject alternative names.
174174

175-
The driver publishes host loopback as the backend address for
175+
In host mode, the driver publishes host loopback as the backend address for
176176
`host.openshell.internal`. Policy DNS resolves that reserved name through the
177177
mediated path, so policies can reach host services without a Docker bridge,
178178
container DNS alias, or another gateway listener.
@@ -181,9 +181,33 @@ For HTTPS endpoints, the supervisor receives only the gateway CA and
181181
uses its sandbox-scoped bearer token to authenticate RPCs. User client
182182
certificates and private keys are not delivered to either container.
183183

184-
Docker Engine on Linux supports host networking directly. Docker Desktop
185-
requires host networking to be enabled in Settings and does not support it
186-
when Enhanced Container Isolation is enabled.
184+
Host mode on Docker Desktop requires host networking enabled in Settings.
185+
For bridge mode or a gateway endpoint using `host.docker.internal`, the driver
186+
resolves Docker's `host-gateway` once during initialization and caches it.
187+
A temporary container runs `--help` from the immutable supervisor image with
188+
no network, no capabilities, no privilege escalation, and a read-only root
189+
filesystem. The driver downloads Docker's generated `/etc/hosts` through the
190+
archive API, preferring a unique IPv4 address and otherwise a unique IPv6
191+
address. Resolution has a 30-second timeout; forced cleanup has a separate
192+
10-second timeout and runs after success or failure.
193+
194+
The driver uses the selected address for both host aliases and the runtime
195+
descriptor's trust pin; workload DNS and hosts files cannot select it. Host
196+
mode with other gateway endpoints retains its gateway-address pin. An explicit
197+
operator-owned `host_gateway_ip` overrides discovery and skips the temporary
198+
container. No supervisor changes or per-sandbox discovery are required.
199+
200+
When `grpc_endpoint` is omitted, bridge mode uses `host.docker.internal` on
201+
Desktop or for a wildcard gateway listener, and the concrete bind address for
202+
other non-loopback Linux listeners. The port is the gateway bind port; remapped
203+
container publications require an explicit endpoint. Native Linux loopback-only
204+
listeners cannot serve a bridge supervisor and produce an actionable error.
205+
Explicit endpoints retain TLS verification and are never rewritten; bridge
206+
rejects loopback/unspecified endpoint addresses. Host services bound only to
207+
loopback are also unreachable from a native Linux bridge supervisor.
208+
209+
The selected network mode does not change the sandbox's mandatory Landlock
210+
and seccomp qualification.
187211

188212
The supervisor owns these security-critical variables:
189213

0 commit comments

Comments
 (0)