The mount command in the Docker section was written from reasoning and
never run. Testing it showed it fails.
Mounting the bundle over /etc/ssl/certs/ca-certificates.crt lands
correctly, and the file contains the right CA, but curlimages/curl does
not read that path by default and still fails with exit 60. The runtime
has to be pointed at the file explicitly.
Verified commands now in the doc:
NODE_EXTRA_CA_CERTS=/ca.pem node:20-slim npm i is-odd -> added 2 packages
NODE_EXTRA_CA_CERTS=/ca.pem node:20-slim safedep-test-pkg -> code E403
CURL_CA_BUNDLE=/ca.pem curlimages/curl http=200
So PMG does block a malicious package inside a container once the
certificate is passed in. SSL_CERT_FILE was also tried and does not work
for curl, so it is not documented.
Also notes that the docker commands need an account with sudo, since
testuser deliberately has none.
Measured. Binding the proxy to the Docker bridge instead of loopback is
enough to make container traffic reach it, and needs no code change in
either pmg or the agent. The agent reads the address from the proxy state
file, so the redirect target follows.
127.0.0.1 container connection failed, never reached the proxy
172.17.0.1 curl exit 60, reached the proxy and refused the certificate
Exit 60 is a certificate error, so TCP completed and TLS began. Host
traffic was unaffected in the same run.
CA trust inside the container stays unsolved and is probably unsolvable
from the host, since a container has its own trust store and injecting
into it requires whoever starts the container to mount it. For containers
the guarantee therefore degrades to fail closed.
Only the default bridge is covered. Compose and custom networks use other
gateways, which needs bpf_get_netns_cookie to select a target per
namespace. A non loopback bind also exposes the proxy, so it wants a
firewall rule outside an isolated runner.
SETUP.md gains an optional Docker section with the commands and the
expected exit code, and Current Limits is corrected.
SETUP.md walks a fresh Linux machine through the POC end to end, in
short numbered steps.
The design doc gains two measured sections. CA Trust records which
clients honour the system trust store and which ship their own roots,
along with the config file settings that work without environment
variables. Container Reachability records that the hook does reach into
containers but the redirect target does not, because loopback is
network namespaced.
Design notes for making package registry traffic on Linux unable to
avoid the PMG proxy, scoped to CI runners and Linux servers.
Covers the cgroup connect hook and why the socket layer was chosen,
why redirect is preferred over deny, the proxy self traffic exemption
and cgroup escape analysis, when the destination name becomes knowable
and why SNI is the authoritative source, and findings from the network
visibility POC.
linux-network-enforcement.md is a cleaner rewrite of the same material.
Both are kept for now.