Skip to content

feat(038): east-west QUIC outbound — per-source quic: clusters selected by the source identity (Phase 4b) - #956

Merged
bpalermo merged 2 commits into
mainfrom
feat/quic-pr7-outbound
Sep 26, 2026
Merged

bpalermo merged 2 commits into
mainfrom
feat/quic-pr7-outbound

Conversation

@bpalermo

@bpalermo bpalermo commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Phase 4b of proposal 038 (after #953's inbound). Opt-in per destination: --east-west-quic-services / agent.eastWestQuicServices (default none). Chart → 0.95.0.

What

  • One quic:<svc>.<domain>@<ns>/<sa> cluster per (allow-listed destination × local ServiceAccount) — a clone of the h2 entry (same EDS resource, subsets, outlier detection; no second load assignment), HTTP/3 protocol options, QuicUpstreamTransport naming that SA's SVID statically, destination SAN pin, <port>.<authority> SNI (see the 038 Phase 4b blocker: Envoy's QUIC client requires the server leaf's DNS SAN to match the SNI hostname — SVIDs have only URI SANs, the mesh's SNI is the port #957 section), h3 ALPN, MaxSessionKeys: 0 (R4 client side). The identity has to be the cluster's own: QuicClientTransportSocketFactory rejects a certificate selector. The fan-out (local SAs × listed services) is logged whenever it changes.
  • Selection: a route-level matcher cluster specifier (envoy.router.cluster_specifier_plugin.matcher) keyed on the envoy.matching.inputs.filter_state input for aether.source.spiffe_id — the plain-string stamp every mesh-originating chain already carries. Arms: local identity → its twin; on_no_match → the h2 cluster (byte-identical to before). No header, no new filter-state key. The plan's request_headers_to_add + cluster_header cannot work: route header mutations apply after matching, cluster_header is read at matching. Both the plugin and the HTTP filter-state input are registered and compiled in at the 726d7ac pin.
  • Applied on both route tables (out_http and cap_http) with one predicate, so a route can never name a twin the snapshot doesn't carry. GAMMA weighted routes untouched (GAMMA destinations stay h2 in this cut). A listed service is forced into the dependency set. Only the service's default entry gets twins, and only once the node identity is served.
  • test/envoy_validate: a new quic_outbound_bootstrap.json — source listener with the identity stamp, inline route with the selection plugin, the h2 cluster and two twins. envoy --mode validate on the pinned proxy accepts it, which proves the plugin loads, the HTTP filter-state input resolves, and a QUIC upstream with explicit HTTP/3 options is accepted on an EDS cluster. upstreamTLSPinned now unwraps QuicUpstreamTransport (an unpinned quic: cluster passed vacuously before); QUICUpstreamsWithSessionCache asserted over every fixture.

Gates, each seen red

gate red state
TestQUICClusterFrom + fixture R4 check MaxSessionKeys dropped → "R4 client side: MaxSessionKeys must be EXPLICIT" / "QUIC upstream clusters without explicit max_session_keys:0"
TestUnpinnedMeshClustersSeesThroughQUIC QUIC unwrap removed → "the QUIC unwrap is vacuous"
TestQUICFanoutPublishesPerSourceTwins cap_http application removed → "the echo vhost on BOTH out_http and cap_http must carry the selection plugin"
TestQUICUpstreamSNIIsAHostname (envoy_validate) + TestQUICServerName / TestQUICClusterFrom / TestNewInboundQUICListener / the fan-out test's SNI assert QUICServerName returning the bare port → all five red

#957 workaround (path B) — cf1c18f

The mtlspool HTTP/3 arm found that Envoy's QUIC client verifies the leaf against the SNI as a DNS hostname after any validator succeeds (envoy_quic_proof_verifier.cc); only accept_untrusted skips it, so the h2 path's bare-port SNI failed every mTLS HTTP/3 handshake with a fully verified peer (#957). The upstream fix (skip the hostname check when an explicit identity check is configured) is in flight; this PR ships the workaround:

  • SNI = <port>.<svc>.<ns>.<meshDomain> (proxy.QUICServerName) on every quic: twin, and the same string is the server_names the HTTP/3 inbound matches per non-primary port (the primary port's name lands on the default chain, like an h2 primary-port client). QUIC chains are now named by port. NewInboundQUICListener takes meshDomain.
  • Workload SVIDs carry two DNS SANs — <sa>.<ns>.<meshDomain> and *.<sa>.<ns>.<meshDomain> — via dnsNameTemplates on the workloads' ClusterSPIFFEID (the three e2e scripts; talos via spire-server.controllerManager.identities.clusterSPIFFEIDs.default.dnsNameTemplates in GitOps, after the soak grade). Mesh Service names are ServiceAccount names, so the template can name the authority. Identity stays the URI-SAN pin; the DNS SANs only satisfy the QUIC client's check. 038 Q5, docs/getting-started.md and the chart value record the prerequisite.
  • Proven end to end in the PR 7b harness: leaf DNS SANs echo.demo.svc + *.echo.demo.svc, SNI 18008.echo.demo.svc → both sources verified over HTTP/3.0, and the swapped-arms negative control shows the swap.

Local: proxy/config/envoy_validate race-clean, lint clean, deps-audit OK, chart tests green. The only local failures are the pre-existing TestObservedUpstreamsStore_* timing tests — 6/6 red on main here, green in CI — filed as #955 and untouched.

Not in this PR

PR 7b: the //test/mtlspool HTTP/3 selection arm (quic-go server with RequireAndVerifyClientCert; negative control = one arm pointed at the other source's twin, destination sees the wrong SAN). PR 8: kind e2e. PR 9: talos with aether-test allow-listed + soak. Nothing deploys until the running rev239 soak is graded.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…ed by the source identity

Phase 4b of proposal 038, R2/R4, opt-in per destination via
--east-west-quic-services (chart: agent.eastWestQuicServices; default none).

For each allow-listed destination and each LOCAL ServiceAccount the node gets
a cluster "quic:<svc>.<domain>@<ns>/<sa>" -- a clone of the h2 entry (same EDS
resource, subsets, outlier detection; no second load assignment), HTTP/3
protocol options, and a QuicUpstreamTransport that names that SA's SVID
statically, pins the destination SAN, carries the port SNI, offers h3 only and
sets MaxSessionKeys: 0. The identity has to be the cluster's own because
QuicClientTransportSocketFactory rejects a certificate selector; the per-SA
fan-out is the price, and the agent logs it ("east-west QUIC fan-out") whenever
it changes.

Selection is a route-level matcher cluster specifier
(envoy.router.cluster_specifier_plugin.matcher) keyed on the
envoy.matching.inputs.filter_state input for aether.source.spiffe_id -- the
plain-string stamp every mesh-originating chain already carries. One arm per
local identity -> its twin; on_no_match -> the h2 cluster, byte-identical to
before. No header, no new filter-state key: the plan's request_headers_to_add
+ cluster_header cannot work (route header mutations apply AFTER matching;
cluster_header is read AT matching), and both the plugin and the HTTP
filter-state input are present and compiled in at the 726d7ac pin. Applied on
BOTH route tables (out_http from the entry vhost, cap_http in the capture
vhost builder) with one predicate, so no route can name a twin the snapshot
does not carry. GAMMA (weighted) routes are untouched: GAMMA-routed
destinations stay h2 in this cut. A listed service is forced into the
dependency set. Twins are built only for the service's DEFAULT entry
(per-port and alias entries would multiply the fan-out) and only once the node
identity is served.

  config/http.go         Http3ProtocolOptions()
  proxy/egress.go        QUICClusterName, SourceSAKeyFromSpiffeID, QUICClusterFrom
  proxy/transportsocket  QUICUpstreamTransportSocket
  proxy/route.go         ApplyQUICClusterSelection, QUICSelectionArms
  cache                  SetEastWestQUICServices (depMu, forced membership),
                         quicFanout/twinsFor/entryTwinsAndVhost, cap_http arms
  cmd/root.go, chart     --east-west-quic-services, agent.eastWestQuicServices,
                         chart 0.94.1 -> 0.95.0
  test/envoy_validate    QUICOutboundBootstrapJSON: source listener with the
                         identity stamp, inline route with the selection
                         plugin, the h2 cluster and two twins; upstreamTLSPinned
                         UNWRAPS QuicUpstreamTransport; QUICUpstreamsWithSessionCache
                         (R4 client side) asserted over every fixture; anti-vacuity.

`envoy --mode validate` on the pinned proxy ACCEPTS the fixture: the plugin
loads, the HTTP filter-state input resolves, the QUIC upstream with explicit
HTTP/3 options is accepted on an EDS cluster.

Gates, each seen red: TestQUICClusterFrom + the fixture's R4 check with
MaxSessionKeys dropped; TestUnpinnedMeshClustersSeesThroughQUIC with the unwrap
removed ("the QUIC unwrap is vacuous"); TestQUICFanoutPublishesPerSourceTwins
with the cap_http application removed ("the echo vhost on BOTH out_http and
cap_http must carry the selection plugin").

Not here: the //test/mtlspool HTTP/3 selection arm (quic-go server, negative
control on the arm map) and the e2e -- PR 7b/8. Pre-existing local flake
TestObservedUpstreamsStore_* filed as #955 (fails 6/6 on main locally, passes
in CI); untouched.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…Ns (aether#957 workaround)

Envoy's QUIC client verifies the leaf against the SNI as a DNS hostname AFTER
any configured validator succeeds (envoy_quic_proof_verifier.cc); only
accept_untrusted skips it. The h2 path's bare-port SNI matched no DNS SAN, so
every mTLS HTTP/3 handshake failed with a verified peer (#957). The upstream
fix is in flight; this is the workaround the phase ships:

- proxy.QUICServerName(port, authority) = "<port>.<svc>.<ns>.<meshDomain>" is
  the SNI every quic: twin presents (cache twinsFor) and the server_names the
  HTTP/3 inbound matches per non-primary port; the primary port's name lands
  on the default chain. QUIC chains are now named by port, not by SNI.
  NewInboundQUICListener takes meshDomain.
- The e2e workloads' ClusterSPIFFEID issues "<sa>.<ns>.<mesh>" and
  "*.<sa>.<ns>.<mesh>" DNS SANs (dnsNameTemplates) -- identity stays the URI
  SAN pin; the DNS SANs only satisfy the QUIC client's check.
- Gates seen red with QUICServerName returning the bare port:
  TestQUICServerName, TestQUICClusterFrom, TestNewInboundQUICListener,
  TestQUICFanoutPublishesPerSourceTwins, and envoy_validate's new
  TestQUICUpstreamSNIIsAHostname (QUICUpstreamsWithPortSNI).
- 038 Q5, getting-started and the chart value document the prerequisite.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo marked this pull request as ready for review September 26, 2026 18:50
@bpalermo
bpalermo merged commit 534664e into main Sep 26, 2026
24 checks passed
@bpalermo
bpalermo deleted the feat/quic-pr7-outbound branch September 26, 2026 18:59
bpalermo added a commit that referenced this pull request Sep 26, 2026
…IC; only weighted splits stay h2 (#961) (#964)

ApplyQUICClusterSelection reaches every route on the vhost whose action
names the h2 cluster: the default route and a GAMMA rule whose single
backendRef is the parent Service (it renders as the same `cluster:` action).
That rule rides QUIC with the caller's own twin exactly like the default
route; nothing is lost. What stays h2 is a WeightedClusters action -- the
matcher plugin's action names ONE cluster, so a per-source weighted split has
no representation. #956 said "GAMMA stays h2"; this makes the statement
exact instead of narrowing the feature.

- route.go: the doc says which routes are reached and why the weighted shape
  is a representation limit, not a policy.
- TestApplyQUICClusterSelection: a single-backend rule to the parent IS
  selected; a single-cluster rule to another service is left alone.
- e2e/eastwest-quic.sh: E4b applies a single-backendRef HTTPRoute (with a
  request-header filter so its liveness is observable on the data, since the
  backend is the parent itself) and asserts it rides each caller's own twin
  over HTTP/3; E4's weighted case unchanged.

Closes #961.


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Fable 5.1 <[email protected]>
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