Skip to content

PKI hierarchy

BastionXP CA has exactly one root, one intermediate, one SSH user CA and one SSH host CA. bxp init creates all of them.

X.509: the root CA signs the intermediate CA, which signs TLS certificates and CRL and OCSP answers. SSH: the user and host CA keys sign user and host certificates directly X.509: the root CA signs the intermediate CA, which signs TLS certificates and CRL and OCSP answers. SSH: the user and host CA keys sign user and host certificates directly

The root CA

  • The trust anchor: machines that should trust certificates from BastionXP CA install root.crt.
  • Valid for 10 years by default (ca.root_validity, 1 to 30 years), set once at init.
  • Its private key is always encrypted with a passphrase of at least 12 characters, and is used only to create or replace the intermediate. The running server never reads it. Keep it offline: see Protect the CA keys.
  • Its SHA-256 fingerprint identifies the CA. Clients check it with bxp trust.

The intermediate CA

  • Signs every TLS certificate, the CRL and the OCSP answers.
  • Valid for 3 years by default (ca.intermediate_validity, from 1 year up to the root's lifetime). It never outlives the root, and TLS certificates never outlive it. The server warns a fifth of its lifetime before it expires (at most a year).
  • Carries the CA's name constraints, if you set any.
  • Replaced in place with bxp new-intermediate. The server always uses exactly one intermediate.

Every TLS certificate is handed out followed by the intermediate (the .crt files hold both), so clients that trust the root can build the chain.

The SSH CAs

SSH has no certificate chains: servers and clients trust the CA keys themselves.

Key Signs Trusted by
ssh_user_ca user certificates (logins) SSH servers, with TrustedUserCAKeys in sshd_config
ssh_host_ca host certificates (servers) SSH clients, with an @cert-authority line in known_hosts

Replacing an SSH CA key takes two steps, so the new key is trusted everywhere before it signs anything: see Replace an SSH CA key.

Key types

ca.key_type chooses the CA keys' algorithm at init:

key_type CA keys
ecdsa (default) ECDSA P-256
rsa RSA 3072 bits

Requesters choose their own key types, within what the profile allows: ECDSA P-256/P-384/P-521, RSA 2048 bits or more, and Ed25519. SCEP devices need RSA keys (see SCEP).

Under an existing root

If your machines already trust a company root, for example from Active Directory Certificate Services (AD CS), BastionXP CA can run under it: the company's CA signs BastionXP CA's intermediate, and nothing new has to be trusted. There is then no root key on the BastionXP CA side. See Under an existing root.

The company root CA signs an optional issuing CA, which signs the BastionXP CA intermediate, which signs TLS certificates The company root CA signs an optional issuing CA, which signs the BastionXP CA intermediate, which signs TLS certificates

Files in the data directory

File Created by What it is
root.crt init The root certificate. Public.
root.key init The root key, encrypted. Move it offline (or use --root-key-out).
intermediate.crt, intermediate.key init The intermediate CA.
ssh_user_ca.key, ssh_user_ca.pub init The SSH user CA.
ssh_host_ca.key, ssh_host_ca.pub init The SSH host CA.
token.key init Signs the one-time tokens.
chain.crt new-intermediate --import The company CA certificates, under an existing root.
bastionxp-ca.db first serve The database. Back it up with the keys.
scep_ra.key, scep_ra.crt first serve with SCEP on The SCEP server's own RSA key and certificate.
replaced/ key rotation Certificates and public keys of replaced CA keys, for the record.

All .key files are secrets: anyone who can read them can create certificates or tokens.