Files
cozystack/packages/apps/postgres/tests
IvanHunters 902909dbe7 feat(postgres): add an audit toggle for access and statement logging
Managed Postgres could already load pgaudit through the
sharedPreloadLibraries allowlist and set pgaudit.log and log_connections
through postgresql.parameters, but that leaves an orchestrator depending
on internal parameter names to answer who connected and what they ran.

This adds an audit block that bundles access and statement auditing
behind one switch. With audit.enabled the chart adds pgaudit to
shared_preload_libraries and seeds pgaudit.log (from audit.log,
default "write, ddl, role"), log_connections and log_disconnections. The
parameters are seeded as defaults, so an explicit pgaudit.log or
log_connections in postgresql.parameters still wins. The audit trail
goes to the instance log, which the platform log stack already collects,
so it is queryable per database without extra wiring.

Postgres only; the other managed databases are left for follow-ups.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-23 17:25:17 +03:00
..