Check ID:
Provider: GCP
Service:
Severity: MEDIUM
Categories:
Resource type:
cloudsql_instance_postgres_log_statement_flagProvider: GCP
Service:
cloudsqlSeverity: MEDIUM
Categories:
loggingResource type:
sqladmin.googleapis.com/InstanceWhat this check verifies
Cloud SQL for PostgreSQL instances havelog_statement set to ddl, recording only data definition statements in server logs
Risk
Missingddl logging leaves schema changes untracked, undermining integrity and hindering investigations.
Excessive logging (e.g., all) can inflate volumes, impair availability, raise costs, and leak sensitive values, harming confidentiality.
Recommendation
Configurelog_statement to ddl to capture schema changes without excessive noise. Apply defense in depth: use targeted auditing for data access, restrict and monitor log access with least privilege, and enforce log retention and rotation to protect availability.
Remediation
- CLI
- Terraform
- Dashboard steps
References
Where this check fires
This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable byCheck ID = cloudsql_instance_postgres_log_statement_flag. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to GCP checks