Compliancemanzill.com
CIS Google Cloud Platform Foundation Benchmark v1.2.0

CIS Google Cloud Platform Foundation Benchmark v1.2.0/Cloud SQL Database Services - PostgreSQL Database/60 of 83

6.2.7Ensure 'log_statement' database flag for Cloud SQL PostgreSQL instance is set appropriately

Control family: Cloud SQL Database Services - PostgreSQL Database

Control description

The value of `log_statement` flag determined the SQL statements that are logged. Valid values are:

- `none`

- `ddl`

- `mod`

- `all`

The value `ddl` logs all data definition statements.

The value `mod` logs all ddl statements, plus data-modifying statements.

The statements are logged after a basic parsing is done and statement type is determined, thus this does not logs statements with errors. When using extended query protocol, logging occurs after an Execute message is received and values of the Bind parameters are included.

A value of 'ddl' is recommended unless otherwise directed by your organization's logging policy.

How to implement

ResponsibilityCustomerYou configure and operate this in your own cloud accounts.

This flag decides which SQL statements are written to the log. Setting it to ddl records every change to the database structure (creating, altering or dropping tables, roles and so on), which is what an investigation usually needs, without logging every query. Use a different value only if your logging policy says so.

Before you start

The same on every cloud, before the steps in the tabs.

  • Record in the PostgreSQL configuration standard the log_statement value (ddl unless your logging policy says otherwise), so every new instance starts with it.
  • Make sure the chosen value doesn't log sensitive data you aren't allowed to keep.

Evidence

  • The PostgreSQL configuration standard

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_statement to ddl on each PostgreSQL instance

  1. Sign in to the Google Cloud console at console.cloud.google.com and open SQL.
  2. Choose the PostgreSQL instance and select Edit.
  3. Expand Database flags (shown as Flags on some instances) and choose Add a database flag, or find the flag if it is already listed.
  4. Choose log_statement and set it to ddl, then choose Done.
  5. Choose Save; if the console says the change restarts the instance, schedule it for a quiet period first.
  6. Check it: the instance Overview lists log_statement with the value ddl under Database flags.

Task 2Keep it checked with the Security Health Analytics finding SQL_LOG_STATEMENT

  1. Open Security Command Center > Findings for the organization (Security Health Analytics runs on the Premium tier for most detectors).
  2. In the query editor, filter on category SQL_LOG_STATEMENT with state ACTIVE, and select Apply.
  3. Open each finding, read the resource and the explanation it gives, and set the flag on the instance it names.
  4. Check it: after the next Security Health Analytics scan, no active SQL_LOG_STATEMENT finding remains.

Evidence

  • The Overview of each PostgreSQL instance, listing log_statement set to ddl under Database flags
  • Security Command Center, with no active SQL_LOG_STATEMENT 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.