Certificate lifecycle¶
A certificate is issued, renewed before it expires, and sometimes revoked. This page shows how each step works for each way of getting certificates.
Issue¶
| Obtained with | How |
|---|---|
| BastionXP CA's API (token or login) | bxp tls, bxp ssh, or POST /v1/x509/sign, /v1/ssh/sign |
| ACME | any ACME client: bxp acme issue, certbot, acme.sh, lego, Caddy, cert-manager |
| SCEP | bxp scep enroll, a device, an MDM profile |
Renew: the same way it was obtained¶
The CA records how each certificate was obtained (api, acme or
scep; the VIA column of bxp list certificates), and renews it only
that way:
| Obtained via | Renew with | Proof |
|---|---|---|
api (TLS, SSH host) |
bxp renew |
the current certificate and its key |
api (SSH user) |
run bxp ssh again |
a new token or login |
acme |
the ACME client: bxp acme renew, certbot renew, ... |
a new order: the names are proved again |
scep |
SCEP RenewalReq: bxp scep renew, or the device |
the current certificate and its key |
bxp renew refuses ACME and SCEP certificates and says what to use.
Common rules of renewal through the API and SCEP:
- The new certificate gets the old one's names, profile and lifetime. Renewal never adds names; that takes a token.
- An expired or revoked certificate cannot be renewed; it needs a new one, with a token.
- The old certificate stays valid until it expires (or is revoked).
- Renewal is due when a third of the lifetime is left. Run the renewal command every hour: it does nothing until then. With 24-hour certificates, a daily run is too seldom.
Revoke¶
bxp revoke <serial> --reason key-compromise # on the CA machine
bxp acme revoke --cert web.crt --reason superseded # by the ACME account
- The running server notices a revocation within seconds, and publishes it in its CRL and OCSP answers.
- A revocation cannot be undone.
- Revoking only helps where programs check: see Revocation.
- Revoking an SSH certificate only stops its renewal: SSH servers do not ask anybody about certificates.
Lifetimes¶
Short lifetimes are the best defence: a certificate that expires in a day needs no revocation. BastionXP CA's built-in profiles are short-lived, and renewal is automatic.
| Profile | Default | Maximum | Renewed when |
|---|---|---|---|
tls-server |
24 hours | 30 days | 8 hours left |
tls-client |
24 hours | 30 days | 8 hours left |
tls-device |
30 days | 90 days | 10 days left |
ssh-user |
16 hours | 24 hours | (request again) |
ssh-host |
30 days | 90 days | 10 days left |
The price of short lifetimes is that renewal must work: if the CA is unreachable for longer than the time left at renewal (8 hours for a 24-hour certificate), certificates start to expire. Keep the CA running, monitor it, and give machines that cannot renew often a longer-lived profile.
A request may ask for a shorter or longer lifetime up to the maximum
(--validity); SCEP and ACME get their profile's default (acme.x509.cert_profile, the token's or scep.static.x509.cert_profile).