Check ID: cloudsql_instance_mysql_skip_show_database_flag
Provider: GCP
Service: cloudsql
Severity: LOW
Categories: identity-access
Resource type: sqladmin.googleapis.com/Instance

What this check verifies

Cloud SQL MySQL instances configure the skip_show_database database flag to on, limiting use of SHOW DATABASES to accounts with the SHOW DATABASES privilege.

Risk

Without skip_show_database set to on, database names can be exposed to unprivileged users, reducing confidentiality. Attackers can perform schema enumeration and targeted probing, enabling lateral movement and privilege escalation against specific datasets.

Recommendation

Set skip_show_database to on for all Cloud SQL MySQL instances. Enforce least privilege by granting SHOW DATABASES only when necessary and reviewing roles regularly. Use defense in depth: monitor access and admin actions, and plan changes in maintenance windows as flag updates may trigger restarts.

Remediation

gcloud sql instances patch <INSTANCE_NAME> --database-flags=skip_show_database=on

References

Where this check fires

This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable by Check ID = cloudsql_instance_mysql_skip_show_database_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