turbot/azure_insights

Query: network_security_groups_for_network_interface

Usage

powerpipe query azure_insights.query.network_security_groups_for_network_interface

SQL

with network_security_group_id as (
select
network_security_group_id as sid,
id as nid
from
azure_network_interface
where
lower(id) = $1
and subscription_id = split_part($1, '/', 3)
)
select
lower(nic.sid) as nsg_id
from
network_security_group_id as nic
left join azure_network_security_group as nsg on lower(nsg.id) = lower(nic.sid)
where
lower(nic.sid) is not null;