Audit logging¶
BastionXP records every action that matters for security as an audit event. This includes:
- certificates that are issued, renewed or revoked,
- sign-ins to the portal, failed sign-ins, and locked accounts,
- changes to passwords, second factors and recovery codes,
- tokens that are created,
- authorities, verifiers and certificate profiles that are created, changed or deleted,
- changes to the settings of your organization,
- CA keys that are created, imported or destroyed,
- warnings that a CA will expire soon,
- other operations on the CAs.
You read the events in the portal, on the Activity page. You can also send them to your SIEM, as described below.
Every operation is audited, or it does not happen¶
BastionXP records each operation that changes something twice:
- Before the operation runs. This event has the outcome
pending. - After the operation ran. This event has the outcome
successorfailure. If the operation failed, the event also contains the error.
Both events of one operation have the same request_id.
If BastionXP cannot write the first event, it does not do the
operation. The client then gets the error CA operation halted: audit
logging unavailable. This way, no certificate is ever issued without an
audit record.
BastionXP also writes an audit event when it starts. If it cannot write that event, it does not start.
Where the events go¶
BastionXP always writes the events to its database. The database is the record that counts. You can read the events in the portal, on the Activity page.
You can also have the events sent to a syslog server, for example to
forward them to your SIEM. To turn this on, add an audit section to
/etc/bastionxp/config.yaml, and restart BastionXP:
audit:
backends: [db, syslog]
syslog_network: tcp
syslog_address: siem.example.com:514
syslog_facility: LOG_AUTH
syslog_tag: bastionxp-ca
| Setting | What it means |
|---|---|
backends |
Where to write the events. ["db"] is the default. ["db", "syslog"] also sends them to syslog. |
syslog_network |
tcp or udp, for a syslog server on another machine. Leave it out to use the syslog service of the BastionXP machine. |
syslog_address |
The syslog server on another machine, as host:port. |
syslog_facility |
The syslog facility. LOG_AUTH is the default. You can also use LOG_LOCAL0 to LOG_LOCAL7. |
syslog_tag |
The program name in each syslog message. The default is bastionxp-ca. |
If the syslog server is down¶
Sending events to syslog is best-effort. If the syslog server cannot be reached while BastionXP is running, this is what happens:
- The operation still goes ahead.
- The event is still written to the database, and the Activity page shows it.
- The event does not reach the syslog server. It is not sent again later.
- BastionXP writes a note about the syslog failure in its own log.
When BastionXP starts, it does check that it can reach the syslog server. If it cannot, BastionXP does not start. This shows a mistake in the syslog address at once.
What is recorded¶
Each event has a category. The category tells you what part of BastionXP the event is about. You can filter the Activity page by it, and you can filter your SIEM by it.
| Category | What it covers | Example actions |
|---|---|---|
cert_lifecycle |
Certificates and revocation lists. | created, revoked, cert_renewed, crl_issued, ocsp_response |
token_mgmt |
One-time tokens and API tokens. | created |
acme |
ACME account credentials (external account binding). | created, deleted |
session |
SSH sessions. | |
system |
The server itself. | startup, kek_loaded, kek_load_failed, kek_reencrypted |
authentication |
Sign-ins and the security of administrator accounts. | login, logout, account_locked, password_changed, second_factor_added, second_factor_removed, recovery_codes_made, setup_link_made |
admin_action |
Changes that administrators make. | created, updated, deleted |
key_management |
CA keys, and warnings about CA expiry. | key_generated, key_imported, key_destroyed, root_activated, ca_expiring |
Sign-ins¶
Every sign-in to the portal is an event in the authentication category, whether it succeeds or fails. The event contains the email address, the network address and the time. For a successful sign-in, data also says how the administrator signed in: with the bastionxp password and which second factor (totp, passkey or recovery), or with a single sign-on provider.
A failed sign-in has the outcome failure and the severity warning. Its error_code says why, for example invalid_password, unknown_user or not_pki_admin. After 10 failed sign-ins in a row for one account, BastionXP also writes an account_locked event.
If an administrator signs in with a password while single sign-on is required, because they are an owner or a break-glass admin, the event has "break_glass": true in data and the severity warning. Alert on this in your SIEM. It should be rare.
The event¶
Each syslog message is one JSON object. It has the same fields as the event in the database:
{"time":"2026-11-19T09:06:03Z","severity":"critical","outcome":"success",
"category":"cert_lifecycle","action":"revoked","phase":"response",
"resource_type":"tls_server_cert","resource_id":"7c08f9ed-...",
"authority_id":"servers","actor_id":"a1b2c3...","actor_type":"acme_client",
"actor_email":"","source_ip":"10.0.4.17","request_id":"5f0e...",
"serial_number":"159754838010747272463587377215364660372",
"data":{"reason":1}}
| Field | What it means |
|---|---|
time |
When it happened, in UTC. |
severity |
info, warning or critical. Syslog uses it as the message's priority. |
outcome |
pending, success or failure. |
phase |
request for the event before the operation, response for the event after it. |
category, action |
What kind of operation it was. For example, the category cert_lifecycle with the action created or revoked. |
resource_type, resource_id |
What the operation acted on. |
authority_id |
The certificate authority. |
actor_id, actor_type, actor_email, source_ip |
Who or what did it, and from which address. |
request_id |
The same in both events of one operation. |
serial_number |
The certificate's serial number, for events about a certificate. |
error_code, error_message |
Why the operation failed, for failed operations. |
data |
More details. For example, the reason for a revocation. |