Files
devvm/testdata/script
w3cjandClaude Opus 5.5 080d57dd28 fix(netpolicy): builds reach a company proxy through a proxy of their own; ** refuses names the host can't resolve
From an independent review of the company-proxy change.

1. Builds never get the company proxy's credentials. Each build behind
   a company proxy goes through a devvm _proxy of its own on the host
   (backend.ProxyStarter / BuildProxy, shared by Lima and Docker; Docker
   Desktop's build proxy moved into it): policy **, a new random password,
   the company proxy in its -upstream file, -lifeline on the build VM's
   hostagent or the container's docker container wait. Builds get only
   http://devvm:<one-time>@<host>:<port> (each variable the host sets) and
   the host's NO_PROXY.
   - Lima: image builds, the tools build and --from's conversion VM reach
     it at 192.168.5.2; on macOS the build's Seatbelt profile allows that
     one loopback port (NetInternet + ProxyPort), so a loopback company
     proxy works for macOS builds too. guestProxyURL is gone. limactl runs
     without the host's proxy variables (Lima logged them, password and
     all, into devvm's run log; found by the new e2e check); only a
     NetDirect start gets them back for propagateProxyEnv.
   - assets/oci/build.sh: the /etc/os-release probe runs under env -i;
     chroot_run passes only the build proxy's variables (bootify.sh's
     downloads behind a company proxy).
   - Docker: buildNet takes Desktop's path (own network, relay, build
     proxy) on any engine behind a company proxy; hostProxyEnv is gone.
     A Linux engine's build behind one needs devvm's Linux build.
   - Settings the proxy can't go through are refused before anything is
     made (upstream_proxy_scheme, reworded for builds too).
2. noClientProxy on the tools' unpack container and the relay.
3. floorUpstream: a name the host can't resolve goes upstream only when
   an allow rule names it (itself or *.domain: policy.byName); with only
   ** it's refused (errUnresolved, logged as the reason).
4. CONNECT replies are read through a 64 KiB io.LimitReader
   (maxConnectReply); bytes after the answer stay the tunnel's.

Tests: backend (TestProxyStarter, TestProxyStarterFails,
TestListeningPort, TestBuildProxyStop), lima (TestBuildImageHostProxy on
linux and darwin with the Seatbelt port, TestBuildImageHostProxyRefused,
TestConfineProxyEnv), docker (TestBuildHostProxy for a Linux engine with
and without a company proxy, unpack's empty proxy pairs), proxy
(TestUpstreamUnresolved, TestUpstreamConnectReplyLimit). CLI: docker.txtar
(a Linux engine's build behind a company proxy; every container create
and run, kept by the stub in containers-made, sets the empty -e pairs),
from.txtar (builds' proxy folders gone). e2e: images (a build sees only
its own proxy), from (a --from alpine:3.21 base with every feature and a
layer behind a company proxy with a password: the registry, Alpine's
mirror and the layer reach it through the builds' proxies; the password
is in no converted disk, image, log, build file or process's arguments);
corp_start/corp_stop shared with network.

Docs: internals/design (A company proxy: the ** case, builds, checks;
build confinement), safety/network, internals/network, images, lima,
docker, using/troubleshooting, internal/proxy/README.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 09:53:45 -07:00
..
2026-10-25 13:43:00 -06:00