turbot/azure_compliance

Query: iot_hub_private_link_used

Usage

powerpipe query azure_compliance.query.iot_hub_private_link_used

SQL

select
a.id as resource,
case
-- Only applicable to standard tier
when sku_tier = 'Basic' then 'skip'
when pec -> 'properties' -> 'privateLinkServiceConnectionState' ->> 'status' = 'Approved' then 'ok'
else 'alarm'
end as status,
case
when sku_tier = 'Basic' then a.name || ' is of ' || sku_tier || ' tier.'
when pec -> 'properties' -> 'privateLinkServiceConnectionState' ->> 'status' = 'Approved' then a.name || ' using private link.'
else a.name || ' not using private link.'
end as reason,
a.resource_group as resource_group,
sub.display_name as subscription
from
azure_iothub a,
jsonb_array_elements(private_endpoint_connections) as pec,
azure_subscription sub
where
sub.subscription_id = a.subscription_id;

Controls

The query is being used by the following controls: