Skip to content

fix(proxy): TCP floor transport_socket_match name must be the bare SPIFFE ID - #298

Merged
bpalermo merged 1 commit into
mainfrom
fix/tcp-floor-transport-socket-match
Jun 24, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/tcp-floor-transport-socket-match

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

First real TCP-floor e2e (HTTP echo registered appProtocol=tcp, raw mTLS passthrough) reset on the upstream. Root cause: tcp:<svc> named its transport_socket_matches <spiffe-id>:tcp, but the shared UpstreamTransportSocketMatcher selects by the bare SPIFFE ID → no match → default socket → no aether-tcp ALPN → inbound floor chain (ALPN match) doesn't match → reset. The :tcp suffix was unnecessary (matches are per-cluster; <svc> vs tcp:<svc> don't collide). Drop it. Validated: echo-tcp.aether.internal:18081 → 200 (was reset).

…IFFE ID

The first real TCP-floor e2e (an HTTP echo workload registered appProtocol=tcp,
exercised as a raw mTLS passthrough) reset on the upstream. Root cause: the TCP
floor cluster (tcp:<svc>) named its transport_socket_matches "<spiffe-id>:tcp", but
the shared UpstreamTransportSocketMatcher selects the match by the source pod's BARE
SPIFFE ID (egress.go uses the same matcher for HTTP and TCP clusters). So the matcher
asked for "<spiffe-id>", the cluster only had "<spiffe-id>:tcp" → no match → Envoy
fell back to the default transport socket → no "aether-tcp" ALPN → the inbound :15008
floor chain (which matches application_protocols:["aether-tcp"]) didn't match, the
connection hit an HCM chain expecting a different handshake, and reset.

The ":tcp" suffix was an unnecessary "keep distinct" guard — transport_socket_matches
are scoped per cluster, and the HTTP <svc> and TCP tcp:<svc> clusters are distinct, so
the bare-ID names never collide. Drop the suffix so the existing matcher selects them.

Validated on talos: curl echo-tcp.aether.internal:18081 (HTTP over the TCP-mTLS floor)
-> 200 after the fix (was a connection reset).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
@bpalermo
bpalermo merged commit 5a5774c into main Jun 24, 2026
9 checks passed
@bpalermo
bpalermo deleted the fix/tcp-floor-transport-socket-match branch June 24, 2026 13:01
bpalermo added a commit that referenced this pull request Jun 24, 2026
…sport path (#304)

The bespoke "aether-tcp" ALPN forced a duplicated TCP-specific transport-socket
stack (UpstreamTCPTransportSocket, the :tcp matches/OnNoMatch) parallel to the proven
HTTP one — and all three earlier floor fixes (#298/#299/#301) lived in that copy,
yet the upstream mTLS still never connected (upstream_cx_total=0).

Collapse the demux onto the standard h2 ALPN instead:
- Egress: UpstreamTCPTransportSocket now advertises NO ALPN (HTTP keeps "h2"); it
  otherwise reuses the same per-source matcher/matches machinery that already works.
- Inbound :15008: the no-SNI HCM chain matches application_protocols:["h2"]; per-port
  HCM chains keep their port SNI; the TCP floor becomes the listener's DEFAULT chain
  (no match). Envoy precedence (server_names > application_protocols > default) routes
  h2+SNI → per-port, h2 → default-HCM, no-ALPN mTLS → the floor — no bespoke token.
- Removed the AetherTCPALPN constant.

This deletes the duplicated TCP transport stack that harbored the per-source-cert
selection bug, so the floor rides the validated HTTP per-source mTLS path. Validate
on talos: echo-tcp.aether.internal:18081 (HTTP over the mTLS TCP floor) -> 200.


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

Co-authored-by: Claude Opus 4.8 <[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