Intermediates renew themselves through the region
CI / go (push) Successful in 51s
CI / agent (push) Successful in 3s
CI / site (push) Successful in 3s

The region keeps every intermediate it signs: its name constraints,
certificate, the root that signed it and a renewal token (stored hashed,
printed once). `rollcall ca intermediate` goes through the API now (so it
works from any admin client) and writes NAME.token beside NAME.pem;
`rollcall ca intermediates` lists them.

The host with the intermediate's key runs deploy/rollcall-intermediate-
renew.sh daily (rollcall-intermediate-renew@NAME.timer): it posts a CSR
from the same key with the token to /api/v1/ca/intermediates/NAME/renew.
The region signs again in the last third of the certificate's life, or
at once when another root signs since a rotation's switch, always with
the constraints it was first given; otherwise 204. The script checks the
answer (a CA certificate for its key, from a root it holds), keeps the
old file, keeps the region's roots and the active root current from
/ca-bundle.pem, and reloads (RELOAD).

Attention: an intermediate under 30 days from its end, whose last renewal
failed or whose host has not asked for three days shows in rollcall
doctor, on the web UI's overview, and one from the old root in the
rotation status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-11-01 17:33:31 +01:00
1 parent a5378dc291
commit 05861bd413
14 files changed
+640 -73

No files matched your search

+28
View File
@@ -587,6 +587,34 @@ plane is: `ca_dir` (default `/etc/rollcall/ca`) holds `ca.pem` and
can be issued. Roots created before this (path length 0) cannot delegate:
rotate the root (below). `deploy/tags/acme-cert.yaml` is a tag that fetches
a node certificate at first boot and renews it.
* **Intermediates renew themselves.** The region keeps every intermediate it
signs and prints a renewal token once (`NAME.token` next to `NAME.pem`). On
the host with the intermediate's key, `deploy/rollcall-intermediate-renew.sh`
(installed as `/usr/local/sbin/rollcall-intermediate-renew`) and the
`rollcall-intermediate-renew@NAME.timer` ask the region every day with that
token and a CSR from the same key; settings in
`/etc/rollcall-intermediate/NAME.env`:
```
URL=https://region.example
TOKEN_FILE=/etc/rollcall-intermediate/caddy.token
CERT=/etc/caddy/pki/int.pem
KEY=/etc/caddy/pki/int-key.pem
ROOT=/etc/caddy/pki/root.pem # optional: kept to the active root
RELOAD='systemctl restart caddy' # optional: after a new certificate
```
The region signs again in the last third of the certificate's life, or right
away when another root signs since a rotation's `switch`, always with the
name constraints it was first given; the script checks what comes back (a CA
certificate for its key, from a root it holds), keeps the old file as
`.prev`, keeps the region's roots current from `/ca-bundle.pem`, and runs
`RELOAD`. `rollcall ca intermediates` lists them; one under 30 days from its
end, whose renewal failed or whose host has not asked for three days shows in
`rollcall doctor`, on the web UI's overview and in the rotation status.
`-replace` signs one the region keeps again with a new token (a lost token);
`DELETE /api/v1/ca/intermediates?name=` stops keeping it (it stays valid to
its end: there is no revocation list).
* **Root rotation without re-joining.** In three steps, each followed by a
restart of the region (`systemctl restart rollcall`):