Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of enabling “LOG_CHECKPOINTS” parameter for PostgreSQL servers in Azure, you can follow the below steps:
  1. Open the Azure portal and navigate to the Azure Database for PostgreSQL service.
  2. Select the PostgreSQL server for which you want to enable the “LOG_CHECKPOINTS” parameter.
  3. Click on the “Configuration” option in the left-hand menu.
  4. Under the “Settings” tab, scroll down to the “Custom” section and click on the ”+ Add” button.
  5. In the “Add Configuration Parameter” window, enter “log_checkpoints” in the “Name” field and “on” in the “Value” field.
  6. Click on the “OK” button to save the configuration parameter.
  7. Restart the PostgreSQL server for the changes to take effect.
After completing these steps, the “LOG_CHECKPOINTS” parameter will be enabled for the PostgreSQL server in Azure.

To remediate the “LOG_CHECKPOINTS” parameter misconfiguration for PostgreSQL servers in Azure using Azure CLI, you can follow these steps:
  1. Open the Azure CLI on your local machine or through the Azure portal.
  2. Run the following command to log in to your Azure account:
  1. Once you are logged in, run the following command to list all the available PostgreSQL servers in your Azure account:
  1. Choose the server that you want to remediate and run the following command to get the current configuration settings:
Make sure to replace <resource-group-name> and <server-name> with the actual names of your resource group and server.
  1. Identify whether the “LOG_CHECKPOINTS” parameter is set to “off” or not in the output of the above command.
  2. If the “LOG_CHECKPOINTS” parameter is set to “off”, run the following command to update the configuration and enable it:
Again, replace <resource-group-name> and <server-name> with the actual names of your resource group and server.
  1. Verify the updated configuration by running the command in step 4 again.
  2. Repeat steps 5-7 for any other PostgreSQL servers that have the “LOG_CHECKPOINTS” parameter misconfiguration.
By following these steps, you can remediate the “LOG_CHECKPOINTS” parameter misconfiguration for PostgreSQL servers in Azure using Azure CLI.
To remediate the misconfiguration of enabling the “LOG_CHECKPOINTS” parameter for PostgreSQL servers in Azure using Python, you can follow the below steps:
  1. First, you need to connect to the Azure PostgreSQL server using the psycopg2 library in Python. You can install it using the following command:
  2. Once you have installed the psycopg2 library, you can use the following code snippet to connect to the Azure PostgreSQL server:
    Replace the <your_server_name>, <your_database_name>, <your_username>, and <your_password> with your actual server details.
  3. After connecting to the Azure PostgreSQL server, you can execute the following SQL query to enable the “LOG_CHECKPOINTS” parameter:
    This query will enable the “LOG_CHECKPOINTS” parameter for the Azure PostgreSQL server.
  4. Finally, you can close the connection to the Azure PostgreSQL server using the following code:
    This will close the connection to the Azure PostgreSQL server.
By following the above steps, you can remediate the misconfiguration of enabling the “LOG_CHECKPOINTS” parameter for PostgreSQL servers in Azure using Python.
This change does not force replacement of the PostgreSQL server; it updates the configuration in place (Azure may require a restart of the service, which is handled by the platform).Verification: terraform plan should show creation (or update) of azurerm_postgresql_configuration.log_checkpoints with value = "on" and no replace action for azurerm_postgresql_server.PG_SERVER.