turbot/terraform_azure_compliance

Query: cosmodb_account_restrict_public_access

Usage

powerpipe query terraform_azure_compliance.query.cosmodb_account_restrict_public_access

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std ->> 'public_network_access_enabled') = 'false' then 'ok'
when (attributes_std ->> 'public_network_access_enabled')::boolean and (attributes_std ->> 'is_virtual_network_filter_enabled')::boolean and ((attributes_std ->> 'virtual_network_rule') is not null or (attributes_std ->> 'ip_range_filter') is not null) then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'public_network_access_enabled') = 'false' then 'ok'
when (attributes_std ->> 'public_network_access_enabled')::boolean and (attributes_std ->> 'is_virtual_network_filter_enabled')::boolean and ((attributes_std ->> 'virtual_network_rule') is not null or (attributes_std ->> 'ip_range_filter') is not null) then ' with restricted access'
else ' without restricted access'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_cosmosdb_account';

Controls

The query is being used by the following controls: