turbot/steampipe-mod-terraform-azure-compliance

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 login
powerpipe 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_line
from
terraform_resource
where
type = 'azurerm_storage_account';

Tags