Skip to content

feat(agent): log the verified mTLS peer identity, and validate the access log against a real Envoy (#824) - #827

Merged
bpalermo merged 1 commit into
mainfrom
feat/824-peer-identity-access-log
Sep 19, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/824-peer-identity-access-log

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Closes #824.

Every identity field in an access-log line was something the control plane baked
into the emitting pod's own config, so a line could say who it THINKS it is but
never who the other end actually proved to be. Validating #815 release two needed
exactly that — "did any workload's traffic arrive as the node agent's identity?" —
and the answer had to be inferred from a match counter and from OPA's view of the
source's own claim.

Each hop now logs the one peer it verified:

Split by reporter because each side has exactly one interesting peer and the
other operator renders "-" on every line. Both render "-" when the hop is not
mTLS, so SPIRE-off output is unchanged apart from one extra "-" field.
Cardinality is bounded by the number of ServiceAccounts.

Also closes a hole in the validation gate that this change walked straight into:
//test/envoy_validate never enabled access logging, so the entire access-log
config — ~30 substitution operators, the DYNAMIC_METADATA and FILTER_STATE specs,
the filter tree — had never been through a real Envoy config loader. The node
bootstrap now carries it (plus the otel_collector cluster the logger names).
Verified non-vacuous: replacing an operator with a bogus one fails the gate with
error initializing configuration, and both new operators pass against the
pinned 1.40.0-dev binary.

Why now

Validating #815 release two, the destination-side check the plan called for could not be run at all — this is the instrument that was missing. It also answers the #638 question from the client side.

Verification

//agent/internal/xds/... //agent/internal/cni/server:all //test/envoy_validate:all //website:all green (10 targets); lint clean. The Envoy gate was proved non-vacuous by injecting %NOT_A_REAL_OPERATOR_XYZ% and watching it fail, then restoring. Generated node bootstrap carries 2 downstream operators (the two inbound HCMs) and 1 upstream (outbound).

No chart change. Refs #815, #638.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…cess log against a real Envoy (#824)

Every identity field in an access-log line was something the control plane baked
into the emitting pod's own config, so a line could say who it THINKS it is but
never who the other end actually proved to be. Validating #815 release two needed
exactly that — "did any workload's traffic arrive as the node agent's identity?" —
and the answer had to be inferred from a match counter and from OPA's view of the
source's own claim.

Each hop now logs the one peer it verified:
- reporter=destination (the per-pod inbound listener): `downstream_peer_uri_san`
  = %DOWNSTREAM_PEER_URI_SAN%, the CALLER's SPIFFE ID as validated against the
  mesh trust bundle.
- reporter=source (outbound_http, capture_http): `upstream_peer_uri_san` =
  %UPSTREAM_PEER_URI_SAN%, the server certificate the destination proxy
  presented — the client-side view of the #638 cross-wiring, which today only
  shows up as envoy_cluster_ssl_fail_verify_san telling you SOME peer failed.

Split by reporter because each side has exactly one interesting peer and the
other operator renders "-" on every line. Both render "-" when the hop is not
mTLS, so SPIRE-off output is unchanged apart from one extra "-" field.
Cardinality is bounded by the number of ServiceAccounts.

Also closes a hole in the validation gate that this change walked straight into:
//test/envoy_validate never enabled access logging, so the entire access-log
config — ~30 substitution operators, the DYNAMIC_METADATA and FILTER_STATE specs,
the filter tree — had never been through a real Envoy config loader. The node
bootstrap now carries it (plus the otel_collector cluster the logger names).
Verified non-vacuous: replacing an operator with a bogus one fails the gate with
`error initializing configuration`, and both new operators pass against the
pinned 1.40.0-dev binary.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit fa69497 into main Sep 19, 2026
20 checks passed
@bpalermo
bpalermo deleted the feat/824-peer-identity-access-log branch September 19, 2026 22:00
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.

access logs carry no verified peer identity, so 'which client identity did the destination see' cannot be answered

1 participant