Skip to content

DRU-1110 -- Let the secrets proxy reach named private networks - #94

Merged
czpython merged 1 commit into
mainfrom
claude/dru-1110-proxy-private-networks-11edb1
Nov 9, 2026
Merged

czpython merged 1 commit into
mainfrom
claude/dru-1110-proxy-private-networks-11edb1

Conversation

@czpython

@czpython czpython commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

The secrets proxy refused every destination that is not public. A box had no way to reach a server on a private network through it, such as an on-prem model server.

  • The proxy reads SECRETS_PROXY_PRIVATE_NETWORKS, a comma-separated list of CIDRs, into its private_networks option. It reads the variable the same way as SECRETS_EXCHANGE_URL, so the image CMD does not change.
  • Swap.can_reach accepts an address inside a named network. CONNECT, plain HTTP, and the upstream connect resolve the host, then ask it, so they follow this one rule.
  • Loopback stays refused inside a named network, because the exchange listens there. So does 0.0.0.0, which connects to loopback. Multicast stays refused.
  • The list is empty by default, so an install that does not set it does not change.
  • An invalid CIDR, such as 172.17.0.1/16, makes mitmproxy exit at start.
  • Upstream CA trust stays with mitmproxy's own ssl_verify_upstream_trusted_ca option. This change adds no CA setting.
  • The deploy, security, and architecture docs name the setting.
  • The proxy test file drops a one-caller helper and an unused argument, as the checklist asks of a touched file.

Checks

  • uv run ruff check, uv run ruff format --check: pass
  • uv run pyright src/secrets_exchange/tests/test_swap.py: 0 errors
  • druks-house-rules check --base origin/main (v0.0.5): pass
  • uv run pytest src/secrets_exchange/tests/test_swap.py: 59 passed. CI runs the full suite.
  • The proxy image built from this branch ran on a scratch Docker network, with a fake exchange and an HTTPS server on a private address:
    • With a named network, HTTPS to the registered host returns 200, and the server receives the real credential.
    • With an empty list, CONNECT and plain HTTP get 403.
    • With an invalid CIDR, the proxy exits at start.

@czpython
czpython force-pushed the claude/dru-1110-proxy-private-networks-11edb1 branch from ab5bf16 to c9cab91 Compare November 8, 2026 19:09
The proxy refused every destination that is not public. A box had no way
to reach a server on a private network through it, such as an on-prem
model server.

The proxy now reads SECRETS_PROXY_PRIVATE_NETWORKS, a comma-separated list
of CIDRs, into its private_networks option. An address inside a named
network is reachable for CONNECT, for plain HTTP, and for the upstream
connect. The list is empty by default, so an install that does not set it
does not change. Loopback stays refused inside a named network, because
the exchange listens there, and so does the unspecified address, which
connects to loopback. An invalid CIDR stops the proxy at start. Upstream
CA trust stays with mitmproxy's own ssl_verify_upstream_trusted_ca option.

The deploy, security, and architecture docs name the setting. The proxy
test file drops a one-caller helper and an unused argument, as the
checklist asks of a touched file.
@czpython
czpython force-pushed the claude/dru-1110-proxy-private-networks-11edb1 branch from c9cab91 to dac1fab Compare November 9, 2026 10:50
@czpython
czpython merged commit 04824c3 into main Nov 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant