Description
Enable log_checkpoints
on PostgreSQL flexible servers
.
Rationaleβ
Enabling log_checkpoints
helps the PostgreSQL Database to Log each checkpoint
, which in turn generates query and error logs. However, access to transaction logs is not supported. Query and error logs can be used to identify, troubleshoot, and repair configuration errors and sub-optimal performance.
Auditβ
From Azure Portalβ
- From Azure Home select the Portal Menu.
- Go to
Azure Database for PostgreSQL flexible servers
. - For each database, under
Settings
, clickServer parameters
. - In the filter bar, type
log_checkpoints
. - Ensure that the
VALUE
forlog_checkpoints
is set toON
.
From Azure CLIβ
Ensure the below command returns a value
of on
:
az postgres flexible-server parameter show --resource-group <resourceGroup> --server-name <serverName> --name log_checkpoints
From PowerShellβ
Ensure the below command returns a value
of on
:
Get-AzPostgreSqlFlexibleServerConfiguration -ResourceGroupName <resourceGroup> -ServerName <serverName> -Name log_checkpoints
From Azure Policyβ
If referencing a digital copy of this Benchmark, clicking a Policy ID will open a link to the associated Policy definition in Azure.
- Policy ID: 70be9e12-c935-49ac-9bd8-fd64b85c1f87 - Name:
Log checkpoints should be enabled for PostgreSQL flexible servers
Default Valueβ
By default log_checkpoints
is enabled (set to on
).
Referencesβ
- https://learn.microsoft.com/en-us/rest/api/postgresql/flexibleserver/configurations/list-by-server
- https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-configure-server-parameters-using-portal
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-logging-threat-detection#lt-3-enable-logging-for-security-investigation
- https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-logging#configure-logging
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/get-azpostgresqlflexibleserverconfiguration?view=azps-12.2.0#example-1-get-specified-postgresql-configuration-by-name
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/update-azpostgresqlflexibleserverconfiguration?view=azps-12.2.0#example-1-updatae-specified-postgresql-configuration-by-name