Control: Storage accounts should restrict network access using virtual network rules
Description
Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.storage_account_restrict_network_access
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.storage_account_restrict_network_access --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'network_rules') is null then 'alarm' when (attributes_std -> 'network_rules' ->> 'default_action') = 'Deny' then 'ok' else 'alarm' end status, split_part(address, '.', 2) || case when (attributes_std -> 'network_rules') is null then ' allows network access' when (attributes_std -> 'network_rules' ->> 'default_action') = 'Deny' then ' restricts network access' else ' allows network access' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type = 'azurerm_storage_account';