turbot/gcp_compliance

Query: sql_instance_sql_external_scripts_enabled_database_flag_off

Usage

powerpipe query gcp_compliance.query.sql_instance_sql_external_scripts_enabled_database_flag_off

SQL

select
self_link resource,
case
when database_version not like 'SQLSERVER%' then 'skip'
when database_flags @> '[{"name":"external scripts enabled","value":"off"}]' 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":"external scripts enabled"}]')
then title || ' ''external scripts enabled'' not set.'
when database_flags @> '[{"name":"external scripts enabled","value":"off"}]'
then title || ' ''external scripts enabled'' database flag set to ''off''.'
else title || ' ''external scripts enabled'' database flag set to ''on''.'
end as reason
, location as location, project as project
from
gcp_sql_database_instance;

Controls

The query is being used by the following controls: