More Info:

As numerous other recommendations in this section consist of turning on flags for logging purposes, your organization will need a way to manage these logs. You may have a solution already in place. If you do not, consider installing and enabling the open source pgaudit extension within PostgreSQL and enabling its corresponding flag of cloudsql.enable_pgaudit. This flag and installing the extension enables database auditing in PostgreSQL through the open-source pgAudit extension. This extension provides detailed session and object logging to comply with government, financial, & ISO standards and provides auditing capabilities to mitigate threats by monitoring security events on the instance. Enabling the flag and settings later in this recommendation will send these logs to Google Logs Explorer so that you can access them in a central location. to This recommendation is applicable only to PostgreSQL database instances.

Risk Level

Low

Address

Reliability, Security

Compliance Standards

CISGCP, CBP

Triage and Remediation

Remediation

To remediate the PostgreSQL Enable PGAudit Database Flag Should Be On misconfiguration for GCP using GCP console, follow the below steps:

  1. Open the Google Cloud Console and select the project in which your PostgreSQL instance is running.

  2. Navigate to the Cloud SQL Instances page and click on the name of the PostgreSQL instance you want to remediate.

  3. In the instance details page, select the Configuration tab.

  4. In the Configuration tab, click on Edit Configuration.

  5. In the Edit Configuration page, scroll down to the Flags section.

  6. In the Flags section, click on Add item.

  7. In the Add item dialog box, enter the flag name as pgaudit.enabled and set the value to on.

  8. Click on Save to save the configuration changes.

  9. Once the configuration changes are saved, restart the PostgreSQL instance for the changes to take effect.

After following the above steps, the PostgreSQL Enable PGAudit Database Flag Should Be On misconfiguration will be remediated for your GCP PostgreSQL instance.

Additional Reading: