steampipe plugin install azure

Table: azure_network_interface - Query Azure Network Interfaces using SQL

A Network Interface in Azure is the interconnection between a Virtual Machine (VM) and the underlying Azure VNet. This interface enables an Azure VM to communicate with internet, Azure, and on-premises resources. Network interfaces consist of one or more IP configurations and a network security group.

Table Usage Guide

The azure_network_interface table provides insights into Network Interfaces within Azure. As an Infrastructure Engineer, explore detailed information about each network interface through this table, including its IP configuration, associated network security group, and subnet. Use this table to manage and optimize your network interface configurations, ensuring seamless communication between your Azure VMs and other resources.

Examples

Basic IP address info

Explore the configuration of your Azure network interface to gain insights into your private IP address details. This can help you understand your IP allocation methods and versions, which is useful for managing your network resources effectively.

select
name,
ip ->> 'name' as config_name,
ip -> 'properties' ->> 'privateIPAddress' as private_ip_address,
ip -> 'properties' ->> 'privateIPAddressVersion' as private_ip_address_version,
ip -> 'properties' ->> 'privateIPAllocationMethod' as private_ip_address_allocation_method
from
azure_network_interface
cross join jsonb_array_elements(ip_configurations) as ip;
select
name,
json_extract(ip.value, '$.name') as config_name,
json_extract(ip.value, '$.properties.privateIPAddress') as private_ip_address,
json_extract(ip.value, '$.properties.privateIPAddressVersion') as private_ip_address_version,
json_extract(
ip.value,
'$.properties.privateIPAllocationMethod'
) as private_ip_address_allocation_method
from
azure_network_interface,
json_each(ip_configurations) as ip;

Find all network interfaces with private IPs that are in a given subnet (10.66.0.0/16)

Determine the areas in which your Azure network interfaces have private IPs within a specific subnet. This is useful for understanding how your network resources are distributed and identifying potential areas of congestion or security vulnerabilities.

select
name,
ip ->> 'name' as config_name,
ip -> 'properties' ->> 'privateIPAddress' as private_ip_address
from
azure_network_interface
cross join jsonb_array_elements(ip_configurations) as ip
where
ip -> 'properties' ->> 'privateIPAddress' = '10.66.0.0/16';
select
name,
json_extract(ip.value, '$.name') as config_name,
json_extract(ip.value, '$.properties.privateIPAddress') as private_ip_address
from
azure_network_interface,
json_each(ip_configurations) as ip
where
json_extract(ip.value, '$.properties.privateIPAddress') = '10.66.0.0/16';

Security groups attached to each network interface

Explore which security groups are linked to each network interface in your Azure environment. This can help in managing and improving the security posture of your network.

select
name,
split_part(network_security_group_id, '/', 8) as security_groups
from
azure_network_interface;
Error: SQLite does not support split functions.

Query examples

Schema for azure_network_interface

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
applied_dns_serversjsonbA list of applied dns servers.
auxiliary_modetextAuxiliary mode of network interface resource.
cloud_environmenttextThe Azure Cloud Environment.
disable_tcp_state_trackingbooleanIndicates whether to disable TCP state tracking.
dns_serversjsonbA collection of DNS servers IP addresses.
dscp_configurationjsonbA reference to the DSCP configuration to which the network interface is linked.
enable_accelerated_networkingbooleanIndicates whether the network interface is accelerated networking enabled.
enable_ip_forwardingbooleanIndicates whether IP forwarding is enabled on this network interface.
etagtextAn unique read-only string that changes whenever the resource is updated.
hosted_workloadsjsonbA collection of references to linked BareMetal resources.
idtextContains ID to identify a network interface uniquely.
internal_dns_name_labeltextRelative DNS name for this NIC used for internal communications between VMs in the same virtual network.
internal_domain_name_suffixtextContains domain name suffix for the network interface.
internal_fqdntextFully qualified DNS name supporting internal communications between VMs in the same virtual network.
ip_configurationsjsonbA list of IPConfigurations of the network interface.
is_primarybooleanIndicates whether this is a primary network interface on a virtual machine.
mac_addresstextThe MAC address of the network interface.
migration_phasetextMigration phase of network interface resource.
nametext=The friendly name that identifies the network interface.
network_security_group_idtextThe reference to the NetworkSecurityGroup resource.
nic_typetextType of network interface resource (e.g., Standard, Elastic).
private_endpointjsonbA reference to the private endpoint to which the network interface is linked.
private_link_servicejsonbPrivate link service of the network interface resource.
provisioning_statetextProvidsioning state of the network interface resource.
regiontextThe Azure region/location in which the resource is located.
resource_grouptext=The resource group which holds this resource.
resource_guidtextThe resource GUID property of the network interface resource.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subscription_idtext=, !=, ~~, ~~*, !~~, !~~*The Azure Subscription ID in which the resource is located.
tagsjsonbA map of tags for the resource.
tap_configurationsjsonbA collection of TapConfigurations of the network interface.
titletextTitle of the resource.
typetextThe resource type of the network interface.
virtual_machine_idtextThe reference to a virtual machine.
vnet_encryption_supportedbooleanWhether the virtual machine this NIC is attached to supports encryption.
workload_typetextWorkload type of the network interface for BareMetal resources.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- azure

You can pass the configuration to the command with the --config argument:

steampipe_export_azure --config '<your_config>' azure_network_interface