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