Files
cozystack/packages/system/postgres-rd
IvanHunters 61e0839e0e fix(postgres): validate audit.log and match audit keys case-insensitively
Review on #5404 surfaced three issues with the audit toggle:

- audit.log was a free string, so a mistyped class (write, ddl, rol)
  rendered unchanged and pgaudit fell back to none at the next restart,
  silently disabling auditing. Add a schema pattern over the pgaudit
  class list so a bad class is rejected at admission.
- The explicit-parameter-wins guard matched keys case-sensitively, so a
  user key like pgaudit.LoG landed beside the lowercase seed and
  PostgreSQL, which is case-insensitive, picked the seed. Match the user
  keys lowercased.
- The connection-logging and empty-log guards were untested. Cover
  log_disconnections, an empty pgaudit.log, an empty audit.log and a
  case-variant key.

Also note in the field docs that write/all record statement text, so the
audit trail is readable by anyone with access to the log stack.

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