Control: Ensure 'skip_show_database' database flag for Cloud SQL Mysql instance is set to 'on'
Description
It is recommended to set skip_show_database database flag for Cloud SQL Mysql instance to on.
Usage
Run the control in your terminal:
powerpipe control run gcp_compliance.control.sql_instance_mysql_skip_show_database_flag_on
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run gcp_compliance.control.sql_instance_mysql_skip_show_database_flag_on --share
SQL
This control uses a named query:
select self_link resource, case when database_version not like 'MYSQL%' then 'skip' when database_flags @> '[{"name":"skip_show_database","value":"on"}]' then 'ok' else 'alarm' end as status, case when database_version not like 'MYSQL%' then title || ' not a MySQL database.' when database_flags is null or not (database_flags @> '[{"name":"skip_show_database"}]') then title || ' ''skip_show_database'' database flag not set.' when database_flags @> '[{"name":"skip_show_database","value":"on"}]' then title || ' ''skip_show_database'' database flag set to ''on''.' else title || ' ''skip_show_database'' database flag set to ''off''.' end as reason , location as location, project as projectfrom gcp_sql_database_instance;