2.5 KiB
2.5 KiB
configs/pki/
Public certificates of the lab internal CA. Public material only — private
keys live encrypted in secrets/ (lab-ca-key.age, <name>-tls-key.age),
managed with agenix.
Contents
| File | Description |
|---|---|
lab-ca.crt |
Root CA cert (CN=Skyg Lab CA). Trusted fleet-wide via modules/core/lab-ca.nix (security.pki.certificateFiles). |
lab-ca.srl |
OpenSSL serial counter, written on first ca issue. Needed for unique serials — commit it. |
<domain>.crt |
Leaf certs issued for services (e.g. buzz.app.internal.crt). |
Managed by skyg ca (bin/lib/cmds.nu)
skyg ca init # one-time: generate the root CA
skyg ca issue buzz.app.internal --for minipc1 # mint a leaf for a service
ca initencrypts the CA key tosecrets/lab-ca-key.age(recipient:arionly) and writeslab-ca.crthere. Refuses to overwrite an existing CA.ca issuedecrypts the CA key to.tmp/, signs a leaf (SAN = domain, EKU serverAuth, 825 days), encrypts the leaf key tosecrets/<name>-tls-key.age(recipients:ari+ the--forhost), and writes<domain>.crthere.- Both commands auto-register missing entries in
secrets.nix— review withgit diffafter running them.
Never hand-edit or commit keys here. Re-issuing: delete the leaf cert and
re-run ca issue. Rotating the CA itself: delete lab-ca.crt +
secrets/lab-ca-key.age, re-run ca init, re-issue all leaves, and rebuild
every host (fleet trust comes from the committed root cert).
When to use what
- Lab CA (this dir): internal-only services whose clients all use the
system trust store (fleet trust via
modules/core/lab-ca.nix). - Public Let's Encrypt cert (
skyg.server.acme, seemodules/nixos/server/acme/): anything reached by clients that only trust public CAs — e.g. the Buzz desktop app, whose WS client bundles Mozilla roots and ignores the system store. Buzz uses a public cert forbuzz.home.sosnovsky.ca(Cloudflare DNS-01); the zone lives in~/Projects/Homelab/homelabpending migration into this repo.buzz.app.internal.crthere is now unused by the buzz stack and kept only as a lab-CA example.