Audit & Snapshots
Overview
coreX Platform tracks every configuration mutation as an audit event and creates config snapshots on each apply. This provides a complete change history with the ability to revert pending changes or roll back to any previous configuration.
Audit Events
Every POST, PUT, DELETE, and PATCH on /api/v1/* is logged as an audit event. GET requests and health checks are not logged.
Event Properties
| Property | Description |
|---|---|
action | Semantic label (e.g. create_backend, apply_config, login) |
method | HTTP method |
path | Request path |
resource_type | Type of resource affected |
resource_id | ID of the resource |
payload | Request body (truncated, secrets redacted) |
snapshot_id | Config snapshot this event was bundled into |
user_id | ID of the user who made the change |
username | Username of the user |
ip_address | Source IP of the request |
status_code | Response status code |
config_change | Whether this event affects generated config (see below) |
created_at | Timestamp |
Config Change Classification
Each audit event is classified as config_change=True or config_change=False:
config_change=True— the mutation affects a generated config file (HAProxy, Coraza, Varnish, MCP bundle, security-list files, risk-rules data). These events appear in the “Pending Changes” section until applied.config_change=False— the mutation doesn’t affect any generated config (auth, user management, captcha keys, WAF snapshots, Vector operations, validation-only, cache flush, API Armor runtime, Page Protect observational data, MCP operational endpoints, SSL Labs scans, etc.). These events appear in the “Other Activity” section and don’t require an apply.
This classification prevents the “Pending Changes” banner from showing events that don’t need a config apply.
Action Derivation
Actions are auto-derived from the method and path:
POST→create_<resource>PUT→update_<resource>DELETE→delete_<resource>- Special-case mappings for auth, config lifecycle, cert operations, WAF imports, feed refreshs, API Armor, MCP Gateway, SSL Labs, and more
Payload Handling
- Auth paths (login, token, TOTP, logout, refresh) are never captured
POST /certificates(contains private keys) is never captured- MCP server and identity creation (contains secrets) is never captured
- Vector sink creation/test (contains plaintext secrets) is never captured
- Non-JSON content types are not captured
- Payloads are truncated to 16KB (configurable via
AUDIT_PAYLOAD_MAX_BYTES) - Truncated payloads are flagged with a
_truncatedmarker
Config Status, Diff, and Preview
coreX Platform tracks whether there are unapplied changes by comparing the currently applied config files against freshly generated ones.
Compared Config Files
| File | Description |
|---|---|
haproxy.cfg | Main HAProxy configuration |
varnish.vcl | Varnish VCL (only when disk cache is enabled) |
| MCP bundle | MCP gateway config bundle (compared as decrypted plaintext — Fernet uses a random IV, so ciphertext comparison would always show a diff) |
| Vector config | Vector vector.toml (compared on full text for the unapplied flag, but only redacted text is surfaced in diffs so secrets never leak; skipped entirely when the pipeline is not configured) |
Endpoints
| Endpoint | Description |
|---|---|
GET /config/status | Returns {unapplied: bool} — true if any config file differs |
GET /config/diff | Returns a unified diff of all changed config files (redacted) |
GET /config/preview | Returns the generated HAProxy config (without applying) |
GET /config/preview-all | Returns all generated config files as {label: content} |
The Dashboard shows an “Unapplied Changes” banner when config/status returns true.
Config Snapshots
When you click Apply Changes, coreX Platform:
- Generates the full HAProxy configuration (and Varnish VCL, MCP bundle, Vector config if enabled)
- Validates it
- Saves a
ConfigSnapshotwith the configuration stored on disk and a diff of what changed - Stamps all pending (un-applied) audit events with the snapshot ID
- Applies the configuration to HAProxy
This links every audit event to the snapshot it was included in, showing which changes were bundled together.
Snapshot Properties
| Property | Description |
|---|---|
id | Unique snapshot ID |
comment | Optional description |
created_at | Timestamp |
created_by | User who applied |
diff | Diff of what changed in this apply |
snapshot_path | Path to the full config file on disk |
Max Snapshots
The maximum number of snapshots to retain is configurable:
GET /config/snapshots/max— read the current limitPUT /config/snapshots/max— set the limit (default: 10)
When the limit is reached, the oldest snapshots are pruned. Audit events linked to pruned snapshots remain visible in the “Earlier applies” bucket.
Revert vs Rollback
coreX Platform has two distinct operations for undoing changes:
Revert (Discard Pending Changes)
POST /config/revert — reverts to the last applied config, discarding all pending (un-applied) changes. Use this when you’ve made changes but haven’t applied them yet and want to undo them.
- Requires confirmation (
confirmed: true) - No new snapshot is created (no apply happened)
- Pending audit events remain visible but are no longer “pending”
Rollback (Restore a Previous Snapshot)
POST /config/snapshots/{id}/rollback — rolls back to a specific historical snapshot, restoring the full configuration from that point in time.
- Creates a new snapshot for the rollback action (so rollbacks are themselves audited and can be rolled back)
- HAProxy is reloaded with the reverted configuration
- Any changes made after the snapshot will be lost
Rolling back restores the entire configuration from the snapshot, not just individual changes. Any changes made after the snapshot will be lost. Review the snapshot contents before rolling back.
Audit Log Frontend
The audit logs page (Observability > Audit Logs) shows:
- Pending Changes (un-applied, config-affecting) at the top with an amber badge
- Other Activity (non-config, no snapshot) — events that don’t require an apply
- Applied Changes grouped by snapshot below, with expandable groups
- Earlier applies bucket for events whose snapshot was pruned
- Each event row has an expandable payload JSON viewer (with truncation indicator)
- Filters: username, action, resource type, IP address (dropdowns populated from the API), date range, status (all/pending/applied), limit (50/100/250/500)
Export
Audit events can be exported as CSV via GET /audit-events/export. The export respects the current filters and date range. The downloaded filename includes the date range.
Step-by-Step: Review Pending Changes
- Navigate to Observability > Audit Logs
- Pending (un-applied) changes appear at the top with an amber badge
- Review each pending change:
- Click “Show payload” to expand the request body
- Check the action, resource, and user
- Decide whether to apply or revert before applying
Step-by-Step: Apply and Snapshot
- Make configuration changes (e.g. add a listener, update a backend)
- Navigate to the Dashboard
- Review pending changes in the audit log
- Click Apply Changes
- Optionally enter a comment for the snapshot
- coreX Platform generates, validates, and applies the config
- A new snapshot is created and all pending events are linked to it
Step-by-Step: Revert Pending Changes
- Navigate to the Dashboard
- If there are unapplied changes, the “Unapplied Changes” banner appears
- Click Revert (not Apply)
- Confirm the revert
- All pending changes are discarded — the config returns to the last applied state
- The audit events remain visible but are no longer “pending”
Step-by-Step: Rollback to a Previous Config
- Navigate to Observability > Audit Logs
- Find the snapshot group you want to roll back to
- Note the snapshot ID, or use
GET /config/snapshotsto browse all snapshots - Click Rollback on the snapshot (or call
POST /config/snapshots/{id}/rollback) - Confirm the rollback
- A new snapshot is created for the rollback action
- HAProxy is reloaded with the reverted configuration
Step-by-Step: Preview and Diff Before Applying
- Make configuration changes
- Check the Dashboard for the “Unapplied Changes” banner
- Preview the generated config:
curl -k https://localhost/api/v1/config/preview - View the diff between applied and generated config:
curl -k https://localhost/api/v1/config/diff - Review the diff to confirm the changes are correct
- Apply or revert based on your review
Step-by-Step: Export Audit Events
- Navigate to Observability > Audit Logs
- Apply filters (optional): username, action, resource type, IP, date range
- Click Export CSV
- The file downloads with all matching events (filename includes the date range)
Verification
-
Make a change and check the audit log:
# Create a backend (via API or UI) curl -k -X POST https://localhost/api/v1/backends -H "Content-Type: application/json" -d '{"name":"test"}'Then check the audit logs page — the
create_backendevent should appear as pending. -
Check config status:
curl -k https://localhost/api/v1/config/statusExpect:
{"unapplied": true}after making a change. -
Check config diff:
curl -k https://localhost/api/v1/config/diffExpect: a unified diff showing the changes.
-
Apply and verify snapshot:
- Click Apply Changes
- Check that the event is now linked to a snapshot
- Verify the snapshot appears in the snapshots list (
GET /config/snapshots)
-
Rollback and verify:
- Rollback to the previous snapshot
- Verify the backend no longer exists
- Check that a rollback event appears in the audit log
Next Steps
- Users & Settings — Manage users and global settings
- Metrics — Monitor traffic and access logs
- Quick Start — Get started with coreX Platform
- Terraform Provider — Manage config as infrastructure-as-code