More Info:

PostgreSQL does not log attempted connections by default. Enabling the log_connections setting will create log entries for each attempted connection as well as successful completion of client authentication which can be useful in troubleshooting issues and to determine any unusual connection attempts to the server. This recommendation is applicable to PostgreSQL database instances.

Risk Level

Medium

Address

Security

Compliance Standards

CISGCP, CBP, SOC2, PCIDSS, NISTCSF

Triage and Remediation

Remediation

To remediate the “PostgreSQL Log Connections Flag Should Be On” misconfiguration on GCP using the GCP console, follow these steps:

  1. Go to the GCP Console and select the project that contains the PostgreSQL instance that needs to be remediated.
  2. In the left navigation pane, select “SQL” under the “Storage” section.
  3. Select the PostgreSQL instance that needs to be remediated.
  4. Click on the “Edit” button at the top of the page.
  5. Scroll down to the “Flags” section and click on the “Add Flag” button.
  6. In the “Name” field, enter “log_connections”.
  7. In the “Value” field, enter “on”.
  8. Click on the “Save” button at the bottom of the page to apply the changes.
  9. Wait for a few minutes for the changes to take effect.

After completing these steps, the “PostgreSQL Log Connections Flag Should Be On” misconfiguration will be remediated for the PostgreSQL instance on GCP.

Additional Reading: