steampipe plugin install gcp

Table: gcp_compute_global_forwarding_rule - Query GCP Compute Global Forwarding Rules using SQL

A Global Forwarding Rule in Google Cloud Platform (GCP) is a component of the Cloud Load Balancing service. It is responsible for forwarding traffic from specified IP addresses to a target instance, target proxy, or target pool. These rules can be used to distribute incoming network traffic across multiple compute instances to ensure that no single instance is overwhelmed.

Table Usage Guide

The gcp_compute_global_forwarding_rule table provides insights into the Global Forwarding Rules within Google Cloud Platform's Compute service. As a network engineer, you can use this table to explore details about each rule, including the IP addresses it handles, its target instances, and its associated load balancing configurations. This can be especially beneficial in optimizing your network traffic distribution and ensuring efficient load balancing across your compute instances.

Examples

Basic info

Gain insights into the details of global forwarding rules, such as their names, IDs, IP addresses, protocols, port ranges, and targets within the Google Cloud Platform. This can be useful in understanding the networking configuration and traffic routing in your cloud environment.

select
name,
id,
ip_address,
ip_protocol,
port_range,
target
from
gcp_compute_global_forwarding_rule;
select
name,
id,
ip_address,
ip_protocol,
port_range,
target
from
gcp_compute_global_forwarding_rule;

List global forwarding rules which are globally accessible

Determine the areas in which global forwarding rules are set to be globally accessible, allowing for a broadened network reach and enhanced connectivity. This can be particularly useful in understanding the scope of your network access and identifying potential security considerations.

select
name,
id,
ip_address,
allow_global_access
from
gcp_compute_global_forwarding_rule
where
allow_global_access;
select
name,
id,
ip_address,
allow_global_access
from
gcp_compute_global_forwarding_rule
where
allow_global_access = '1';

List global forwarding rules where mirroring collector is enabled (i.e load balancer can be used as a collector for packet mirroring)

Discover the segments that have enabled the packet mirroring feature, allowing the load balancer to collect data. This is useful in analyzing network traffic for security monitoring or troubleshooting.

select
name,
id,
is_mirroring_collector
from
gcp_compute_global_forwarding_rule
where
is_mirroring_collector;
select
name,
id,
is_mirroring_collector
from
gcp_compute_global_forwarding_rule
where
is_mirroring_collector = '1';

Schema for gcp_compute_global_forwarding_rule

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
all_portsboolean!=, =Specify this field to allow packets addressed to any ports will be forwarded to the backends configured with this forwarding rule.
allow_global_accessboolean!=, =Specifies whether clients can access ILB from all regions, or not.
backend_servicetextSpecifies the BackendService resource to receive the matched traffic.
creation_timestamptimestamp with time zoneThe creation timestamp of the resource.
descriptiontextA user-specified, human-readable description of the resource.
fingerprinttexta hash of the contents stored in this object and used for optimistic locking.
idbigintThe unique identifier for the resource.
ip_addressinetSpecifies the IP address that this forwarding rule serves.
ip_protocoltext!=, =The IP protocol to which this rule applies.
ip_versiontext!=, =The IP Version that will be used by this forwarding rule.
is_mirroring_collectorboolean!=, =Indicates whether or not this load balancer can be used as a collector for packet mirroring.
kindtextThe type of the resource.
load_balancing_schemetext!=, =Specifies the forwarding rule type.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
metadata_filtersjsonbOpaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients.
nametext=A friendly name that identifies the resource.
networktextSpecifies the network that the load balanced IP should belong to for this Forwarding Rule.
network_tiertext!=, =Specifies tthe networking tier used for configuring this load balancer.
port_rangetextSpecifies the port range. Packets addressed to ports in the specified range will be forwarded to target or backendService.
portsjsonbA list of ports can be configured.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
self_linktextThe server-defined URL for the resource.
service_labeltextA prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name.
service_nametextThe internal fully qualified service name for this Forwarding Rule.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subnetworktextSpecifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule.
targettextThe URL of the target resource to receive the matched traffic.
titletextTitle of the resource.

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)" -- gcp

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

steampipe_export_gcp --config '<your_config>' gcp_compute_global_forwarding_rule