Control: IoT Hub device provisioning service instances should use private link
Description
Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to the IoT Hub device provisioning service, data leakage risks are reduced.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.iot_hub_private_link_used
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.iot_hub_private_link_used --share
SQL
This control uses a named query:
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 subscriptionfrom azure_iothub a, jsonb_array_elements(private_endpoint_connections) as pec, azure_subscription subwhere sub.subscription_id = a.subscription_id;