turbot/steampipe-mod-azure-compliance

Control: Long-term geo-redundant backup should be enabled for Azure SQL Databases

Description

This policy audits any Azure SQL Database with long-term geo-redundant backup not enabled.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.sql_database_long_term_geo_redundant_backup_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.sql_database_long_term_geo_redundant_backup_enabled --share

SQL

This control uses a named query:

select
s.database_id resource,
case
when retention_policy_property ->> 'monthlyRetention' <> 'PT0S'
or retention_policy_property ->> 'weeklyRetention' <> 'PT0S'
or retention_policy_property ->> 'yearlyRetention' <> 'PT0S'
then 'ok'
else 'alarm'
end as status,
case
when retention_policy_property ->> 'monthlyRetention' <> 'PT0S'
or retention_policy_property ->> 'weeklyRetention' <> 'PT0S'
or retention_policy_property ->> 'yearlyRetention' <> 'PT0S'
then s.title || ' long-term geo-redundant backup enabled.'
else s.title || ' long-term geo-redundant backup disabled.'
end as reason
, s.resource_group as resource_group
, sub.display_name as subscription
from
azure_sql_database s,
azure_subscription sub
where
sub.subscription_id = s.subscription_id
and s.name <> 'master';

Tags