Skip to main content

audit

Hash-chained audit logging with PII detection and compliance export. Events form a cryptographic hash chain per tenant, enabling tamper detection via chain verification. Supports async batching for high throughput.

Used by cmd/worker, cmd/ui.

Usage

import "cruvero/internal/audit"

Key Types / Interfaces

TypeSourceDescription
AuditLoggerlogger.goInterface: Log, Query, VerifyChain, Flush
AuditEventtypes.goImmutable audit event with hash chain fields
PostgresAuditLoggerpostgres_logger.goPostgreSQL-backed logger with async batching and PII detection
AuditQuerytypes.goQuery parameters: tenant, run ID, event types, time range
ChainBreaktypes.goHash chain integrity break with position and mismatch details
LoggerOptionstypes.goConfig: buffer size, batch size, flush interval, PII detection
LoggerStatstypes.goPerformance metrics: total logged, flush failures, dropped events