Table: net_connection - Query Network Connection using SQL
A Network Connection is a link between two or more nodes in a network. It enables the transfer of data between these nodes, which can include computers, servers, or other network-enabled devices. The status and details of these connections are crucial for network management and troubleshooting.
Table Usage Guide
The net_connection
table provides insights into various network connections. As a Network Engineer or IT Administrator, you can explore connection-specific details through this table, including statuses, types, and associated metadata. Utilize it to monitor and manage network connections, ensure optimal data transfer, and troubleshoot any connection issues.
Important Notes
- You must specify the
address
column in thewhere
clause to query this table.
Examples
Test a TCP connection (the default protocol) to steampipe.io on port 443
Analyze the status of a TCP connection to a specific website and port. This can be useful for troubleshooting network connectivity issues or verifying that a service is reachable and responding as expected.
select *from net_connectionwhere address = 'steampipe.io:443';
select *from net_connectionwhere address = 'steampipe.io:443';
Test if SSH is open on server 68.183.153.44
The query allows you to assess if a specific server has an open SSH connection. This is useful for identifying potential security vulnerabilities or for troubleshooting connectivity issues.
select *from net_connectionwhere address = '68.183.153.44:ssh';
select *from net_connectionwhere address = '68.183.153.44:ssh';
Test a UDP connection to DNS server 1.1.1.1 on port 53
Explore whether a UDP connection to a DNS server on a specific port is active. This is useful to troubleshoot network connectivity issues or validate network configurations.
select *from net_connectionwhere protocol = 'udp' and address = '1.1.1.1:53';
select *from net_connectionwhere protocol = 'udp' and address = '1.1.1.1:53';
Test if RDP is open on server 65.2.9.152
Explore whether the Remote Desktop Protocol (RDP) is open on a specific server to ensure secure connections and prevent unauthorized access. This is particularly useful in managing network security and maintaining control over remote access to your systems.
select *from net_connectionwhere protocol = 'tcp' and address = '65.2.9.152:3389';
select *from net_connectionwhere protocol = 'tcp' and address = '65.2.9.152:3389';
Schema for net_connection
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
address | text | = | Address to connect to, as specified in https://golang.org/pkg/net/#Dial. |
connected | boolean | True if the connection was successful. | |
error | text | Error message if the connection failed. | |
local_address | text | Local address (ip:port) for the successful connection. | |
protocol | text | = | Protocol type: tcp, tcp4 (IPv4-only), tcp6 (IPv6-only), udp, udp4 (IPv4-only), udp6 (IPv6-only), ip, ip4 (IPv4-only), ip6 (IPv6-only), unix, unixgram or unixpacket. |
remote_address | text | Remote address (ip:port) for the successful connection. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. |
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)" -- net
You can pass the configuration to the command with the --config
argument:
steampipe_export_net --config '<your_config>' net_connection