Check ID:
Provider: GCP
Service:
Severity: MEDIUM
Categories:
Resource type:
cloudsql_instance_postgres_log_connections_flagProvider: GCP
Service:
cloudsqlSeverity: MEDIUM
Categories:
loggingResource type:
sqladmin.googleapis.com/InstanceWhat this check verifies
Cloud SQL for PostgreSQL instances have thelog_connections flag set to on, causing the server to record every connection attempt and the result of client authentication.
Risk
Without connection logs, unauthorized access attempts can go unnoticed. Attackers may brute-force or reuse credentials without audit evidence, enabling stealthy data access (confidentiality), changes via compromised accounts (integrity), and connection floods that impact service (availability).Recommendation
Enablelog_connections=on for all PostgreSQL instances.
- Apply defense in depth: also capture disconnects and audit events
- Centralize logs, retain them, and alert on anomalies
- Enforce least privilege and strong authentication to reduce exposure and improve detection
Remediation
- CLI
- Terraform
- Dashboard steps
References
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudSQL/enable-log-connections-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_connections_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