Check ID:
Provider: GCP
Service:
Severity: MEDIUM
Categories:
Resource type:
cloudsql_instance_postgres_log_disconnections_flagProvider: GCP
Service:
cloudsqlSeverity: MEDIUM
Categories:
loggingResource type:
sqladmin.googleapis.com/InstanceWhat this check verifies
Cloud SQL for PostgreSQL instances have thelog_disconnections flag set to on, creating a record each time a client session ends, including its duration and status
Risk
Without disconnection logs, session lifecycles lack visibility, obscuring credential misuse, session hijacking, and short-lived data exfiltration. Weak audit trails hinder correlation and forensics, undermining confidentiality and integrity and slowing incident response.Recommendation
Enablelog_disconnections=on to ensure complete session auditing.
- Pair with
log_connectionsand a consistentlog_line_prefix - Centralize and retain logs; alert on anomalies
- Apply defense in depth with routine review of access and audit events
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_disconnections_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