| name | private-pki-hierarchy-basics |
| description | Design and review private PKI hierarchies for owned or authorized environments: offline root CA, intermediate and issuing CAs, pathLen and name constraints, trust anchors, CRL/OCSP distribution, and key custody. Use when planning or reviewing an internal CA tree, root vs intermediate lifecycle, subordinate CA issuance, trust-store distribution, private hierarchy depth, or hardening enterprise PKI — not for public ACME-only issuance, third-party CA compromise, or unauthorized certificate forgery.
|
Private PKI Hierarchy Basics
Build and review private PKI so internal TLS, mTLS, code signing, and device
identity rest on a clear root → intermediate → leaf trust chain. Focus is
hierarchy design, constraints, and operations—not TLS RE or cert-manager alone.
When To Use
| Situation | Direction |
|---|
| Design offline root + one or more intermediate/issuing CAs | This skill |
| Choose hierarchy depth, pathLenConstraint, name constraints | This skill |
| Separate TLS server, client/mTLS, and code-signing issuing CAs | This skill |
| Root/intermediate lifecycle, re-sign, rollover, decommission | This skill |
| Trust-anchor distribution to OS, browsers, meshes, devices | This skill |
| CRL, OCSP, AIA/CDP URLs, offline-root operational model | This skill |
| Review over-broad subordinate CA rights or missing EKU/keyUsage | This skill |
| Public ACME / cert-manager Issuer automation only | cert-manager-basics |
| Client mTLS verify/require mapping | mtls-client-auth-basics |
| CA private keys, HSM pins, vault layout | secrets-management-hygiene |
| Edge TLS policy / headers (not hierarchy) | nginx-security-headers |
Workflow
1. Inventory trust needs
- Record environments, apps, and cert purposes (server TLS, client mTLS, mesh,
device, code signing).
- List existing private roots, intermediates, mixed public trust, and where
anchors live (OS store, images, mesh, MDM).
- Note issuance volume, online vs offline needs, and compliance (audit, dual
control, key custody).
2. Choose hierarchy shape
| Layer | Role | Custody |
|---|
| Root CA | Trust anchor; signs intermediates only | Offline HSM/air-gapped; rare use |
| Intermediate / policy CA | Optional policy or region layer | Restricted online or offline |
| Issuing CA | Signs end-entity certificates | Online HSM/KMS; high availability |
| Leaf | Workload, user, device, or code identity | Short-lived where possible |
Prefer two-tier (root + issuing) for small estates; three-tier when
regions, BU isolation, or policy CA separation is required. Avoid deep trees
without need—each extra CA increases ops and trust-store cost.
3. Constrain subordinates
- basicConstraints: CA=true only on CAs; leaves CA=false.
- pathLenConstraint so intermediates cannot mint unbounded sub-CAs (often
pathLen=0 on the issuing CA under the root).
- nameConstraints (permitted/excluded DNS, IP, directory names) when a
subordinate serves a bounded namespace—test client support.
- Restrict keyUsage / EKU on issuing CAs and profiles (serverAuth vs
clientAuth vs codeSigning)—no “do everything” CAs.
- Prefer distinct issuing CAs per purpose over one multi-EKU mega-CA.
4. Keys, algorithms, and profiles
- Root/intermediate: RSA-4096 or P-384 (or org-approved); HSM/KMS; never CA
keys in git or shared disk.
- Leaf: shorter lifetimes; automate reissue; align with workload loaders.
- Profiles: required SANs, validity, SKI/AKI, unique serials; ban weak
signatures (MD5/SHA-1).
- Plan AIA (caIssuers) and CDP/OCSP URLs reachable by clients; offline
root may omit OCSP.
5. Operate root and intermediates
- Root stays offline except scheduled intermediate issuance, CRL signing (if
root signs CRLs), and planned rollover.
- Dual control for root ceremonies; log who, when, and what.
- Intermediate compromise: revoke, re-issue under root, redistribute chains;
root compromise forces full re-anchor and emergency IR.
- Overlap validity during rollover so clients hold old and new anchors/chains.
6. Distribute trust and verify chains
- Ship root (and needed intermediates) to trust stores; apps must present
full chain to a known anchor—signing alone is not trust.
- Validate sample leaves (OpenSSL/
certutil): path, EKU, expiry, revocation.
- K8s issuance automation →
cert-manager-basics (this skill for CA tree);
client identity → mtls-client-auth-basics; keys/IR →
secrets-management-hygiene; code → code-quality-standards.
Routing
| Need | Skill |
|---|
| Private root/intermediate tree, pathLen, name constraints, CA lifecycle | This skill |
| cert-manager Issuer/Certificate automation | cert-manager-basics |
| mTLS client trust and require-and-verify | mtls-client-auth-basics |
| CA key / HSM / vault custody and leak IR | secrets-management-hygiene |
| Edge TLS ciphers/headers (not CA design) | nginx-security-headers |
| Public ACME challenge debugging only | cert-manager-basics |
| Manifests, scripts, config quality | code-quality-standards |
Keep this skill primary for hierarchy design and CA constraints; hand off
issuance automation, mTLS app config, and secret process as above.
Output Checklist
Scope And Authorization
- In scope: Private CAs and hierarchies you own or are authorized to design,
operate, or review; lab/root ceremonies; trust-store changes on owned systems;
read-only review of certs, CRLs, and CA config under ROE.
- Out of scope: Forging certificates for third parties; attacking public CAs;
installing rogue roots on systems you do not control; weakening production
trust without an approved change window; TLS traffic decryption as the goal.
- Prefer non-prod for experiments. Gate root ceremonies, online CA key export,
and mass trust-store pushes. Redact private keys, HSM credentials, and
enrollment secrets from tickets, chat, and logs.
- Do not treat “internal network” alone as authorization to reissue production
intermediates or replace enterprise trust anchors.