Repository navigation
docs(docs): The text of the spec Reach protected sites through an operator's egress proxy is in git - #66
Merged
Conversation
…rator's egress proxy is in git The accepted export of #49, as export-spec.py wrote it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #49
Summary
The text of the spec "Reach protected sites through an operator's egress proxy" is in the repository at
docs/specs/E2-49-reach-protected-sites-through-an-operator-s-egress-proxy.md, as the issue held it when the spec closed. Nothing changes for anyone using the product.Before this closing, each of the spec's 53 user stories was mapped to the test, static check or live run that proves it (the table under Evidence). On
d5b15ba, the squash of #55, seven stories (8, 11, 17, 21, 37, 38 and 42) held but were only partly tested: a Gateway broken on purpose still passed every test. #61 added their cases, building #60, a sub-issue of this spec that is now done. Story 52's Fargate step stays out of scope, as the spec's Out of Scope says.#61's body named "the pull request that closes #49", and GitHub read that as a closing keyword: #49 closed when #61 merged. It was reopened so that this pull request closes it, as
docs/agents/issue-tracker.md("Closing a spec") asks.The verification also found #62: on x86-64, a grant worker was killed when glibc's malloc opened a file, which failed #61's
curljob. #63 fixed it, and both are in Countersign 0.2.2 (v0.2.2). #62 has no milestone, so it never held this spec open.Evidence
export-spec.py 49export-spec.py 49No test or guard is new here: the seven cases #61 added were each shown red there against a Gateway broken on purpose, and green against the real one.
python3 .claude/plugins/foresight/scripts/export-spec.py 49, run on 59f95a9 after #61 and #65 merged:wrote … as accepted: every sub-issue is closed and only specs are open in E2 Reach protected sites through an operator's egress proxy, so the pull request that adds this file closes #49. The sub-issues are #50, #51, #52, #53 and #60, all closed. The text it wrote after the header is the same as the committed file's; only its export day differed, so the committed file, exported 2026-11-24, stands. A comparison of the file's text after its header withgh issue view 49 --json body, CRLF read as LF: 20104 bytes in each, the same.Not run: nothing.
The 53 user stories of #49: 39 Test, 12 Static, 10 Live run (eight stories have two verdicts), 0 Partial, 0 Gap
Checked on
mainat 59f95a9, the squash of #65 (Countersign 0.2.2), which holds #55's egress proxy and #61's cases for the stories marked (#61).crates/countersign-gateway/tests/runtime.py. Line numbers below are at 59f95a9. On 59f95a9, CI's Sidecar mTLS run 45638935969 passed it in all four jobs (gateway-arm64,curl, andgateway-filter-sandboxon x86-64 and arm64). Each job printedsidecar/shared Gateway mTLS passed,sidecar/shared Gateway mTLS through the egress proxy passedandsidecar/shared Gateway without a usable egress proxy failed closed, andgateway-arm64ran the silent egress proxy's step under both worker sandboxes.compose_demo.py --squid --verifyoutput posted on A maintainer can qualify the Gateway against a real Squid in the Compose demo #52, from 5d76a8b with Squid 6.14. feat(gateway): The Gateway reaches protected sites through an operator's egress proxy #55's body records a pass on d84d66d too, but that run's output was not posted.main. CI'smkdocs build --strictchecks only its links, not its words.egress_proxyonce and every site goes through itegress.take() == through_egress(734). Every failing rule's CONNECT is recorded by the test proxy (760–783).egress_proxyline; every rule butdirectgoes through it.siteandrefused…wronghave noegressfield (516) and reach the proxy (734, 760–783)."egress": "direct"on one rule; one Gateway serves both routesres = request(user, to=direct)returns the fingerprint, thenassert egress.take() == [], 'A direct destination went through the egress proxy'(735–738).sidecar/shared Gateway mTLS passed. Their assertions are unchanged from before #55; the diff only refactors the grant fixture. The shared pass adds"egress": "direct"(535–538).assert egress.take() == [f'CONNECT {host} HTTP/1.1'] * len(users)(731–734), withhost = 'site.test:<port>'.assert resolved.returncode == 2, ('The Gateway could resolve the site itself', resolved)(571–575) runs under the Gateway's own NSS environment, and the proxied pass then succeeds.site.testand works anyway. It does not prove the Gateway never tries a lookup, which the story does not need.private_networkssiterule losesprivate_networks(512) and the site is at the host's interface address. Compose: the site is at 172.31.0.2 and the rule has noprivate_networks(#52 run,docs/develop.md).*.wild.test:<port>withoutprivate_networks:reads_site(user, wild)for each user, thenassert egress.take() == [f'CONNECT {wild} HTTP/1.1'] * len(users)(740–742).private_networksegress_configuration:error = refused('http://proxy.test:3128', **base)(438).refuses()asserts a non-zero exit and no stdout from bothenvandserve(403–412).servestarted (TimeoutExpired).assert re.search(r'\bsite\b', error) and 'private_networks' in errorandassert 'remove' in error and '"egress": "direct"' in error(439–440).egress_proxy: every undecided private rule stops startupegress_configuration:[rule, second], the private rule second.refuses()fromenvandserve, thenassert re.search(r'\bsecond\b', error) and 'private_networks' in error(441–446).servestart.httpsegress proxy URL refused at startuperror = refused('https://proxy.test:3128'), thenassert 'egress_proxy' in error and 'https' in error(418–419).assert 'egress_proxy' in error and 'credentials' in error and 'secret' not in errorforuser:secret@anduser@(420–422).egressvalue fails loadingrefused(..., egress=value)for'proxy', 'default', 'Direct', 'none', '', None, True, ['direct'], with and without an egress proxy (447–449).envrefuses whatserverefusesrefuses():assert results[0].stderr == results[1].stderracrossenvandserve(409). Every refusal above goes through it, and so does the wildcard-with-private_networksrule (430–433).wait_for_log(rf'Gateway egress proxy localhost:<port> carries the address policy of destinations: ' + ', '.join(['site', *failing, 'wild', 'ungranted'])), a full match that leaves outdirect(620–622).egress_proxyishttp://proxy.test:<port>, resolved only through the Gateway's hosts file. The name moves to a second egress proxy on 127.0.0.2:assert moved.take() == [f'CONNECT {host} HTTP/1.1'], 'The Gateway did not follow the egress proxy'. Moved back:'The Gateway did not follow the egress proxy back'(748–758).The Gateway did not follow the egress proxy.proxy.test, inside the special-use blocks, and is reached with noprivate_networks(511, 549). In Compose, Squid is on the private backend network, where Squid logs the Gateway as 192.168.32.5.denied_networksstill applied to the proxy's addressdenied_networks: ['127.0.0.0/8', '::1/128'](930):proxy_unavailable, thenassert not egress.accepted_since(seen), 'The egress proxy saw a connection'(682–685).proxy_deniedfails_through_egress(failing['refused'], 'proxy_denied')assertsheaders.get('countersign-error') == error(656, 760). In Compose:TCP_DENIED/403→proxy_denied.proxy_unavailableclosed,garbled,banner,stub. Silent:runtime.py --silent-egress-proxy,fails_through_egress(failing['silent'], 'proxy_unavailable', timeout=130)(675–680). It runs ine2e.yml'sgateway-arm64step "Fail a CONNECT through a silent egress proxy at the Gateway's deadline", under both worker sandboxes.upstream_failure, the case fails.upstream_failurefails_through_egress(failing['unreachable'], 'upstream_failure')(773). In Compose, Squid'sTCP_TUNNEL/503with the site stopped →upstream_failure.Countersign-Request-IDfails_through_egress:assert request_id, (to, answer), thenwait_for_log(rf'Gateway CONNECT {request_id} {error}')(657–661). The Compose run matches each ID to the Gateway's log line.docs/operate.md, "Reach sites through an egress proxy": the example configuration and its fields.squidblock:to_metadata,to_link_local,to_loopback, each denied before any allow.squid -k parseon these rules was a one-off run in #55's review, recorded in its body. The demo'ssquid.confhas the same rules, so the Compose run exercises them.billing_prefixesandbilling_outside, withhttp_access deny billing billing_outside, and the paragraph on howdstmatches.egress_proxyandegressdocs/reference/config.md: theegress_proxyrow (Gateway fields) and theegressrow (destination fields).docs/operate.md, troubleshooting row "CONNECT returns 502":proxy_denied,proxy_unavailable, andupstream_failureon a proxied route.for shared in (False,True)runs the proxied and unusable passes in both modes (922–931). CI printsshared Gateway mTLS through the egress proxy passed.request()(same--proxy,--proxy-cacert,--cacert) readssite.test(proxied) anddirect.test(direct) in one pass (623–628, 725–738).banner,stubandlfanswer and keep the connection open. Each must give its 502 insideconnect's 8-second socket timeout (768–771).assert body == b'' and b'egress proxy' not in answer(660), on every negative case. The test proxy sendsERROR_PAGEwith each 403 and 503 (250–251, 289, 303).broker.retired['bob'].set(), thenassert site.cutoff.wait(1)(831–840), before the proxied pass returns (841–843).assert not site.accepted_since(seen), (to, 'The site saw a connection', answer)in everyfails_through_egresscase (651). The unusable pass gives the Gateway a working direct route and checks that it went unused (549–550, 573).for name in ('wrong', 'untrusted'): the request fails,egress.take()records the allowed tunnel, andassert failing[name] not in broker.signatures(778–782).untrusted'srootsis another CA.refused_before_egress(unlisted)(a grant, no rule) andrefused_before_egress(ungranted)(a rule, no grant). Each assertsHTTP/1.1 403, then'The egress proxy saw a connection'and'The site saw a connection'are both false (667–673, 745–747).site_tls.verify_mode=ssl.CERT_REQUIRED), and the grant authority assertsbody['tls'] == 'tls13'on each signature (218). A clear-text byte after the CONNECT head would break that handshake. In Compose: Squid has nossl-bump, logsTCP_TUNNEL/200, and the site saw the approved fingerprint.runtime/worker.rsorworker_sandbox.rs. The proxied leg is in the supervisor (egress::tunnelfromconnect_request). The proxied passes run under both sandboxes in CI (gateway-filter-sandbox).worker_sandbox.rsfor a glibc malloc read (#62), which the egress proxy did not cause: the same kill could come on a direct route.docs/adr/0003-…md,status: accepted. Decisions 3 (move), 4 (stay) and 6 (the proxy's own address).ignoredpass, as before. In the proxied passes, the six variables name a dead address besideegress_proxy(563–569), and every proxied request still succeeds.egress::tunnelpreferringHTTPS_PROXYfails the first proxied request with 502.docs/specs/2026-11-17-countersign-design.md: "A destination takes one of two routes. On a direct route … On a route through the operator's egress proxy (ADR 0003) …"..github/workflows/e2e.yml(on: [push, pull_request]), steptimeout 120 python crates/countersign-gateway/tests/runtime.py …andscripts/filter-sandbox-container.sh. The proxied passes always run (main, 922–931).refused,closed,garbled,banner,stub,lfandunreachable, and both unusable passes.wrong(778–782).assert egress.take() == [f'CONNECT {failing["wrong"]} HTTP/1.1'], 'The egress proxy refused the tunnel'proves that the tunnel was allowed.wrong.test, a signature was made.compose_demo.py --squid --verify, the run posted on #52 (5d76a8b, Squid 6.14, exit 0).docs/develop.md, "Qualify the Gateway against a real Squid".Squid tunneled the Workload's CONNECT: … TCP_TUNNEL/200 … CONNECT site.test:9444 … HIER_DIRECT/172.31.0.2,Compose mTLS accepted selected SHA-256 5d01b2…andJob page matched the fingerprint the site received with the approval. The checks areSquid.loggedandverifyincompose_demo.py.compose_demo.pydid not change on the default path.GLOSSARY.md: Egress proxy, Avoid: upstream proxy, outbound proxy, Squid.docs/develop.mdandexamples/demo-integrator/{compose.squid.yaml,squid.conf}.examples/demo-integrator/compose.yamlis unchanged by #55, and--squidis an opt-instore_trueflag. #55's body: the default--verifypassed on 17525c6, and the defaultdocker compose configwas identical before and after.compose_demo.pychanged only insideSquid.configure.Summary: 53 stories, each proved: by test, statically, by the live run, or by a mix of these. No story is excluded whole. Only story 52's Fargate step is out of scope. Stories 8, 11, 17, 21, 37, 38 and 42 were Partial or Gaps on d5b15ba, the squash of #55; #61 added their cases, each red once against a Gateway broken on purpose.
Merge Danger
Door: two-way. A revert removes the file, and #49 is reopened by hand.
Blast Radius: none.
The merge ships no image, release or infrastructure, and no flag. The handbook excludes
docs/specs/(mkdocs.yml,exclude_docs).Reviews
No review ran: the file is the issue's text, checked byte for byte
Tracking
Epic: E2 Reach protected sites through an operator's egress proxy
Spec: #49 Reach protected sites through an operator's egress proxy
Ticket: none
Flag: none
🤖 Generated with Claude Code