Check ID:
Provider: GCP
Service:
Severity: MEDIUM
Categories:
Resource type:
cloudsql_instance_postgres_log_min_error_statement_flagProvider: GCP
Service:
cloudsqlSeverity: MEDIUM
Categories:
loggingResource type:
sqladmin.googleapis.com/InstanceWhat this check verifies
Cloud SQL for PostgreSQL uses thelog_min_error_statement flag and expects it set to error, the severity threshold that controls when SQL text is logged with error messages.
Risk
An incorrect threshold skews visibility and exposure:- Lower than
error: logs excessive SQL, risking confidentiality loss and alert noise (monitoring availability). - Higher than
error: omits query context for real errors, weakening audit trail integrity and incident response.
Recommendation
Setlog_min_error_statement to error to balance insight and exposure. Enforce a logging policy that limits sensitive data in queries and supports defense in depth. Periodically review severity and retention to match workload and compliance needs and maintain reliable forensic readiness.
Remediation
- CLI
- Terraform
- Dashboard steps
References
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudSQL/configure-log-min-error-statement-flag.html
- https://cloud.google.com/sql/docs/postgres/flags
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_min_error_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