Repository navigation
chore(operator-ca): OpenSSL operator CA, CRL and OCSP responder for the lab Fleet Manager - #9
Merged
Merged
Conversation
…he lab Fleet Manager The operator CA is always external, never a CryptOS node, so the lab Fleet Manager can no longer trust the workload Intermediate through operator_ca_node. operator-ca/ builds the external CA instead: - ca.sh init: P-384 CA (pathlen:0, keyCertSign and cRLSign), an operator-ca.cnf with the expanded op_admin, op_operator and op_viewer sections (level extension non-critical, OCSP AIA), a delegated OCSP signer (OCSPSigning, noCheck, 30 days) and a first CRL (7 days) - ca.sh issue: key, CSR, cert and PKCS#12, checked against the Fleet Manager's rules; the passphrase comes from a file or the environment - ca.sh revoke, crl and ocsp-signer for the CA's upkeep - publish.sh: the CA ConfigMap for the chart, the CRL ConfigMap and an openssl ocsp responder in kind, with the signer key only; the probes send a real OCSP request because a bare TCP connect wedges the responder task opca:check runs the offline checks, and a new workflow runs it on PRs. Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Contributor
Author
|
Merging for the v0.1.0 test run: CI green and mergeable at merge time. |
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
The Fleet Manager's operator CA is always external and never a CryptOS node, and
operator_ca_nodeis about to become a startup error. The lab Fleet Manager still trusted the workload Intermediate as its operator CA throughoperator_ca_node, so it has to move first. This adds tooling underoperator-ca/for an external OpenSSL operator CA with a CRL and a delegated OCSP responder, and documents the Fleet Manager values that use it through the file source (operatorCA.configMap, nooperatorCANode).Closes #8
Refs CryptOS-PKI/cryptos-manager#78
Changes
task opca:init(operator-ca/ca.sh init): the CA in.state/operator-ca/(mode 700, gitignored, untouched byk8s:down). ECDSA P-384,CA:TRUE, pathlen:0, KUkeyCertSign, cRLSign, SKI, SHA-384. It rendersoperator-ca.cnfwithcopy_extensions = none, the CN-only policy, 7-day CRLs, and the expandedop_admin,op_operatorandop_viewersections (OpenSSL has no section include). Each level section carries1.3.6.1.4.1.59999.1.1non-critical, with the DERcmd/opextprints, plus anauthorityInfoAccessOCSP URI. It also makes a delegated OCSP signer (EKU OCSPSigning,noCheck, 30 days) and the first CRL, and prints the CA SHA-256. It refuses to overwrite an existing CA.task opca:issue LEVEL= EMAIL=: P-384 key and CSR (CN=<email>, lower-cased),openssl ca -extensions op_<level>, then a check against the Fleet Manager's rules (level extension present, non-critical and exact; EKU exactly clientAuth; KU critical digitalSignature; critical CA:FALSE; verifies to the CA). Then a PKCS#12 with the CA cert. The passphrase comes fromLAB_OPCA_P12_PASS_FILEorLAB_OPCA_P12_PASS(18 bytes or more), never from the command line, and is never logged.task opca:revoke,opca:crlandopca:ocsp-signercover the CA's upkeep.task opca:publish: the CA cert goes into the chart'sfm-operator-caConfigMap (keyoperator-ca.pem) and the CRL intofm-operator-crl. It also runsopenssl ocspas a lab-grade responder (operator-ocspDeployment and Service,alpine/opensslpinned by digest ink8s/versions.env, nonroot, read-only root filesystem,-nmin 60). The responder's Secret holds only the signer cert and key, the CA cert andindex.txt, never the CA key. A checksum annotation restarts the responder whenever its data changes. The Secret is applied without a diff, so the signer key never reaches a log.tcpSocketprobe) wedgesopenssl ocspfor good: reproduced with OpenSSL 3.5 and 3.6, and-timeoutdoesn't recover it. A liveness probe restarts a wedged responder.ci-operator-ca.yml:task opca:checkon every non-draft PR that touchesoperator-ca/, the shared k8s helpers or pins, or the Taskfile.operatorCANodemeans no operator revocation source and MCP stays off.Testing
task opca:check: 147 checks against a throwaway CA built by the real scripts. They cover shellcheck; the CA profile and file modes; the cnf (no.include_section, each level section, the DER); the refusal to re-init; the OCSP signer (EKU,noCheck, 30 days, chains to the CA); the CRL (verifies, nextUpdate, CRL number, AKI); and issue for all three levels. For each issued cert the checks cover the level extension (not critical, DER equal tocmd/opext), subject, key, EKU, KU, basic constraints, AIA, the PKCS#12 contents and passphrase, and that the passphrase is written nowhere. They also cover the input refusals,checkrefusing a critical level extension, revoke plus the new CRL, and a localopenssl ocspresponder answeringgood(verified, delegated signer, nextUpdate) and thenrevoked. Finally they run the signer renewal and the publish step in dry-run mode (pinned image, no private key in the manifest, CA key absent from the Secret, probes, kubeconform-strict).task k8s:checkstill passes (60).cmd/opexton manager main prints130561646D696E,13086F70657261746F72and1306766965776572for admin, operator and viewer, the values the cnf carries.chart/fleet-managerand Postgres:opca:publishrolled out the responder, and OCSP through the AIA URL from inside the cluster, and through a port-forward, answeredgoodwith "Response verify OK".operatorCA.configMap: fm-operator-caand nooperatorCANode, the manager started onoperatorCAPath. An admin PKCS#12 fromopca:issuesigned in:WhoAmIreturned level admin andListNodeslisted the nodes.unknown ca), and a request without a cert got 401.opca:revoke, then published, showed as revoked in the CRL and in OCSP, but the manager still accepted it. That is expected: current main has no revocation source withoutoperatorCANode, and the manager's CRL and OCSP support will close the gap.Docs
The README is updated. No docs-site change: lab tooling isn't part of the product docs.