Repository navigation
Description
Description
Provide the validation material both SPIFFE credential types are checked
against: X.509 roots and intermediates for X.509-SVID chains, and JWT
verification keys for JWT-SVID signatures, keyed by an explicitly configured
trust domain.
This is the largest greenfield piece of the epic and the largest risk. The
spiffee-authserver branch has no bundle or rotation code at all —
spiffe.NewMiddleware takes only an expected trust domain and relies on chain
validation configured on the TLS listener. There is nothing to harvest here, so
the work should be split along the line where existing machinery stops.
Scope
One bundle document carries both key types, so both halves share a single
fetch. Do not split this work by credential type.
- Add a trust-domain-keyed bundle registry supplying both
x509bundle.Source
andjwtbundle.Source. Those are the interfacesx509svid.Verify(Implement X.509-SVID OAuth client authentication (spiffe_x509) #6202)
andjwtsvid.ParseAndValidate(Implement JWT-SVID OAuth client authentication (spiffe_jwt) #6203) consume, and they are the deliverable. - Supply X.509 roots and intermediates for chain validation, and JWT
verification keys restricted to the bundle'sjwt-svidkeys. - Support explicitly configured SPIFFE Bundle Endpoints.
- Support a SPIRE Workload API bundle source for locally attested deployments.
- Implement bundle refresh hints, sequence-number monotonicity, and an explicit
last-known-good policy. - Keep Workload API and remote Bundle Endpoint configuration independent —
neither should imply or override the other.
go-spiffe/v2 is already a direct dependency and covers most of the above:
workloadapi.NewBundleSource, spiffebundle.Set (trust-domain-keyed, already
fails closed on unknown domains), spiffebundle.Read, Bundle.RefreshHint(),
Bundle.SequenceNumber(), and federation.NewHandler for serving spec-correct
bundle documents in tests. Do not reimplement any of it. Note that go-spiffe
parses spiffe_sequence but never enforces it, so rollback protection is ours.
Two corrections to the original scope
Do not extend pkg/oauthproto/jwks.go. A SPIFFE bundle is keyed by trust
domain rather than issuer, carries spiffe_sequence and spiffe_refresh_hint,
and partitions keys by use. JWKSFetcher is issuer-keyed and discovery-driven,
so adopting it means reimplementing spiffebundle.Read worse. That file is also
an unpushed spike artifact that should not be adopted at all — see #6319 for the
separate and unrelated JWKS consolidation work.
Rotation overlap is not configurable. A bundle is an authority set, and the
trust domain publishes old and new authorities together during rotation. A local
overlap window would retain authorities the domain has already withdrawn, which
contradicts the "removed keys stop validating" criterion below. Overlap is the
bundle's content, not a knob.
Acceptance criteria
- Bundle material is selected by a configured trust domain, never by an
arbitrary issuer or claim taken from the credential being validated. - Bundle Endpoint URLs are explicitly configured and authenticated using
WebPKI, kept separate from SPIFFE workload trust. - X.509 and JWT validation cannot mix keys across trust domains.
- A rotated bundle validates its new authorities and stops validating removed
ones on the next successful fetch, with no restart. - A bundle whose sequence number is lower than the current one is rejected and
the current material is retained. - Removed keys stop validating once the updated bundle becomes authoritative.
- Unknown trust domains fail closed.
- Bundle refresh and failure behaviour is observable without logging
credentials or key material.
Dependencies
- Sub-issue 1 (identity, association and configuration model) — the trust
domain this registry is keyed by is declared there.
Related
- Part of the SPIFFE client-authentication epic
Activity
jhrozek commentedon Aug 13, 2026
Surveyed the
spiffee-authserverbranch for reuse. Confirming the issue text: there is nothing to salvage here.The branch imports go-spiffe only for
spiffeid,spiffetls/tlsconfigandsvid/x509svid.workloadapi,BundleSource,x509bundleandjwtbundleare never imported anywhere. Trust anchors are a singleos.ReadFileintotls.Config.ClientCAsset once at startup, and the source comment says a proxy restart is required if the CA changes. The PoC root CA is a 10-year self-signed cert that was never expected to rotate, so rotation was never even approximated.The one thing worth reading is
docs/spiffe-poc/future-directions.md, which marks trust bundle distribution as partial and sketches both upgrade paths (workloadapi.BundleSource, or periodic fetch from the federation endpoint).Two corrections to the scope above, based on that survey:
Extending
pkg/oauthproto/jwks.godoesn't fit. A SPIFFE bundle document is keyed by trust domain rather than issuer, carriesspiffe_sequenceandspiffe_refresh_hint, and partitions keys byuse.JWKSFetcheris issuer-keyed and discovery-driven, so adopting it means reimplementingspiffebundle.Readworse. This also collapses the proposed JWT/X.509 split: one bundle document carries both key types, so both halves share a single fetch and the JWT half is not separately "existing machinery". The dependency is moot anyway, sincepkg/networking.NewHostScopedClientBuilderalready gives us an SSRF-guarded client on main.Rotation overlap probably shouldn't be built. A bundle is an authority set, and the trust domain publishes old and new authorities together during rotation. A local overlap window would retain authorities the domain has already withdrawn, which contradicts the "removed keys stop validating once the updated bundle becomes authoritative" criterion. The part that is genuinely ours is sequence-number monotonicity: go-spiffe parses
spiffe_sequencebut never enforces it, so rollback protection has to be written here.go-spiffe v2.7.0 is already a direct dependency and covers most of the remaining bullets:
workloadapi.NewBundleSourcefor the Workload API source,spiffebundle.Setas a trust-domain-keyed registry that already fails closed on unknown domains,spiffebundle.Readfor parsing,Bundle.RefreshHint(), andfederation.NewHandlerfor serving spec-correct bundle documents in tests.jhrozek commentedon Oct 21, 2026
Merged so far: #6759 (7529e47) adds the
filebundle source and its live loader. It polls the mounted bundle, rejects lower or conflicting sequence numbers, and keeps the last good bundle. Thebundle_endpointandworkload_apisources are declared in config but still have no loader.jhrozek commentedon Nov 24, 2026
Closing this as done, with one scope change worth recording.
The registry that supplies both
x509bundle.Sourceandjwtbundle.Sourceis in (#6467, #6759). It selects material by configured trust domain and fails closed on unknown domains. It rejects a bundle whose sequence number is lower than the current one and keeps the current material. It tracks how old the last-known-good bundle is and warns when it goes stale. It reloads without a restart, and #7194 checks rotation against real SPIRE authorities.What we did not build is the Bundle Endpoint and Workload API sources. We decided early on that the auth server should not hold a Workload API socket or an SVID of its own. Instead, SPIRE publishes its bundle to a ConfigMap (
k8s_configmapBundlePublisher) and the auth server mounts it read-only and polls the file. Sockets only appear on the attested client workload.bundle_endpointandworkload_apistill exist as reserved source types in the config and CRD, but they are rejected at validation.If someone needs a non-Kubernetes deployment that pulls a bundle straight from a Bundle Endpoint, that is a new issue with its own design, not a gap in this one.