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_endpointSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.cosmosdb_use_virtual_service_endpoint --shareSQL
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_linefrom  terraform_resourcewhere  type = 'azurerm_cosmosdb_account';