Skip to content

An operator can send a Gateway's destinations through an egress proxy #50

Description

@sodre

Parent

#49

What to build

An operator whose network gives the Gateway no direct route sets egress_proxy in the Gateway configuration, and a Workload reads a protected site through that proxy, in sidecar and shared mode.

With egress_proxy set, every destination goes through the egress proxy unless its rule says "egress": "direct". On a proxied route the supervisor resolves the proxy's host on every connection, sends a plain-text CONNECT with the site's canonical name and port, and resolves nothing for the site. On a 2xx answer the tunnel takes the place the direct connection has today. The grant worker, the worker sandbox, admission, the leases and the certificate check are untouched. The Gateway reads the egress proxy only from its configuration, never from a proxy environment variable.

A configuration that would claim a check nobody performs does not load: private_networks on a proxied rule, an https proxy URL, or a proxy URL with credentials.

Until the next ticket, any failure of the proxied leg returns today's 502 with upstream_failure. The Gateway never tries a proxied destination directly.

The runtime test gains a small test-only CONNECT proxy that records each request line. ADR 0003 is on main as proposed, with the glossary entry for egress proxy (#53). This ticket's pull request changes the ADR's status to accepted.

Acceptance criteria

  • The Gateway configuration accepts an optional top-level egress_proxy, a URL with the http scheme, a host and a port
  • Loading fails on an https egress proxy URL and on one that carries credentials, and each error names the cause
  • A destination rule accepts an optional egress whose only value is "direct", and any other value fails loading
  • Loading fails when a rule has private_networks and goes through the egress proxy, and the error names the rule and both fixes
  • env and serve refuse the same configurations
  • A configuration without egress_proxy loads and behaves as before, and "egress": "direct" on its rules changes nothing
  • With egress_proxy set, the runtime test's Workload reads the site's response through the test-only proxy, in sidecar and shared mode, and the site saw the approved client certificate
  • The proxy's recorded request names the site's hostname and port, in a run where the Gateway cannot resolve that name itself
  • One Gateway serves a proxied destination and a direct one with private_networks, and each takes its own route
  • A retired grant cuts a proxied connection as it cuts a direct one
  • With proxy environment variables set in the Gateway's environment and no egress_proxy, a destination is still reached directly
  • Startup logs the egress proxy's host and port and the rule IDs of the destinations that leave their address policy to it
  • The runtime test runs these cases wherever it runs today, under both worker sandboxes
  • ADR 0003 is accepted and the glossary defines egress proxy
  • The configuration reference describes egress_proxy and egress
  • The operator guide has a section on reaching sites through an egress proxy that says where name resolution and address policy happen on each route, and what the proxy's ACLs must now block
  • The architecture page's trust boundaries name the egress proxy, and the design record's resolution paragraph names both routes

Decided in: #49 (spec); ADR 0003; the triage outcome on #46
Live step at merge: none

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions