Appearance
Certificates and PKI
Every machine and operator proves who it is with a short-lived client certificate. Renewal is mostly automatic, but a missed renewal stops that runner or operator, so know what renews what.
What exists
| Certificate | Lifetime | Renewed by |
|---|---|---|
| Runner | at most 24 hours | deploy/renew-runner-cert.sh (Compose), or the host mint-cert.sh timer |
| Operator (browser) | 24 hours | deploy/renew-operator-cert.sh --if-needed, from a timer |
| Service (control plane, broker, gateway) | 30 days | deploy/pki.sh issues them; put the new files in the secrets folder |
| Task (agent to gateway) | until the lease expires | the broker, per lease |
Steps
- First time: run
deploy/pki.shonce before bootstrap, then again after the workspace ID is known. It creates the CAs and certificate pairs inFORELEAD_PKI_DIR, which must be an absolute private directory outside the checkout and outside the secrets directory. The CAs use name constraints and a 10 year life. - Rotate only the runner pair:
deploy/pki.sh --renew-runner. - Operator certificate:
sh deploy/renew-operator-cert.sh --if-neededreissues once two thirds of the life has passed (16 of 24 hours). A browser cannot renew itself: setOPERATOR_CERT_IMPORT_CMDto load the new certificate into the browser store. - Runner restart during renewal: the script stops the runner only when idle, swaps the pair, restarts, and restores the old pair if anything fails. On failure it can send a fallback alert to the ntfy topic (
NTFY_TOPIC_URL). - Install a service certificate:
forelead_secret_put NAME < filefrom the single-host guide, which sets the right owner and mode (see Secrets layout).
Technical notes
- Runner IDs may use only letters, digits, dots, dashes and underscores (1 to 128 characters);
pki.shrefuses others. - Runner evidence keys are separate from certificates: an Ed25519 pair per runner, approved by an administrator (
POST /v1/runner-keysorrunnerkey enroll). Rotating needs no restart, but evidence signed under the old key is refused afterwards, so rotate between tasks. See Preflight runner. - The operator certificate needs
OPERATOR_DIR,CLIENT_CA_DIRandRUNNER_WORKSPACE_ID.
Sources
deploy/pki.sh,deploy/renew-runner-cert.sh,deploy/renew-operator-cert.shdeploy/README.md("Unattended runner certificate renewal and phone alert")