turbot/steampipe-mod-azure-compliance

Control: Private endpoint connections on Azure SQL Database should be enabled

Description

Private endpoint connections enforce secure communication by enabling private connectivity to Azure SQL Database.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.sql_server_uses_private_link

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

with sql_server_private_connection as (
select
distinct a.id
from
azure_sql_server as a,
jsonb_array_elements(private_endpoint_connections) as connection
where
connection ->> 'PrivateLinkServiceConnectionStateStatus' = 'Approved'
)
select
a.id as resource,
case
when c.id is null then 'alarm'
else 'ok'
end as status,
case
when c.id is null then a.name || ' not uses private link.'
else a.name || ' uses private link.'
end as reason
, a.resource_group as resource_group
, sub.display_name as subscription
from
azure_sql_server as a
left join sql_server_private_connection as c on c.id = a.id,
azure_subscription as sub
where
sub.subscription_id = a.subscription_id;

Tags