Skip to content

Commit c2ccdbb

Browse files
committed
doc: update audit docs
1 parent e94685f commit c2ccdbb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/persistence/postgres/how-to/enable-auditing.md

+9
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@ tags: [postgres, audit, troubleshooting, how-to]
88

99
The cli used for this configuration can only detect sql instances in GCP.
1010

11+
1112
This guide describes how to enable audit logging in your postgreSQL database.
1213

1314
The following steps need to be taken to enable the logging.
1415

1516
1. [Configure database flags](#configure-database-flags-for-your-sql-instance), and configure replication etc.
1617
2. [Configure database internals](#use-the-nais-cli-to-configure-database-internals) to be the primary.
1718

19+
The pgaudit logs will require disk space, monitor disk usage and [enable automatic storage increase](https://doc.nais.io/workloads/application/reference/application-spec/#gcpsqlinstancesdiskautoresize) if necessary.
20+
1821
For more information on audit logging, see the [official documentation](https://cloud.google.com/sql/docs/postgres/pg-audit).
1922

2023
## Configure database flags for your sql instance
2124

25+
!!! info "Changing cloudsql.enable_pgaudit flag"
26+
27+
Changing this flag after first-time setup will restart the postgreSQL instance.
28+
2229
The following database flags must be set before we can enable audit logging.
2330
```text
2431
cloudsql.enable_pgaudit
@@ -49,6 +56,8 @@ Possible values for `pgaudit.log` are as follows (and all combinations of these)
4956
- `function` - Log function calls and do-blocks operations.
5057
- `all` - Log all commands.
5158

59+
Other flags that are available for pgaudit are documented [here](https://github.com/pgaudit/pgaudit/blob/main/README.md#settings).
60+
5261
## Use the nais cli to configure database internals
5362

5463
The nais cli can be used to configure the database internals. This will fail if the necessary database flags have not been configured.

0 commit comments

Comments
 (0)