Repository navigation
Trust and proxy delivery into boxes - #36
Merged
Merged
Conversation
czpython
force-pushed
the
dru-459-trust-delivery
branch
from
September 6, 2026 14:39
533b714 to
53c2a30
Compare
czpython
force-pushed
the
dru-458-secrets-proxy
branch
3 times, most recently
from
September 7, 2026 05:02
37e510a to
452d069
Compare
czpython
force-pushed
the
dru-459-trust-delivery
branch
3 times, most recently
from
September 7, 2026 05:17
66463f0 to
3df0ceb
Compare
…crets A box that sends its HTTPS through the proxy must trust the proxy's CA. The proxy implementation of the seam now hands the box the public certificate, base64, in SECRETS_PROXY_CA, next to the proxy address. The API reads the certificate from the proxy's volume, at SECRETS_PROXY_CA_FILE, parses it, and hands out its public bytes and nothing else. A file that holds a private key is refused. A request with secrets on a proxy provider needs both settings, and answers 409 without them. The box installs the certificate at boot, in /usr/local/share/ca-certificates/drukbox.crt, with update-ca-certificates. One writer, environment.trust, gives the shell lines beside persist, bashrc, and cloud_init. The lines read the exported variable, and a failed install ends the script. The cloud providers get them from cloud_init as root. The exe setup script gets them with sudo -n, since it runs as a user, and exe refuses a script over 10 KiB, so the API answers that with a clear error first. The docker sandbox image does the same in its entrypoint. A box without secrets gets none of this. SSL_CERT_FILE, REQUESTS_CA_BUNDLE, and CURL_CA_BUNDLE point at the system bundle, and NODE_EXTRA_CA_CERTS at the certificate, so curl, Python, and Node trust the proxy from the first session. Provisioning checks the whole boot environment against the pam_env rules before any provider call, so a value pam_env would drop fails the host with a clear error instead of a silent loss. The test suite carries a self-signed certificate for the setting, and CI mounts it into the API.
czpython
force-pushed
the
dru-459-trust-delivery
branch
from
September 7, 2026 05:19
3df0ceb to
e8c3b62
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.
What changes
A box that sends its HTTPS through the proxy now trusts the proxy's CA from its first session, with no manual step.
SECRETS_PROXY_CA, next toHTTPS_PROXY,https_proxy, andNO_PROXY. It also setsSSL_CERT_FILE,REQUESTS_CA_BUNDLE, andCURL_CA_BUNDLEto the system bundle, andNODE_EXTRA_CA_CERTSto the certificate file.SECRETS_PROXY_CA_FILE, parses it, and hands out its public bytes and nothing else. A file that holds a private key, themitmproxy-ca.pembeside the public one, is refused. A request with secrets on a proxy provider needsSECRETS_PROXY_URLandSECRETS_PROXY_CA_FILE, and answers409without them.environment.trust, gives the shell lines that install the certificate at/usr/local/share/ca-certificates/drukbox.crtand runupdate-ca-certificates, besidepersist,bashrc, andcloud_init. The lines read the exported variable, and a failed install ends the script. The cloud providers get them fromcloud_init, as root. The exe setup script gets them withsudo -n. The docker sandbox image does the same in its entrypoint, since the docker provider runs no script.ssh exe.dev docfornew. The API refuses a longer one with a clear error before the call.env/, and CI mounts it into the API for the black-box run.Where this differs from the ticket
/etc/environmentand~/.bashrclike every other variable. The ticket puts it in env, and dropping it after the install would need one more step per provider for a public certificate.Names
New names, open to change:
SECRETS_PROXY_CA_FILE,SECRETS_PROXY_CA,environment.trust.Gates
uv run ruff check,uv run ruff format --check,uv run pyright, anduv run pytestare green.Acceptance
Run on the acceptance stack with this branch built into the API and exchange image, the proxy on the host's tailnet address, and a live subscription token as a static
anthropicsecret. Docker used a sandbox image built from this branch'simages/localplus Claude Code. Exe used the deployment's own image, which ships Claude Code as a standalone binary and nonode, so the check installed Ubuntu's node for its ownnode -estep. No manual step touched the CA. 13 of 13 on docker and 13 of 13 on exe:HTTPS_PROXY,https_proxy,NO_PROXY,SECRETS_PROXY_CA,SSL_CERT_FILE,REQUESTS_CA_BUNDLE,CURL_CA_BUNDLE, andNODE_EXTRA_CA_CERTS.NODE_EXTRA_CA_CERTSnames, and the system bundle verified it.curl https://api.anthropic.com/showed our CA as the issuer.node -ereached the same host through the proxy with our CA as the issuer.claude -pansweredok.The stack was restored afterwards, and the branch images, the token file, and the CA directory were removed from the host.
Review
One adversarial review, four findings, all applied.
SECRETS_PROXY_CA_FILEthat named mitmproxy's key-and-certificate file would have put the private key into every box. The API now parses the file and hands out the public bytes only, and refuses a file with a private key. Tests cover both.The exe half of the acceptance was repeated after the fixes, since they change the exe setup script.