Control: Storage accounts 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 your storage account, data leakage risks are reduced.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.storage_account_uses_private_link
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.storage_account_uses_private_link --share
SQL
This control uses a named query:
with storage_account_connection as ( select distinct a.id from azure_storage_account as a, jsonb_array_elements(private_endpoint_connections) as connection where connection -> 'properties' -> 'privateLinkServiceConnectionState' ->> 'status' = 'Approved')select distinct a.id as resource, case when s.id is null then 'alarm' else 'ok' end as status, case when s.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 subscriptionfrom azure_storage_account as a left join storage_account_connection as s on a.id = s.id, azure_subscription as subwhere sub.subscription_id = a.subscription_id;