pellepelster / solidblocks

Solidblocks is a library of reusable components for infrastructure operation, automation and developer experience
https://pellepelster.github.io/solidblocks/
MIT License
25 stars 5 forks source link

RDS: Configure PG_AUDIT #17

Open flobaader opened 1 year ago

flobaader commented 1 year ago

The Bitnami Docker Image provides a way to enable and configure the pg_audit module. A basic first implementation would be perfectly fine.

Bitnami Config:

Auditing
The Bitnami PostgreSQL Image comes with the pgAudit module enabled by default. Thanks to this, audit information can be enabled in the container with these environment variables:

POSTGRESQL_PGAUDIT_LOG: Comma-separated list with different operations to audit. Find in the [official pgAudit documentation](https://github.com/pgaudit/pgaudit#configuration) the list of possible values. No defaults.
POSTGRESQL_PGAUDIT_LOG_CATALOG: Session logging enabled in the case where all relations in a statement are in pg_catalog. No defaults.
POSTGRESQL_LOG_CONNECTIONS: Add log entry for logins. No defaults.
POSTGRESQL_LOG_DISCONNECTIONS: Add log entry for logouts. No defaults.
POSTGRESQL_LOG_HOSTNAME: Log the client hostname. No defaults.
POSTGRESQL_LOG_LINE_PREFIX: Define the format of the log entry lines. Find in the [official PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-logging.html) the string parameters. No defaults.
POSTGRESQL_LOG_TIMEZONE: Set the timezone for the log entry timestamp. No defaults.