Check the setup: bxp doctor¶
checks the CA on this machine and prints one line per check, with a hint for each problem:
$ bxp doctor --config bastionxp-ca.yaml
bxp doctor: bastionxp-ca.yaml
ok the configuration is valid
ok all CA files are in ./bastionxp-ca-data
warn the root key is in data_dir
the server does not need it: move bastionxp-ca-data/root.key to offline storage
warn the server's keys are not encrypted
optional; refer to the BastionXP CA documentation for more information
ok the keys open, and the intermediate is signed by the root
ok the root certificate is valid until 2036-11-12
ok the intermediate certificate is valid until 2031-11-14
ok the database is intact (schema 1, 3 certificates)
ok the server answers at https://localhost:8443
7 ok, 2 warnings, 0 failed
What it checks¶
| Area | Checks |
|---|---|
| Configuration | The file loads and is valid. |
| Files | Every CA file is there, and not readable by other users. |
| Keys | Whether they are encrypted, where the passphrase comes from, and that they open (it never asks for a passphrase). The root key still in data_dir. A next SSH CA key waiting to be activated. |
| Certificates | The expiry of the root and the intermediate (warning a fifth of their lifetime ahead). Their lifetimes versus ca.root_validity and ca.intermediate_validity. Name constraints in the intermediate versus the configuration. |
| Database | Integrity, and the schema version: whether this version will update it at the server's next start, or whether it is from a newer version. |
| Server | Whether it answers, and whether the public address serves this CA's root. |
| Logins | Whether the identity provider (OIDC) or the directory (LDAP) is reachable and accepts the CA. |
It changes nothing¶
doctor only looks: it never writes anything, not even the database's
schema. Run a new BastionXP CA's doctor before switching to it, and it
says what the switch will do:
warn the database has schema 1; this version updates it to 2 when the server starts
back up first (bxp backup), with the version that runs now
In scripts and monitoring¶
The exit status is 1 if a check failed (warnings do not count), so it
can run from monitoring or after every configuration change:
bxp doctor --config /etc/bastionxp-ca/bastionxp-ca.yaml >/dev/null || alert "bastionxp-ca: doctor failed"
Run it as the CA's user, so it sees the files as the server does:
A report for a bug report¶
For a bug report, add --report:
It also writes bastionxp-ca-report-<time>.txt (or the file you name
with --report=<file>), readable only by you, to attach to the issue:
- the version of
bxp, and the checks; - the configuration file as written, with the OIDC client secret and the names in the access rules replaced, and the comments removed;
- the database's schema and size, the certificates counted by profile and state, the ACME accounts and orders counted, and the ACME proofs that failed in the last 7 days, with the CA's reason.
It holds no keys, passphrases, tokens or secrets, and no names of people. It does hold host names, addresses and paths: review it before you share it. It is written even when a check fails, or when the configuration does not load.