turbot/steampipe-mod-gcp-compliance

Control: Ensure that the 'cross db ownership chaining' database flag for Cloud SQL SQL Server instance is set to 'off'

Description

It is recommended to set cross db ownership chaining 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_cross_db_ownership_chaining_database_flag_off

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run gcp_compliance.control.sql_instance_sql_cross_db_ownership_chaining_database_flag_off --share

SQL

This control uses a named query:

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

Tags