Cerbos audit logging captures detailed records of authorization decisions and API access for compliance, debugging, and analytics.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cerbos/cerbos/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Audit logs provide visibility into:- Access Logs: API requests and responses
- Decision Logs: Policy evaluation results for CheckResources and PlanResources calls
file: Write logs to local files with rotationlocal: Store logs in embedded BadgerDB databasehub: Send logs to Cerbos Hubkafka: Stream logs to Kafka topics
Basic Configuration
Enable or disable audit logging globally.
Audit backend to use:
file, local, hub, or kafka.Enable logging of API access events.
Enable logging of policy decision events.
Metadata Filtering
Control which gRPC metadata (headers) are included in audit logs.List of metadata keys to include in logs. If empty, all metadata is included.
List of metadata keys to exclude from logs. Takes precedence over
includeMetadataKeys.Decision Log Filters
Reduce log volume by filtering decision logs based on outcomes.CheckResources Filters
Ignore decisions where all actions are allowed (no EFFECT_DENY).
PlanResources Filters
Ignore all plan responses. Takes precedence over other filters.
Ignore ALWAYS_ALLOWED plan responses.
File Backend
Write audit logs to local files with automatic rotation.Path to the log file. Special values:
stdout, stderr.Additional paths to mirror log output. Use with caution due to performance impact.
Log Rotation
Maximum size of individual log files in megabytes before rotation.
Maximum age in days of old log files before deletion.
Maximum number of rotated files to retain.
Writing to stdout
Writing to stdout is useful for container environments where logs are collected by external systems.
Local Backend
Store audit logs in an embedded BadgerDB database for querying via Admin API.Directory path to store the BadgerDB database.
How long to retain audit records. Min:
1h, Max: 720h (30 days).Advanced Settings
Number of records to buffer before writing.
Maximum number of records to write in a single batch.
Interval to flush buffered records. Min:
1s.Interval to run garbage collection for expired records.
Local backend enables querying audit logs via the Admin API’s audit log endpoints.
Cerbos Hub Backend
Send audit logs to Cerbos Hub for centralized management and analytics.Local storage path for buffering logs before sending to Hub.
How long to retain logs locally before deletion.
Masking Sensitive Data
JSONPath expressions to mask in peer information.
Metadata keys to mask.
JSONPath expressions to mask in CheckResources logs.
JSONPath expressions to mask in PlanResources logs.
Ingest Configuration
Minimum duration between Hub ingest requests. Min:
2s.Maximum timeout for each ingest request. Max:
10s.Number of goroutines for streaming logs from local DB.
Maximum cumulative size in bytes for a batch of log entries (4MB).
Pipe Output
Enable piping logs to another backend in addition to Hub.
Additional backend to send logs to:
file, local, or kafka.Kafka Backend
Stream audit logs to Kafka topics for real-time processing.List of Kafka broker addresses.
Kafka topic to write audit entries to.
Encoding format:
json or protobuf.Acknowledgment mode:
none, leader, or all. Idempotency disabled when not all.Client ID reported in Kafka connections.
Compression algorithms in priority order:
none, gzip, snappy, lz4, zstd.Timeout when closing client to flush remaining messages.
Maximum records to buffer in memory in async mode.
Force synchronous message production. Significant performance impact.
TLS Authentication
Path to CA certificate for verifying broker certificates.
Path to client certificate for mutual TLS.
Path to client private key for mutual TLS.
Interval to reload TLS certificates. Set to
0 to disable.Skip verification of server certificate chain and hostname.