turbot/azure_insights

Query: network_security_groups_for_compute_virtual_machine_scale_set

Usage

powerpipe query azure_insights.query.network_security_groups_for_compute_virtual_machine_scale_set

SQL

with nsg_list as (
select
lower(n -> 'properties' -> 'networkSecurityGroup' ->> 'id') as nsg_id
from
azure_compute_virtual_machine_scale_set as s,
jsonb_array_elements(
virtual_machine_network_profile -> 'networkInterfaceConfigurations'
) n
where
lower(s.id) = $1
)
select
lower(nsg.id) as nsg_id
from
nsg_list as sg
left join azure_network_security_group as nsg on lower(nsg.id) = lower(sg.nsg_id)
where
nsg.id is not null
limit
1