CIS Google Cloud Platform Foundation Benchmark v1.2.0/Cloud SQL Database Services - PostgreSQL Database/61 of 83
6.2.8Ensure 'log_hostname' database flag for Cloud SQL PostgreSQL instance is set appropriately
Control family: Cloud SQL Database Services - PostgreSQL Database
Control description
PostgreSQL logs only the IP address of the connecting hosts. The `log_hostname` flag controls the logging of `hostnames` in addition to the IP addresses logged. The performance hit is dependent on the configuration of the environment and the host name resolution setup. This parameter can only be set in the `postgresql.conf` file or on the server command line.
How to implement
ResponsibilityCustomerYou configure and operate this in your own cloud accounts.
PostgreSQL always logs the client's IP address. Turning log_hostname on makes it also look up the host name for every connection, which adds delay and depends on DNS being right. Keeping it off is the usual choice.
Before you start
The same on every cloud, before the steps in the tabs.
- Record in the PostgreSQL configuration standard that log_hostname is off, so every new instance starts with it.
- Rely on the logged IP addresses, with your own name lookups when investigating.
Evidence
- The PostgreSQL configuration standard
Not applicable. This benchmark covers Google Cloud only.
Not applicable. This benchmark covers Google Cloud only.
On Google Cloud the tasks set the flag on each PostgreSQL instance in Cloud SQL, then watch for instances without it with Security Command Center.
Task 1Set log_hostname to off on each PostgreSQL instance
- Sign in to the Google Cloud console at console.cloud.google.com and open SQL.
- Choose the PostgreSQL instance and select Edit.
- Expand Database flags (shown as Flags on some instances) and choose Add a database flag, or find the flag if it is already listed.
- Choose log_hostname and set it to off, then choose Done.
- Choose Save; if the console says the change restarts the instance, schedule it for a quiet period first.
- Check it: the instance Overview lists log_hostname with the value off under Database flags.
Task 2Keep it checked with the Security Health Analytics finding SQL_LOG_HOSTNAME_ENABLED
- Open Security Command Center > Findings for the organization (Security Health Analytics runs on the Premium tier for most detectors).
- In the query editor, filter on category SQL_LOG_HOSTNAME_ENABLED with state ACTIVE, and select Apply.
- Open each finding, read the resource and the explanation it gives, and set the flag on the instance it names.
- Check it: after the next Security Health Analytics scan, no active SQL_LOG_HOSTNAME_ENABLED finding remains.
Evidence
- The Overview of each PostgreSQL instance, listing log_hostname set to off under Database flags
- Security Command Center, with no active SQL_LOG_HOSTNAME_ENABLED finding
Console steps as of 5 November 2026. Not every step has been confirmed in a live console yet, and menus and labels can move between releases, so look for the nearest match if one has changed.