Repository navigation
fix(agent): derive SDS trust domain from SPIRE, not the auth sentinel - #76
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
--spire-trust-domainwas overloaded: it set both peer authorization (where theRootCATrustDomain=ROOTCAsentinel means "authorize any valid SVID") and the trust domain used to construct SPIFFE IDs / SDS resource names for Envoy listeners (SpiffeIDFromPod, validation contextspiffe://<td>).With the sentinel default, the agent named SDS secrets
spiffe://ROOTCA/...while SPIRE — and the SPIRE bridge — issuespiffe://<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 (upstream503 connection termination).Confirmed on talos-main: SPIRE issues
spiffe://aether.internal/ns/aether-test/sa/echo; the agent requestedspiffe://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-domainnow governs only peer authorization, as documented, and may remain theRootCATrustDomainsentinel. The Workload API source is opened once inrunAgentand 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).