turbot/azure_compliance

Query: cosmosdb_use_virtual_service_endpoint

Usage

powerpipe query azure_compliance.query.cosmosdb_use_virtual_service_endpoint

SQL

with cosmosdb_with_virtual_network as (
select
distinct a.id
from
azure_cosmosdb_account as a,
jsonb_array_elements(virtual_network_rules) as rule
where
rule ->> 'id' is not null
)
select
a.id as resource,
case
when c.id is null then 'alarm'
else 'ok'
end as status,
case
when c.id is null then a.name || ' not configured with virtual network service endpoint.'
else a.name || ' configured with virtual network service endpoint.'
end as reason,
a.resource_group as resource_group,
sub.display_name as subscription
from
azure_cosmosdb_account as a
left join cosmosdb_with_virtual_network as c on c.id = a.id,
azure_subscription as sub
where
sub.subscription_id = a.subscription_id;

Controls

The query is being used by the following controls: