Skip to content

A maintainer can qualify the Gateway against a real Squid in the Compose demo #52

Description

@sodre

Parent

#49

What to build

A maintainer runs an opt-in variant of the Compose demo that puts a real Squid between the Gateway and the site, and its --verify mode proves the bytes took the proxied path. It is run by hand before a release, as the Compose demo is today; no workflow runs it. The default walkthrough stays as it is.

In the variant the Gateway shares a network with the Broker and Squid, and the site is on a network only Squid shares, so the Gateway has no direct route to the site. Squid allows CONNECT only to the site's hostname and port and does no TLS interception.

--verify drives the real Companion and browser as it does today, then correlates three observations from that one run: Squid's access log line for the CONNECT, the certificate fingerprint the site saw, and the response the Workload read.

The failure checks reuse the grant approved in that run, so they need no second approval. While the grant is live the launcher, in turn: swaps Squid's ACL to refuse the site and reloads it, restores the ACL and stops the site, then stops Squid. After each, the Workload repeats its request.

Running it needs Docker, the Companion and a desktop session or a virtual display.

Acceptance criteria

  • The demo launcher has an opt-in Squid variant, and the default walkthrough's services, networks and behaviour are unchanged
  • In the variant the Gateway shares a network with the Broker and Squid, and the site is on a network only Squid shares
  • Squid runs from an image pinned by digest, allows CONNECT only to the site's hostname and port, and does no TLS interception
  • From one --verify run, Squid's access log shows a successful CONNECT to the site's hostname and port, the fingerprint the site returned equals the one approved in the Companion, and the Workload read the site's response
  • With that grant live and Squid's ACL swapped to refuse the site and reloaded, the Workload's request fails with proxy_denied, and Squid's log shows the refusal
  • With that grant live, the ACL restored and the site stopped, the Workload's request fails with upstream_failure
  • With that grant live and Squid stopped, the Workload's request fails with proxy_unavailable
  • The operator guide's example Squid ACLs are taken from the configuration that passed: allow by hostname and port, block metadata, link-local and loopback addresses, and pin a private site to its prefixes
  • The developer guide says how to run the variant and names the Squid version it was qualified against
  • The output of a passing --verify run of the variant is recorded on this ticket

Decided in: #49 (spec); ADR 0003; the triage outcome on #46
Live step at merge: comment on #46 pointing the reporter at the documented Compose configuration, so they can repeat it on Fargate (whoever merges)

Activity

  1. added theissue type on Nov 22, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. sodre commented on Nov 22, 2026

    @sodre
    MemberAuthor

    A passing --verify run of the Compose demo's Squid variant, on 5d76a8b (#55's branch e2/49-egress-proxy), Linux arm64, Squid 6.14 from ubuntu/squid:6.6-24.04_edge@sha256:d9c34c5ab74c6dd41cf1070d9b4221aac072e67e983527ca2d41512958f77506:

    dbus-run-session -- xvfb-run -a .venv/bin/python examples/demo-integrator/compose_demo.py --squid --verify \
      --app "$PWD/packages/companion/dist/linux-arm64-unpacked/countersign-companion"

    Its check lines (the rest of its output is Compose and the virtual desktop session); it exited 0:

    Egress proxy: Squid Cache: Version 6.14
    Gateway egress proxy squid:3128 carries the address policy of destinations: demo-site
    The Gateway can neither resolve site.test nor connect to 172.31.0.2:9444 directly
    Compose mTLS accepted selected SHA-256 5d01b284300760487a791b19771d3274b11465b059ac6dba2c7ab5b236a808a1
    Squid tunneled the Workload's CONNECT: 1795337735.520 119 192.168.32.5 TCP_TUNNEL/200 2629 CONNECT site.test:9444 - HIER_DIRECT/172.31.0.2 -
    Job page matched the fingerprint the site received with the approval
    Squid refused the site: HTTP/1.1 502 Bad Gateway, Countersign-Error: proxy_denied, logged as 'Gateway CONNECT 741a07ec-5365-459c-a5d7-f207e525e743 proxy_denied'
    Squid logged the refusal: 1795337736.078 0 192.168.32.5 TCP_DENIED/403 3380 CONNECT site.test:9444 - HIER_NONE/- text/html
    Squid could not reach the stopped site: HTTP/1.1 502 Bad Gateway, Countersign-Error: upstream_failure, logged as 'Gateway CONNECT 57c598b3-23f1-48ce-8733-6989d3aead46 upstream_failure'
    Squid logged its 503: 1795337736.734 0 192.168.32.5 TCP_TUNNEL/503 0 CONNECT site.test:9444 - HIER_DIRECT/172.31.0.2 -
    With Squid stopped: HTTP/1.1 502 Bad Gateway, Countersign-Error: proxy_unavailable, logged as 'Gateway CONNECT d0b84a5e-0f3e-4c4b-8f89-5763810c9954 proxy_unavailable'
    exit=0
    

    An earlier run on 17525c6, before the review's fixes, passed the same checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions