🤖 Services¶
Services (e.g. daemons requiring an mTLS / TLS certificate) can request their initial certificate from CertBob.
An admin approves the request in the web interface, and from then on the service renews its certificate itself – via CertBob or directly against the CA, without an admin.
Services only need openssl & curl (no step CLI, no JSON).
Hint
To enable service certificates, set the following variables:
LOCAL_ADMINSand / orOIDC_ADMIN_GROUPSSERVICES_FILE(optional)
How it works¶
The service creates its own key & a CSR (CN = service name, also in the SANs).
It submits the CSR with the shared secret, and gets a URL to poll.
While pending, polling returns a verification code, which the service logs.
An admin approves the request in Services, only if the code matches.
Once approved, polling returns the certificate.
It renews the certificate itself, via CertBob or directly at the CA.
Important
Renewing via the CA requires a valid certificate, renewing via CertBob only the approved key.
Renew after about two thirds of the certificate lifetime.
Renewals via the CA aren’t visible in CertBob.
Hint
Admins can revoke an approved service.
CertBob then no longer renews its certificate, and revokes its last known certificate (passively) at the CA, so it can’t be renewed there either.
The certificate stays valid until it expires.
If the service renewed via the CA in the meantime, CertBob doesn’t know its newest certificate, so revoke that one at the CA manually.
Note
Stale requests are removed after
SERVICES_RETENTION_DAYS, i.e. pending requests nobody approved, and rejected or revoked services.Approved services are never removed, since they’re required for renewals.
API¶
Plain HTTP, no JSON: CSRs & certificates are sent as PEM body, everything else as plain text.
All endpoints require the shared services secret as Authorization: Bearer ${SERVICES_SECRET} (401 otherwise).
POST /api/servicesSubmit a CSR (its common name is the service name). Responds with
201and the URL to poll (body &Location, plus the verification code asX-Verification-Code),303when the same CSR was already submitted,400for an invalid CSR,409when another key is pending for the name, and429when there are too many pending requests.GET /api/services/<id>Poll a request. Responds with
202while pending (with the verification code, andRetry-After: 60),200and the PEM certificate chain once approved,403when rejected, and410when revoked.POST /api/services/renewRenew with a CSR of the approved key (same name & SANs). Responds with
200and the renewed certificate, or403when there’s no approved (i.e. not revoked) service with this name, key & SANs.
Hint
The Services page of the web interface shows ready-to-copy openssl & curl commands to request & renew certificates (incl. CertBob’s URL).
Provisioner¶
The certificate is signed via the same provisioner CertBob uses for client certificates (see PROVISIONER_NAME).
Make sure renewals aren’t disabled (disableRenewal) on this provisioner, and that its maximum certificate duration suits your services.