Repository navigation
Description
The inboundready_<pod> readiness-probe cluster shares a client-side TLS session cache with mesh application traffic on the same node proxy. A health check therefore deposits a session — and with it a peer certificate — into a cache that serves application requests.
That is a boundary violation on its own terms, independent of the defect it happened to cause.
Why this is separate from #834
#829's fix (#834) sets max_session_keys: 0 on every upstream builder, which removes the slot everywhere. That is correct and should land. But the two changes have different lifetimes:
- fix(agent): disable upstream TLS session resumption — a resumed session carries the wrong peer identity (#829) #834 is a fix. It also forecloses upstream session resumption as a future option for mesh traffic, and it silently reopens this class the moment anyone re-enables resumption for a good reason.
- This is a boundary that should have existed anyway. A readiness probe's TLS state has no business being reachable by application traffic, regardless of whether resumption is on.
What the probe actually is
agent/internal/xds/proxy/cluster.go:492:
TransportSocket: UpstreamTransportSocket(nodeSpiffeID, validationContextName, []string{podSpiffeID}, "" /* no SNI: the no-SNI h2 chain */),It dials each local pod's inbound listener inside that pod's netns, on a 5 s health-check interval. Its peer is therefore always a pod on this node, presenting that pod's SVID. In #829 that is exactly what leaked: the probe's session carried a local pod's certificate, and every mesh cluster that then resumed from the shared slot was handed it. The observed "the leaked identity is always a source-node neighbour" rule is a direct consequence of what this cluster talks to.
Proposed fix
Give the probe its own TLS context so its session state cannot reach mesh clusters, or simply never resume on it — max_session_keys: 0 scoped to this cluster specifically, which is correct permanently and not merely while #834 stands. A health check gains nothing from resumption: it runs every 5 s against a fixed local peer and its cost is irrelevant.
Worth stating the invariant in the code comment, in the style of the existing one above it: nothing this cluster does may be observable by application traffic.
An open question this raises, flagged rather than resolved
The probe's SNI is empty; mesh clusters carry a port number ("8080"). If the upstream session cache is scoped by SNI — which envoy#45982 does, and its runtime guard scope_upstream_tls_session_cache_by_sni defaults on — then the probe and the mesh clusters would fall in different cache scopes, and the sharing observed in #829 should not have been possible.
The empirical evidence in #829 is nonetheless strong: on w04 the leaked identity's own mesh cluster had no session-reuse series at all, while inboundready_svc-4-…-stg4m existed and reset with the epoch, leaving no other route for that certificate into the cache.
So one step in the chain is not yet pinned: either the guard is not in effect on the pinned build, or the cache key for an empty SNI collapses together with something else, or the sharing happens at a level other than the SNI-scoped cache. This does not change the observation or either fix, but it should be resolved before the mechanism is written up as settled — and it is directly checkable by flipping the guard.
Activity
bpalermo commentedon Sep 20, 2026
The open question narrows to two branches, and this fix survives both
Three legs now hold, so SNI scoping is active on the running build:
423e157c63, dated 2026-07-25; our pin is the 2026-09-04 snapshot1.40.0-dev.20260904.13144fb.envoy. The commit is in the build by date.scope_upstream_tls_session_cache_by_snidefaults on.envoy_runtime_num_keys = 0andenvoy_runtime_num_layers = 0— no runtime layer is loaded at all, so nothing overrode it via config, an xDS runtime layer, or an admin override.So the branch "the guard is not in effect" is eliminated. That sharpens the tension rather than dissolving it: the probe's SNI is empty and mesh clusters' is
"8080", so an active SNI-scoped cache should have partitioned them — yet the #829 evidence shows a probe-sourced certificate reaching mesh clusters, with no other route available on w04.Two branches remain: an empty-SNI cache key collapsing together with something else, or the sharing happening at a level the SNI key does not partition.
The casualty is the "inverted envoy#45982" reading, not the mechanism. Earlier analysis on #829 argued that scoping by a constant port collapses every cluster into one node-wide slot. If the SNI key genuinely partitions and the sharing still happened, that story cannot be the explanation — a probe with a different key would have been excluded from the collapse. The empirical chain stands; the tidy account of why does not.
This makes the present issue the more important of the two fixes, not the lesser. #834 removes the slot given a particular model of how the cache is keyed. This one establishes a boundary that holds regardless of how the cache is keyed — which matters precisely because we have just demonstrated that our model of the keying is wrong in some respect we cannot yet name.
Checkable by flipping the guard; neither fix depends on the answer.
fix(agent): give the readiness probe its own TLS context, and make an…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…
feat(agent): select the upstream client certificate per connection, a…