Skip to content

fix(agent): derive SDS trust domain from SPIRE, not the auth sentinel - #76

Merged
bpalermo merged 1 commit into
mainfrom
fix/agent-derive-trust-domain
Jun 7, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/agent-derive-trust-domain

Conversation

@bpalermo

@bpalermo bpalermo commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Problem

--spire-trust-domain was overloaded: it set both peer authorization (where the RootCATrustDomain = ROOTCA sentinel means "authorize any valid SVID") and the trust domain used to construct SPIFFE IDs / SDS resource names for Envoy listeners (SpiffeIDFromPod, validation context spiffe://<td>).

With the sentinel default, the agent named SDS secrets spiffe://ROOTCA/... while SPIRE — and the SPIRE bridge — issue spiffe://<real-td>/... (on talos-main, aether.internal). Envoy's SDS requests never matched the delivered secrets, so both the SVID and the validation context stayed warming and inbound mTLS failed (upstream 503 connection termination).

Confirmed on talos-main: SPIRE issues spiffe://aether.internal/ns/aether-test/sa/echo; the agent requested spiffe://ROOTCA/....

Fix

Resolve the real workload trust domain from the SPIRE Workload API SVID at startup (TrustDomainFromSource) and use it for listener SDS naming (xDS + CNI servers). --spire-trust-domain now governs only peer authorization, as documented, and may remain the RootCATrustDomain sentinel. The Workload API source is opened once in runAgent and shared with the registrar client instead of being created per consumer.

Note

This fixes the SDS name mismatch. Full inbound mTLS additionally depends on SPIRE issuing the workload SVID over the delegated API, which currently times out attesting the sandbox PID (separate issue — resolving the app-container PID rather than the pause PID).

The agent used --spire-trust-domain for two unrelated things: peer authorization
(where the RootCATrustDomain "ROOTCA" sentinel means "authorize any") and
constructing SPIFFE IDs / SDS resource names for Envoy listeners. With the
sentinel default, the agent named secrets spiffe://ROOTCA/... while SPIRE (and
the SPIRE bridge) issue spiffe://<real-td>/... (e.g. aether.internal), so Envoy's
SDS requests never matched the delivered secrets and inbound mTLS never came up
(secrets stuck warming, upstream 503).

Resolve the real workload trust domain from the SPIRE Workload API SVID at
startup and use it for listener SDS naming (xDS + CNI servers). --spire-trust-domain
now governs only peer authorization, as documented, and may remain the
RootCATrustDomain sentinel. The Workload API source is opened once and shared
with the registrar client instead of being created per consumer.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@bpalermo
bpalermo merged commit 9fe939d into main Jun 7, 2026
10 checks passed
@bpalermo
bpalermo deleted the fix/agent-derive-trust-domain branch June 7, 2026 18:06
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