More Info:
Ensure that “log_checkpoints” server parameter is enabled for all PostgreSQL flexible database servers available within your Microsoft Azure cloud account. The “log_checkpoints” parameter allows checkpoints and restart points to be logged in the Azure PostgreSQL server log.Risk Level
MediumAddress
SecurityCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
To enable the
log_checkpoints
parameter for PostgreSQL Flexible Servers in Azure, you can follow the below steps:- Open the Azure portal and go to your PostgreSQL Flexible Server resource.
- In the left-hand menu, click on the “Configuration” option.
- In the “Configuration” blade, click on the “Edit” button located at the top.
-
In the “Edit configuration” blade, search for the
log_checkpoints
parameter in the “Parameters” section. -
If the parameter is not present, click on the “Add parameter” button and enter the following details:
- Name: log_checkpoints
- Value: on
- If the parameter is already present, click on the parameter and change its value to “on”.
- Click on the “Save” button to save the changes.
- Once the changes are saved, the PostgreSQL Flexible Server will be restarted to apply the new configuration.
-
After the server is restarted, the
log_checkpoints
parameter will be enabled and the server will start logging checkpoint activities.
log_checkpoints
parameter enabled for PostgreSQL Flexible Servers in Azure.Using CLI
Using CLI
To remediate the misconfiguration “Enable log_checkpoints Parameter for PostgreSQL Flexible Servers” for Azure using Azure CLI, you can follow the below steps:Step 1: Open Azure CLI and login to your Azure account using the command:Step 2: Once you are logged in, select the Azure subscription where your PostgreSQL Flexible Server is running using the command:Step 3: Now, enable the log_checkpoints parameter for your PostgreSQL Flexible Server using the following command:Make sure to replace This will display the current value of the log_checkpoints parameter.That’s it! You have now successfully remediated the misconfiguration “Enable log_checkpoints Parameter for PostgreSQL Flexible Servers” for Azure using Azure CLI.
<resource_group_name>
and <server_name>
with the actual resource group name and server name where your PostgreSQL Flexible Server is running.Step 4: Verify that the parameter has been enabled successfully using the following command:Using Python
Using Python
To enable the The complete code snippet to enable the
log_checkpoints
parameter for PostgreSQL Flexible Servers on Azure using Python, you can follow these steps:- Install the
azure-mgmt-postgresql
Python package using pip:
- Import the necessary modules:
- Set up the credentials for authentication:
- Create the
PostgreSQLManagementClient
object:
- Get the current server configurations:
- Check if the
log_checkpoints
parameter is already enabled:
- If the
log_checkpoints
parameter is not enabled, create a new configuration object and update the server configuration:
- Verify that the
log_checkpoints
parameter is now enabled:
log_checkpoints
parameter for PostgreSQL Flexible Servers on Azure using Python is as follows: