Repository navigation
Description
Could you validate the Gateway in sidecar mode when a Squid HTTP CONNECT proxy is the workload’s only route to an external mTLS site? If this requires a Gateway change, please use this issue to track support and a regression test.
In FINsight, the MCP tool would use a Gateway on loopback in the same Fargate task. The task can reach the internal Broker directly. For external HTTPS it must reach Squid through an internal network load balancer. Squid authorizes the requested hostname and port, then passes the TLS bytes through. The Gateway must verify the origin certificate and perform the desktop-approved client handshake inside that tunnel.
MCP tool → Gateway sidecar → internal NLB → Squid:3128 → protected site:443
↕ CONNECT host:443
Broker ↔ paired desktop Companion
Our v0.2.1 Fargate run verified two concurrent grants with a shared Gateway and a site in the same task. It did not exercise Squid. In the tagged release the Gateway opens a TCP connection to the pinned destination. We haven’t verified an upstream proxy configuration for that connection. Previous qualification · v0.2.1 origin connection
Requested validation
- In a repeatable Compose test, give the Gateway access to the Broker and Squid, and put the protected site on a network reachable only through Squid. Configure Squid to allow CONNECT to the test hostname and port, with TLS interception disabled.
- Pair the Companion, approve the identity, and have the workload read a fresh flag through the sidecar. Correlate three observations from that run: Squid logged a successful CONNECT for the hostname and port, the origin saw the approved client certificate, and the workload received the site’s flag.
- Deny the destination at Squid, then separately make the proxy unavailable. Both requests should fail without a direct retry reaching the origin. With CONNECT allowed, verify that the Gateway still rejects an origin certificate for the wrong hostname.
- Please document how to configure the Gateway’s outbound proxy and where destination DNS resolution and address-policy enforcement occur when Squid resolves the CONNECT hostname. We’d like to repeat the passing configuration on Fargate 1.4.0 with
worker_sandbox: "filter"and check the flag in FINsight chat.
Activity
sodre commentedon Nov 22, 2026
Triage outcome
Category: enhancement
Summary: The Gateway can reach a protected site through an operator's egress proxy, with a regression test and a Compose qualification against a real Squid.
Why this is for a human: the next step is a spec with its tickets, which the owner starts. The decisions below were made with the owner during triage and are written up as ADR 0003 (proposed, not yet merged).
Current behavior:
Confirmed by reading the code at v0.2.1. The Gateway has no setting for a proxy on the leg to the site, and its config refuses unknown fields. The supervisor resolves the site's name itself, checks every DNS answer against the address policy, and opens a direct TCP connection to the pinned address. No proxy environment variable is read for that leg. Where the only route out is a proxy, the Workload's
CONNECTreturns 502 withCountersign-Error: upstream_failure, possibly only after the 120-second deadline.Desired behavior:
egress_proxyURL. The leg is a plain-text HTTPCONNECTwith no proxy authentication. AnhttpsURL, or one with credentials, is refused at startup.egress_proxyis set, every destination goes through it unless its rule says"egress": "direct". When it is absent, nothing changes.CONNECTwith the site's canonical name and port and resolves nothing. The egress proxy resolves the name and its ACLs carry the address policy.private_networks,denied_networksand the special-use blocks are not applied to the site's address on that route.private_networkson a proxied route is refused at startup, with an error that names the rule and both fixes. A private site through the egress proxy takes a rule withoutprivate_networks. Startup logs which destinations leave address policy to the egress proxy.private_networksand the special-use blocks.denied_networksstill applies to it.Countersign-Errorsaysproxy_deniedwhen the egress proxy answered with a refusal andproxy_unavailableotherwise. The proxy's response body is not passed to the Workload.Key interfaces:
egress_proxy, new per-destinationegress.Countersign-Errorresponse header: two new values,proxy_deniedandproxy_unavailable.CONNECTproxy.--verifymode gain a variant with a real Squid.Acceptance criteria:
CONNECTproxy and the site sees the approved client certificate.proxy_denied, and the site sees no connection.proxy_unavailable, and the site sees no connection.CONNECTallowed, the Gateway rejects a site certificate for the wrong hostname.private_networkson a proxied rule, anhttpsproxy URL, or a proxy URL with credentials does not start, and each error names the cause.--verifycorrelates Squid's log line for theCONNECTto the hostname and port, the certificate fingerprint the site saw, and the flag the Workload read. It also checks the Squid refusal and the unavailable proxy.Out of scope:
docs(docs): A proposed ADR says who enforces a site's address policy …
feat(gateway): The Gateway reaches protected sites through an operato…
sodre commentedon Nov 24, 2026
#55 is merged (d5b15ba). The Gateway can now reach a protected site through an HTTP
CONNECTegress proxy. You set it once, asegress_proxyin the Gateway configuration. To repeat the qualification on Fargate:docs/develop.md, "Qualify the Gateway against a real Squid". Its passingcompose_demo.py --squid --verifyrun is on A maintainer can qualify the Gateway against a real Squid in the Compose demo #52. It uses Squid 6.14, pinned by digest, and the Gateway has no direct route to the site.docs/operate.md, "Reach sites through an egress proxy". If the site is private, add the guide's deny for every address outside the site's prefix. Squid'sdstmatches when any one of a name's addresses is in its list.Countersign-Errorheader readsproxy_denied,upstream_failureorproxy_unavailable. The operator guide's troubleshooting table says what each means.The Fargate 1.4.0 run was outside #49's scope. It's the step left on this issue.
docs(docs): The text of the spec Reach protected sites through an ope…
sodre commentedon Nov 25, 2026
The egress proxy is released in v0.2.2. Test with this Gateway image:
The image is built for
linux/amd64. Besides #55, which addedegress_proxy, v0.2.2 includes:CONNECTand never answers: the Workload gets a 502 withproxy_unavailableafter 120 seconds.mallocreads.The setup, the ACLs and the error values in my last comment still apply.
Once your Fargate run passes behind your Squid, close this issue. If it fails, post the
Countersign-Errorvalue and the Gateway's log lines from that request here.sodre commentedon Nov 25, 2026
FINsight reporter qualification passed on AWS ECS Fargate 1.4.0, Linux x86-64, with Countersign v0.2.2 and Squid 6.14. On November 25, the installed Companion approved a desktop identity and the FINsight assistant displayed the origin’s fresh flag.
The FINsight mock MCP tool and Gateway sidecar shared a Fargate task and communicated over loopback. The MCP tool trusted the public CA generated by that sidecar. The Gateway used
worker_sandbox: "filter"andegress_proxypointed to a temporary internal AWS Network Load Balancer on port 3128. Squid and the mTLS origin each ran in a separate Fargate task. The origin allowed port 9444 only from Squid’s security group. FINsight chat, control plane, runner and mock model backend ran in local Docker Compose. The released ARM64 Companion used a disposable PKCS#11 identity on the desktop.sha256:e56403fd9129c777590cd4b01b2fd8f61b8ba2e9ca616be9ce190b88439357abGateway worker sandbox "filter": non-dumpable, Landlock ABI v2, seccomp allow-listcs-squid-2b865132dca28aand destinationflag-d8e577b74d5d6d.test:9444.TCP_TUNNEL/200 … CONNECT flag-d8e577b74d5d6d.test:94441487eca81c639cb32e501316726afe1bc5a97646e06e59abff8de4cb878e69aa, matching the identity provisioned on the desktop.COUNTERSIGN-FLAG, the rendered assistant reply and the independently generated site flag both hashed to693d4d2a1d8cf01c725d4e95027813081639398a534b7144feb7e4883d51e432.The Fargate run used the upstream qualification ACL scoped to the demo hostname, port and origin IP. It exercised the successful approval and the blocked direct route. The live FINsight registry-backed ACL was outside this run. The denial and proxy-outage cases have separate upstream Compose evidence. AWS confirmed deletion of the temporary qualification stack.
docs(docs): Operators can see that the egress proxy is qualified on F…