Skip to content

fix(spire): name validation-context secret with SPIFFE URI - #70

Merged
bpalermo merged 1 commit into
mainfrom
fix/sds-validation-context-name
Jun 7, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/sds-validation-context-name

Conversation

@bpalermo

@bpalermo bpalermo commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Problem

Inbound mTLS never completes: the validation-context SDS secret stays stuck warming in Envoy.

BundleToValidationContextSecret named the Envoy validation-context secret with the bare trust domain (e.g. ROOTCA, the map key from SPIRE's SubscribeToX509Bundles response). But:

  • Inbound listeners request the validation context by its SPIFFE URI: fmt.Sprintf("spiffe://%s", trustDomain) → spiffe://ROOTCA.
  • SVID certificate secrets already use the URI form (spiffe://<trustDomain>/ns/<ns>/sa/<sa>).

So Envoy asks for spiffe://ROOTCA, the cache only has ROOTCA, and the secret never resolves. The function's own doc comment even says the name should be spiffe://example.org — the code didn't match it.

Evidence

On a live cluster, the agent-proxy config_dump showed dynamic_active_secrets: 0 with both the validation context (spiffe://ROOTCA) and the workload cert in dynamic_warming_secrets.

Fix

Name the validation-context secret spiffe://<trustDomain>, matching the listener reference and the SVID naming convention. The bridge already passes the bare trust domain, so only the converter changes. Tests updated.

bazel test //agent/internal/spire:spire_test passes.

Note

This fixes the validation context half of inbound SDS. The workload SVID half is still blocked separately by the agent skipping the delegated-identity subscription when the CNI doesn't supply a container PID (skipping SVID subscription: PID not available) — tracked in a follow-up.

BundleToValidationContextSecret named the Envoy validation-context secret with
the bare trust domain (e.g. "ROOTCA", the key from the SPIRE bundle response),
but inbound listeners request the validation context by its SPIFFE URI
("spiffe://ROOTCA") and SVID certificate secrets already use the URI form
("spiffe://<trustDomain>/..."). The name therefore never matched, leaving the
inbound mTLS validation context stuck "warming" in Envoy (confirmed via the
proxy's config_dump: dynamic_active_secrets=0 with the validation context in
dynamic_warming_secrets).

Name the secret "spiffe://<trustDomain>" to match the listener reference and the
SVID naming convention (and the function's own doc comment).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@bpalermo
bpalermo merged commit 30e3846 into main Jun 7, 2026
9 of 10 checks passed
@bpalermo
bpalermo deleted the fix/sds-validation-context-name branch June 7, 2026 13:48
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