A private CA in an afternoon
Every estate needs certificates a public authority will never sign: internal hostnames, private addresses, client certificates, anything on a network with no way out. The authority for those is yours to run, and running it well is mostly about what you decide before you create the first key.
The tree
A private PKI is the same shape as the public one: a root that is kept offline and precious, intermediates beneath it that do the day-to-day signing, and end-entity certificates beneath those.1,2 The root's only job is to sign intermediates, rarely, in a ceremony. The intermediates' job is to sign leaves, constantly, by automation. Keeping those two jobs on different keys is what lets you rotate or revoke an issuing CA without redistributing trust to every client.
The afternoon
- Decide the tree on paper. One root. One issuing CA per job: servers, clients and machines, perhaps one per environment. Write down the lifetimes: leaves in days, issuing CAs in a few years, the root in a decade.
- Create the root in a ceremony. The root key is the one thing whose compromise you cannot recover from, so it is generated with more than one person present and its dangerous operations require more than one person to agree. trstctl gates those operations with an m-of-n key ceremony.2
- Constrain the issuing CAs. A name constraint limits which names an intermediate may sign, so a compromised issuing CA for
.internalcannot issue a certificate forexample.comthat clients accept.1 A purpose constraint limits an issuing CA to server authentication or to client authentication, which matches the direction the public root programs are taking.3 - Put the keys where the API is not. Every signing operation should happen in a process that has no HTTP server and no database, holding keys the control plane can only reference, never read.4
- Speak ACME. If your issuing CA implements the authority side of ACME, the same clients that talk to public authorities work internally, with the DNS challenge for names that resolve only inside.5,6 Renewal then automates itself, which is the only way short leaf lifetimes are affordable.
- Publish revocation. A revocation list and an online status responder for each issuing CA, and clients configured to check them, because inside your walls you can make that work.7
The quarter
None of the above is what takes long. Trust distribution is. Every client that should accept your certificates needs your root in its trust store: servers through configuration management, laptops through device management, containers through base images, appliances through whatever each one offers. Plan that as a program with an owner, not as a step, and plan the removal of the previous root the same way. The afternoon builds the authority; the quarter makes it trusted.
trstctl can be that private PKI: a root, intermediates and end-entity certificates in the usual tree, with the root's operations behind an m-of-n ceremony, every key it holds in the isolated signer, the authority side of ACME with all three standard challenges, and revocation lists and online status for what it issues.2,6,7
The issuance page covers running your own hierarchy, and the ACME page the internal enrollment path.
Sources
- IETF, RFC 5280: certification paths, name constraints, and revocation lists.
- trstctl documentation, Issuance and CAs, "Running your own CA hierarchy (F48)": offline-precious root, day-to-day intermediates, m-of-n key ceremony.
- Google, Chrome Root Program Policy, version 1.8, section 1.3.2: the Chrome Root Store is relied upon solely for TLS server authentication.
- trstctl, Signing service design.
- IETF, RFC 8555: ACME.
- trstctl documentation, ACME and DNS: the CA side of ACME, and DNS-01 for names that resolve only internally.
- trstctl documentation, Issuance and CAs, "Revocation: OCSP and CRLs (F47)".