Repository navigation
Conversation
Ginkgo coverage for cf:svc:<prefix>:<name> matching and denial, and the malformed-route-policy warning for malformed account rules. Matching cases already pass; the malformed-rule warning cases fail until the account source syntax is validated.
Validate cf:svc: rules against the cf:svc:<prefix>:<name> syntax (lowercase RFC 1123 labels, 3-63 characters) and log malformed-route-policy before skipping them, as other unrecognized rules already do.
Replace the plain Go test with Ginkgo coverage of service-account caller identity: SVC= emission in the envoy XFCC format, SVC= parsing, a single trust source for app, space, org and account in forward modes, header-injection guards and end-to-end route-policy and domain-scope authorization. Specs for the new SVC= key and for forward-mode sourcing fail until the identity handler stops mixing the verified TLS leaf with forwarded header data.
Emit the validated account as SVC=<san> ahead of the Subject in the envoy XFCC format and read it back only from ahead of the Subject, so nothing in a certificate-controlled value can introduce one. The raw format reads the account from the header certificate's SANs. App, space, org and account now all come from the XFCC data, no longer partly from the TLS connection: sanitize_set derives it from the verified peer certificate, and forward modes trust the forwarded header for every field alike.
Integration coverage over real mutual-TLS handshakes with Diego-style instance certificates carrying zero, one or several service-account SANs: matching and non-matching accounts, a malformed rule beside a valid one, domain scope, client-forged XFCC headers in sanitize_set, and a forward-mode domain. These exercise behavior already implemented, so there is no preceding red commit.
The envoy format adds SVC=<SAN> between Hash and Subject when the client certificate has exactly one service-account SAN.
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.
Summary
Implement qualified service-account route sources for RFC 0065, building on RFC 0055.
cf:svc:<org-prefix>:<account-name>against<account-name>.<org-prefix>.svc.identityfrom the caller's certificate (exactly one well-formed SAN; zero, several or malformed*.svc.identitySANs yield no account).sanitize_setthat data is derived from the verified peer certificate;forwardandalways_forwardtrust the forwarded header for every field alike, as before for app, space and org.envoyXFCC format GoRouter addsSVC=<SAN>betweenHashandSubjectwhen the certificate has a service account. It is read only from ahead of theSubject, so nothing certificate-controlled can introduce one. Other DNS SANs are never exposed. Therawformat already carries the SANs in the certificate.malformed-route-policyforcf:svc:rules that are notcf:svc:<label>:<label>(lowercase RFC 1123 labels, 3-63 characters), like other unrecognized rules.Ship routing support before the CAPI producer changes. No router contract-version configuration is required; old routers deny unmatched account sources.
Note for RFC 0055:
SVC=is a GoRouter extension to the Envoy-style compact format.Committed TDD
3003dc3cf-> GREENbec37471a: verified certificate SAN extraction and exact source matching.13f6637f9-> GREEN839fe82c2: warning for malformed account rules.093a22fe9-> GREEN8af4d1633: single-source identity andSVC=(including the case where a client-supplied header in a forward mode could be combined with an account taken from the TLS leaf).ff762ec82: integration coverage of behavior already implemented (no RED).7d84c2219: job spec description of theenvoyformat.Tests
Ginkgo coverage in
handlers,handlers/postselectionandintegration: SAN matrix over both XFCC formats, emission and parsing ofSVC=, header-injection cases, forward modes, end-to-end scope and route-policy authorization, and 29 integration specs over real mutual-TLS handshakes (forged XFCC, scope, forward-mode domain).All
./gorouter/...packages exceptintegrationandrouterpass.integrationservice-account specs pass (NATS_SERVER_BINARYrequired).routercould not run in the authoring environment because*.localhost.routing.cf-app.comdoes not resolve; this is not claimed as passing. Release template specs were not run (gems unavailable).Current homelab evidence — 2026-11-20
Head
7d84c2219built/uploaded as routing0.0.0+dev.20261120130000; dry-run task34075 and deployment task34076 succeeded with the existing lab skip-drain setting. Candidate changed only the routing release version; other component versions and identity-aware routing configuration were preserved. All monitored processes are running.Direct mTLS requests with server certificate validation, on the existing
sanitize_set/envoydomain:SVC=qualified-worker.homelab-poc.svc.identity, and noDNS=elements.SVC=.Forward-mode trust and malformed-rule warning are covered by component/integration tests; this live deployment uses
sanitize_set. No GitHub Actions workflow exists in routing-release and no Actions run was created for this head; EasyCLA passes. Remaining broad regression verification depends on upstream CI/maintainers.Earlier homelab evidence
Routing
0.0.0+dev.20261110100000deployed successfully in BOSH task33969, before CAPI task33971.Direct verified TLS is demonstrated; external trusted-proxy SAN forwarding is not demonstrated by this change.