Hardening¶
How to protect the CA's machine and network, and the CA from floods. The Production checklist has the whole list.
The machine¶
- A dedicated machine or VM for the CA, with nothing else on it.
- The server runs as its own unprivileged user, with the shipped systemd unit (or the non-root container image).
-
data_diris mode700; the configuration640(root:bastionxp-ca); secret files600. - The root key is offline; the server's keys are encrypted with a TPM-sealed passphrase.
- Name constraints limit the names the CA can issue for.
- Backups are taken, copied off the machine, and kept private.
The network¶
BastionXP CA limits what can grow without a login: ACME accounts and orders (rate limits) and failed LDAP logins. Everything else that changes anything needs a token or a login first, and the public CRL and OCSP answers are cached.
What is left is plain flooding: someone sending many requests to keep the CA busy. Stop it in front of the CA, where it is cheap:
- A firewall that lets only your networks reach the CA's ports. A CA rarely needs to be reachable from the internet.
-
Or a reverse proxy with a limit per address:
If the proxy ends TLS, BastionXP CA sees the proxy's address for every client:
raise acme.limits.accounts_per_ip_per_hour accordingly. A proxy that ends
TLS also needs a certificate for the CA's name; the simplest is TCP
passthrough (the HAProxy example).
Ports¶
| Port | What | Who must reach it |
|---|---|---|
server.address (8443) |
API, ACME, SCEP, logins | requesters, admins, ACME clients, devices, browsers (OIDC) |
server.public_address (8080) |
CRL, OCSP, CA certificates | everything that checks certificates |
metrics.address (9100) |
Prometheus | Prometheus only |
| outbound 80, 443, 53 | ACME challenges (http-01, tls-alpn-01, dns-01) |
the CA reaches the hosts being verified |
| outbound 443, 636 | OIDC provider, LDAP | the CA reaches the identity provider / DCs |
Choosing what to turn on¶
Turn on only what you use: every section of the configuration is off by
default. Restrict ACME to the domains and challenge types you need
(leave out http-01 where the network between CA and hosts is untrusted).
Prefer tokens per device over the SCEP shared challenge.