Repository navigation
feat(operatorca): admin rotation and CRL/OCSP settings - #162
Merged
Merged
Conversation
… the OCSP probe signer and last error Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
…CRL source, CRL upload and OCSP mode Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
… CRL and OCSP settings Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Bugs5382
force-pushed
the
feat/157-operatorca-rotation
branch
from
October 1, 2026 21:22
01cf13c to
a0ea99e
Compare
…writes Rebased onto the restructured main: the first-run fake store now has to implement the RotateOperatorCA, SetOperatorCACRLSource and SetOperatorCAOCSP methods this change adds to store.OperatorTrust. First run never calls them, so they refuse. Signed-off-by: Bugs5382 <Bugs5382@users.noreply.github.com>
Contributor
Author
|
Closing summary (after the org restructure): rebased onto cryptos-manager main. The imports now use the cryptos-manager and cryptos-node stub paths, and the first-run fake store gained the three new OperatorTrust methods, which refuse because first run never calls them. task ci passes locally against Postgres, and all checks are green. |
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
Operator CA changes after first run go through admin FleetService RPCs. Until now they answered Unimplemented. This PR serves them.
ListOperatorCAs(operator): active first, then retiring, then retired. Each row has the fingerprint, notAfter, CRL source and the CRL the manager holds (thisUpdate, nextUpdate, number, revoked count, fetched_at, last error, stale). It also has the OCSP mode and URL, this replica's last OCSP error, acknowledgements and warnings. A config-file CA is listed read-only withmanaged_by_config.RegisterOperatorCA(admin): runs the first-run checks (anchor rules, CRL source with fetch and verify, OCSP mode with theurlprobe), returns a preview, then takesconfirm_sha256. In one store transaction the new CA becomes active and the previous active CA becomes retiring, so both stay trusted and revocation-checked during the overlap. A second registration while a CA is retiring gives 1605ROTATION_IN_PROGRESS.RetireOperatorCA(admin): refuses the active CA (1609). It also refuses the caller's own CA unlessi_understand_self_lockoutis set; that refusal is a plain FailedPrecondition that names the flag. Certificates under a retired CA are refused from their next request.SetOperatorCACRLSource(admin): url, crl_der (upload) or none withNO_CRL. A new URL or CRL must verify against the CA first.UploadOperatorCRL(admin): verified and anti-rollback checked through the revocation engine, then stored with an epoch bump.SetOperatorCAOCSP(admin): off, aia or url. url must pass the responder probe, and the response reports who signed the probe answer.Every write:
operator-ca-registered,operator-ca-retired,operator-ca-crl-source-changed,operator-crl-uploaded,operator-ca-ocsp-changed);operatorCAPathis set.An upload CRL source is refused under
operatorRevocationPolicy: hard, because the manager would refuse to start with that combination.Supporting changes:
RotateOperatorCA,SetOperatorCACRLSourceandSetOperatorCAOCSP, atomic in Postgres. The CRL write is split into a transaction helper, the same helper feat(bootstrap): first-run token, session, operator CA registration and first admin #160 adds. The in-memory store refuses them, as it does registered rows.storetest.MemoryTrust: an in-memory operator trust store for other packages' tests, checked against the same contract as Postgres.CheckCRLChoiceandCheckOCSPChoice, the shared registration checks;OCSPClient.ProbeResult, which returns the signer;Removed test:
TestFleetService_UnservedOperatorCAMethodsAreUnimplemented, because the methods are now served.TestFleetService_OperatorCAMethodsNeedAnOperatorCAreplaces it.Follow-up: #160 adds the runtime node-CA flag, so
ListOperatorCAscan't show it yet. Once #160 is on main it takes a few lines.Closes #157
Refs #78
Docs:
docs/operator-ca.mdin this PR, plus the companion CryptOS-PKI/docs#81. Merge the two together. The docs page links to the page CryptOS-PKI/docs#75 adds, so merge docs#75 first or at the same time.Verification
How this was verified
task ci(gofmt, vet, golangci-lint, go test) passes with the Postgres integration tests on (MANAGER_TEST_DATABASE_URLagainst a throwaway Postgres 18), andtask licenseis clean.