Skip to content

feat(proxy): pin upstream peer identity to the service's SPIFFE IDs - #165

Merged
bpalermo merged 1 commit into
mainfrom
feat/upstream-san-pinning
Jun 12, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/upstream-san-pinning

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Closes the registry-poisoning impersonation gap: upstream mTLS validated trust-domain membership only (bare bundle, no SAN matching) — any mesh workload's SVID passed when dialing any service.

  • CombinedValidationContext per service cluster: exact URI SAN matchers (spiffe://<td>/ns/<ns>/sa/<svc>, namespace union from the endpoints, sorted for hash stability) + the SDS trust bundle.
  • Applied at snapshot time to all per-source sockets and the on-no-match node-identity socket; ODCDS clusters included automatically.
  • No-namespace endpoints → bundle-only fallback (logged shape preserved).
  • Inbound unchanged (authn + XFCC; authz stays app-layer).

🤖 Generated with Claude Code

mTLS previously proved only trust-domain membership: the upstream
validation context was the bare SPIRE bundle, so a client dialing an
svc-1 endpoint accepted ANY valid mesh SVID — leaving registry
poisoning able to impersonate a service (register an attacker pod's IP
under svc-1; clients connect and the handshake passes).

Service clusters now carry a combined validation context: exact URI SAN
matchers for the service's expected identities
(spiffe://<td>/ns/<ns>/sa/<service>, one per namespace in the
endpoints' union, sorted) layered over the SDS-rotated trust bundle.
Injected at snapshot time on every per-source transport socket and the
node-identity no-match path; ODCDS clusters ride the same path. A
poisoned endpoint now fails the handshake unless it actually runs as
the target ServiceAccount. Services whose endpoints carry no namespace
metadata fall back to bundle-only validation.

Inbound stays authn-only (caller identity recorded in XFCC; per-service
authorization remains app-layer).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@bpalermo
bpalermo merged commit b8abebb into main Jun 12, 2026
9 checks passed
@bpalermo
bpalermo deleted the feat/upstream-san-pinning branch June 12, 2026 22:56
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