Skip to content

How BastionXP CA works

BastionXP CA is one certificate authority in one binary. This page explains its parts and what happens when a certificate is requested. The pages in this section go deeper into each part.

The parts

Part What it is
The CA A root certificate, an intermediate certificate, an SSH user CA key and an SSH host CA key, created by bxp init. See PKI hierarchy.
The data directory data_dir: the CA's keys and certificates, and bastionxp-ca.db, a SQLite database with every issued certificate, the used tokens and the ACME accounts and orders.
The server bxp serve: an HTTPS server that signs certificates, speaks ACME and SCEP, and publishes the CA's certificates, CRL and OCSP.
The client bxp trust, tls, ssh, acme, scep, renew: the same binary, on the machines that need certificates.
The configuration One YAML file, read by the CA-side commands. Clients need no configuration file. See Configuration.

How a certificate is issued

Every certificate, whichever way it is requested, goes through the same steps:

A request passes the verifier, the policy, the profile and the name constraints; then the CA signs, records the certificate and writes an audit log line. A failure at any step means no certificate. A request passes the verifier, the policy, the profile and the name constraints; then the CA signs, records the certificate and writes an audit log line. A failure at any step means no certificate.

  1. A verifier checks who is asking: a one-time token, a login with the identity provider or the directory, an ACME challenge, a SCEP challenge, or a renewal proof. See Verifiers.
  2. The policy of that verifier decides which names the requester may have: the names in the token, the principals of the access rules, the domains allowed for ACME, and so on.
  3. A profile fixes the technical content: key usages, lifetime, which kinds of names are allowed. See Certificate profiles.
  4. The CA checks the result against the name constraints of its own intermediate, the way clients will. See Name constraints.
  5. The CA signs, records the certificate in its database, and writes a certificate issued line to its audit log.

Nothing else signs certificates. A failure at any step means no certificate, and a clear error for the requester.

Where things run

Client commands and other clients on any machine reach bxp serve on the CA machine over HTTPS, ACME, SCEP or the API; bxp serve and the CA-side commands read bastionxp-ca.yaml and share data_dir Client commands and other clients on any machine reach bxp serve on the CA machine over HTTPS, ACME, SCEP or the API; bxp serve and the CA-side commands read bastionxp-ca.yaml and share data_dir

  • The CA-side commands read the configuration file and the data directory directly. They run on the CA machine, as the CA's user.
  • The client commands need only the server's address and its root certificate, which bxp trust saves once. They never read the CA's configuration or keys.
  • An administrator who logs in with OIDC or LDAP can also create tokens from their own machine; the server then makes the token.

Private keys stay where they are made

Requesters create their key pairs themselves. Only certificate signing requests (CSRs) and public keys travel to the CA. The CA never sees a requester's private key, and it never generates keys for anyone.