Control: Ensure that Microsoft Defender for SQL is set to 'On' for critical SQL Servers
Description
Enable "Azure Defender for SQL" on critical SQL Servers.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.sql_server_atp_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.sql_server_atp_enabled --share
SQL
This control uses a named query:
select s.id as resource, case when security -> 'properties' ->> 'state' = 'Disabled' then 'alarm' else 'ok' end as status, case when security -> 'properties' ->> 'state' = 'Disabled' then s.name || ' Azure defender disabled.' else s.name || ' Azure defender enabled.' end as reason , s.resource_group as resource_group , sub.display_name as subscriptionfrom azure_sql_server s, jsonb_array_elements(server_security_alert_policy) security, azure_subscription subwhere sub.subscription_id = s.subscription_id;