Skip to content

feat(agent): retire the pre-#842 aether.source.spiffe_id filter-state key (#1165) - #1180

Merged
bpalermo merged 2 commits into
mainfrom
feat/1165-retire-legacy-source-key
Oct 4, 2026
Merged

bpalermo merged 2 commits into
mainfrom
feat/1165-retire-legacy-source-key

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 4, 2026

Copy link
Copy Markdown
Owner

What

Stops stamping the pre-#842 source-identity filter-state key aether.source.spiffe_id on every mesh-originating chain (outbound HTTP, capture HCM, TCP floor / per-port / TCPRoute / TLSRoute / blackhole chains). The only identity stamp is now envoy.tls.certificate_mappers.on_demand_secret, the hashable key the #842 certificate mapper and the upstream pool hash already read. The netns key stays, because source_netns still reads it.

The old key had two readers in the agent. Both now read the current key:

  • Access log source_spiffe_id (HTTP aether_access_logs and L4 aether_l4_access_logs): it now reads %FILTER_STATE(envoy.tls.certificate_mappers.on_demand_secret:PLAIN)%. The attribute name is unchanged, which follows the plan written into networkfilter.go in Make the source-identity filter state Hashable so the mesh can drop connection_pool_per_downstream_connection #842 ("the attribute NAME stays"). There was never a second, current-key attribute to keep, so the one that existed was repointed. HashableString is a Router::StringAccessorImpl subclass (set_filter_state/filter_config.cc), so :PLAIN renders it.
  • QUIC selection matcher (proposal 038, ApplyQUICClusterSelection): it had a single FilterStateInput on the old key. That input now reads the current key. As a side benefit, the arm a request takes and the client certificate it presents now come from one value.

Why

#842 (chart 0.93.0, 2026-09-20) kept the old key for one release, only so that a rollback to a pre-#842 cluster (whose transport_socket_matcher read it) stayed hitless. That window has passed. Maintainer decision 2026-10-04: retire it.

Red, then green

test/envoy_validate gains ListenersNamingRetiredSourceKey. It searches each listener's whole protojson rendering for the retired name, so the stamp, the access-log reader and the matcher input are all covered by one check, along with any reader added later. TestEnvoyValidate runs it on every fixture and fails if no listeners were decoded.

  • Red: with one aether.source.spiffe_id stamp left in BuildSourceFilterStates, the check failed on 7 fixtures (node_bootstrap, node_cleartext_bootstrap, node_uds_bootstrap, capture_bootstrap, capture_tcproute_bootstrap, capture_tlsroute_bootstrap, quic_outbound_bootstrap). Each failure named the offending listener (outbound_http_test-pod, capture_test-pod, quic_out_source_a).
  • Green: with the stamp removed, the check passes on every fixture.
  • Anti-vacuity: TestListenersNamingRetiredSourceKeySeesThroughAny hand-builds one listener that carries the key one Any deep and one clean listener. It asserts that only the first is reported.

Proxy unit tests now pin the two-entry shape and the absence of the retired key. The matcher input key is asserted directly in TestApplyQUICClusterSelection.

Consumer audit (outside Go)

Location Reference Action
docs/runbook.md: #815 version-ordering section old key, plus "rollback below 0.92.28 is safe" updated; the rollback safety now ends at #1165
docs/runbook.md: new "Rollback floor: chart 0.93.0 (issue #1165)" n/a added (upgrade note)
docs/runbook.md: east-west QUIC "What to expect" the matcher is keyed on the old key updated
docs/runbook.md: #815 cluster re-warm section old key updated
docs/runbook.md: #842 replacement-signal item 2 and the #842 Rollback section dual-stamp and "retire later" text updated
docs/proposals/038_udp-tproxy-capture.md §Selection old key updated
docs/proposals/014_* no reference to either name none needed
docs/configuration.md no reference none needed
e2e/soak/README.md (LogsQL extract_regexp ... from source_spiffe_id) attribute name only unchanged (the name is stable)
e2e/*.sh, k6 scripts, charts/ no reference none

GitOps (k8s-talos-main, grepped read-only): there are no Grafana dashboard JSON references to either name. source_spiffe_id (the attribute name, not the key) appears in clusters/talos-main/otel-collector/values.yaml (the transform condition attributes["source_spiffe_id"] == "-" and comments) and in clusters/talos-main/prometheus/{values,rules_test}.yaml (alert descriptions using source_spiffe_id:="-"). Because the attribute name and its value are unchanged, nothing there needs editing.

Rollback note (data-plane change)

After this ships, rolling back to a chart older than 0.93.0 (the chart that shipped #842 on 2026-09-20) is no longer hitless. A node proxy running the new listeners that is handed pre-0.93.0 clusters matches nothing and falls to on_no_match, which is the agent's own SVID (#825). Pod egress then presents the wrong identity until the old listeners land. In practice use 0.93.1 as the floor, since 0.93.0 carried the SDS-dedup stall that #865 fixed. To go lower, step through a 0.93.x/0.94.x chart first. The details are in docs/runbook.md, "Rollback floor: chart 0.93.0".

Rolling forward re-keys every mesh-originating filter chain (one fewer set_filter_state entry) and every QUIC-selecting route, so those chains drain once on --drain-time-s.

charts/ is untouched, so the chart version is not bumped.

Tests

  • bazel test --config=race //agent/internal/xds/... //test/envoy_validate/... //test/mtlspool/...: all 10 targets pass. That includes //test/mtlspool, whose quic_odcds_test drives the QUIC selection matcher at runtime with BuildSourceFilterStates.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: clean.
  • make format-check: clean. make gazelle: run.

Fixes #1165

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 2 commits October 3, 2026 22:51
… key (#1165)

Every mesh-originating chain stamped the source SPIFFE ID twice: under
envoy.tls.certificate_mappers.on_demand_secret (hashable, what the #842
certificate mapper and the pool hash read) and under the old
aether.source.spiffe_id, kept for one release so a rollback to a pre-#842
cluster stayed hitless. That window closed with 0.93.0 (2026-09-20).

- BuildSourceFilterStates now emits netns + the cert-mapper key only.
- The access log's source_spiffe_id attribute (HTTP and L4) reads the
  cert-mapper key; the attribute NAME is unchanged, so VictoriaLogs queries,
  alert rules and the collector transform keep working as-is.
- The proposal 038 QUIC selection matcher's FilterStateInput reads the
  cert-mapper key, so the arm and the presented certificate come from one value.
- envoy_validate: ListenersNamingRetiredSourceKey asserts no listener in any
  fixture names the retired key (stamp, log or matcher); seen red on 7 fixtures
  with one stamp left in place, plus an anti-vacuity test through Any.
- runbook: new "Rollback floor: chart 0.93.0" upgrade note; #815/#842/QUIC
  sections and proposal 038 updated.

Rolling back to a chart < 0.93.0 is no longer hitless after this ships.

Fixes #1165

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit c75a273 into main Oct 4, 2026
24 checks passed
@bpalermo
bpalermo deleted the feat/1165-retire-legacy-source-key branch October 4, 2026 02:04
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.

proxy/agent: retire the pre-#842 aether.source.spiffe_id filter-state key — the "one release" dual-key window closed on 2026-09-20

1 participant