turbot/steampipe-mod-terraform-azure-compliance

Control: Ensure that Advanced Threat Protection (ATP) on a SQL server is set to 'Enabled'

Description

Enable 'Azure Defender for SQL' on critical SQL Servers. It is recommended to enable Azure Defender for SQL on critical SQL Servers. Azure Defender for SQL is a unified package for advanced security capabilities

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.sql_server_atp_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_azure_compliance.control.sql_server_atp_enabled --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'threat_detection_policy') is null then 'alarm'
when (attributes_std -> 'threat_detection_policy' ->> 'state') = 'Disabled' then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'threat_detection_policy') is null then ' does not have ATP enabled'
when (attributes_std -> 'threat_detection_policy' ->> 'state') = 'Disabled' then ' does not have ATP enabled'
else ' has ATP enabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_sql_server';

Tags