turbot/azure_insights

Query: compute_virtual_machine_security_groups

Usage

powerpipe query azure_insights.query.compute_virtual_machine_security_groups

SQL

select
nsg.name as "Name",
nsg.provisioning_state as "Provisioning State",
nsg.region as "Region",
nsg.resource_group as "Resource Group",
lower(nsg.id) as "Security Group ID"
from
azure_network_security_group as nsg
left join azure_compute_virtual_machine as vm on vm.network_interfaces @> nsg.network_interfaces
where
lower(vm.id) = $1
and vm.subscription_id = split_part($1, '/', 3);

Dashboards

The query is used in the dashboards: