For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/default_rules/def-000-ht8.md. A documentation index is available at /llms.txt.

MySQL instance should have the 'skip_show_database' flag set to 'on'

Description

This rule fails when a Cloud SQL for MySQL instance does not set the skip_show_database database flag to on. With the flag on, only users with the SHOW DATABASES privilege can run the SHOW DATABASES statement, which limits who can enumerate the databases on the instance. An instance that does not set the flag fails, because MySQL turns it off by default. Flag names and values are compared case-insensitively, and the instance fails if any skip_show_database entry has a value other than on. Instances running other database engines are skipped, and an instance with a missing or unspecified database version fails because its engine cannot be determined. A database flag with no name also fails, because it could be skip_show_database.

Remediation

Setting this flag restarts the instance. For the flagged instance, set skip_show_database to on by following Configure database flags.

References