Audit
Module for audit trail logging of data changes
Introduction
Section titled “Introduction”The Audit module receives audit events from internal clients (LdapClient, EntraID, JdbcClient) and persists them to a configurable storage backend. It provides a tamper-evident record of all data changes performed by users via pipes.
Audit events are published to an internal event bus address. The module subscribes to this address and writes each event through the configured writer. Failed writes are logged as warnings but do not fail the originating operation.
Configuration
Section titled “Configuration”| Name | Description | Default | Mandatory |
|---|---|---|---|
writer | Storage backend. One of: jsonlines, stdout, logger | jsonlines | |
path | File path for JSON Lines output. Required when writer is jsonlines. |
{ "name": "AuditModule", "config": { "writer": "jsonlines", "path": "/var/log/fortified/audit.jsonl" }}Writers
Section titled “Writers”| Writer | Description |
|---|---|
jsonlines |
Appends one JSON event per line to the configured file path. Default. |
stdout |
Writes JSON events to standard output. Useful for container environments. |
logger |
Writes events through the platform logger at INFO level under the AUDIT logger name. |
Log format
Section titled “Log format”Events are stored as JSON Lines — one JSON object per line. Each event includes:
| Field | Type | Description |
|---|---|---|
timestamp |
ISO-8601 | When the operation occurred |
correlation_id |
string | Trace ID from the originating request |
operation |
string | One of: create, read, update, delete, search |
client_type |
string | Client that performed the operation (e.g. ldap, entra, jdbc) |
data_source |
string | Target data source name |
entity_type |
string | Type of object affected |
entity_id |
string | Identifier of the affected object |
principal |
object | Acting principal with subject and optional attributes fields |
pipe |
string | Name of the pipe that initiated the operation |
changes |
array | Changed values represented by name, action, and value |
Example event
Section titled “Example event”{"timestamp":"2026-04-14T10:23:01.452Z","correlation_id":"a1b2c3","operation":"update","client_type":"ldap","data_source":"default","entity_type":"inetOrgPerson","entity_id":"uid=alice,ou=users,dc=example,dc=com","principal":{"subject":"[email protected]","attributes":{"role":"operator"}},"pipe":"update-user","changes":[{"name":"mail","action":"replace","value":"[email protected]"}]}Per-client audit configuration
Section titled “Per-client audit configuration”Each client module that supports audit logging accepts an audit block in its configuration. All flags default to false.
"audit": { "create": true, "update": true, "delete": true}"audit": { "create": true, "update": true, "delete": true}"audit": { "create": true, "update": true, "delete": true, "read": true}AuditContext
Section titled “AuditContext”Callers pass an AuditContext alongside operations to supply principal identity and correlation context.
| Field | Description |
|---|---|
traceId |
Correlation ID, reused from the existing trace_id concept |
subject |
Identity of the acting principal (e.g. [email protected]). Defaults to anonymous. |
attributes |
Additional principal attributes (e.g. role, tenant) |
The platform resolves AuditContext in this priority order:
- Explicit
AuditContextpassed by the caller - Context derived from the current session
- Default:
anonymousprincipal with the current trace ID