turbot/steampipe-mod-terraform-azure-compliance

Control: Cosmos DB should use a virtual network service endpoint

Description

This policy audits any Cosmos DB not configured to use a virtual network service endpoint.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.cosmosdb_use_virtual_service_endpoint

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_azure_compliance.control.cosmosdb_use_virtual_service_endpoint --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std ->> 'virtual_network_rule') is null then 'alarm'
when (attributes_std -> 'virtual_network_rule' ->> 'id') is not null then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'virtual_network_rule') is null then ' ''virtual_network_rule'' not defined'
when (attributes_std -> 'virtual_network_rule' ->> 'id') is not null then ' configured with virtual network service endpointle'
else ' not configured with virtual network service endpoint'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_cosmosdb_account';

Tags