More Info:

Logging hostnames allows for the association of hostname to IP address at the time of connection. This information can aid with incident response efforts particularly in an environment that utilized dynamic IP addresses. Logging hostnames may incur overhead on server performance as for each statement logged, DNS resolution will be required to convert IP address to hostname. Depending on the setup, this may be non-negligible. This recommendation is applicable to PostgreSQL database instances.

Risk Level

Low

Address

Reliability, Security

Compliance Standards

CISGCP, CBP

Triage and Remediation

Remediation

To remediate the PostgreSQL Log Hostname Flag Should Be On misconfiguration for GCP using GCP console, please follow the below steps:

  1. Open the Google Cloud Console and select the project containing the PostgreSQL instance.

  2. In the left navigation menu, select “SQL” to open the Cloud SQL instances page.

  3. Select the PostgreSQL instance for which you want to remediate the misconfiguration.

  4. Click on the “Edit” button at the top of the page to open the instance settings.

  5. Scroll down to the “Flags” section and click on “Add item”.

  6. In the “Name” field, enter “log_hostname” and in the “Value” field, enter “on”.

  7. Click on the “Save” button to save the changes.

  8. Wait for the changes to be applied. This may take a few minutes.

  9. Once the changes are applied, verify that the PostgreSQL Log Hostname Flag is now turned on by checking the PostgreSQL logs.

By following these steps, you should be able to remediate the PostgreSQL Log Hostname Flag Should Be On misconfiguration for GCP using GCP console.

Additional Reading: