feat(auth): mTLS client-certificate authentication for the management plane#18
Merged
Conversation
Bumps the api dependency to the merged WhoAmI revision; the handler satisfies the regenerated FleetServiceHandler interface.
This was referenced Jul 14, 2026
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.
What and why
Slice A of productionize. Replaces the dev auth stub with real mTLS client-cert auth: when
authBypassis false the manager serves HTTPS withRequireAndVerifyClientCertagainst the operator CA, derives the operator identity + access level from the presented certificate, and exposes it viaWhoAmI. TheauthBypassdev path (h2c) is preserved.tlsCert/tlsKey/operatorCAPath, required whenauthBypassis false.Identity{CN,Serial,Level}on the request context;ClientCertMiddleware(401 no peer cert, 403 cert without the access-level extension) andBypassMiddleware(dev identity). Auth is HTTP middleware, not a Connect interceptor, because only the HTTP layer sees the TLS peer certificate.RequireAndVerifyClientCert+ operator-CA pool + server cert); h2c kept forauthBypass. The oldBypass()interceptor is retired.WhoAmIrevision.Builds on the A0 access-level codec (#16) and api WhoAmI (CryptOS-PKI/api#44), both merged.
Closes #17
Verification
How this was verified
Whole-branch review confirmed no anonymous path (single mux behind
ClientCertMiddleware,RequireAndVerifyClientCert, bypass reachable only whenauthBypasstrue and validation forces trust material otherwise), identity derived solely from the verified peer cert, and no broken intermediate commit. Live cert-in-browser verification is the runbook step at deploy (docs/operator-pki.md).