Table: linode_firewall - Query Linode Firewalls using SQL
Linode Firewalls provide a layer of security by controlling the traffic to and from your Linode instances. They allow you to define rules that either allow or block traffic based on specific criteria, helping you protect your infrastructure from unauthorized access and attacks.
Table Usage Guide
The linode_firewall
table allows system administrators and DevOps engineers to query and manage the firewalls associated with their Linode instances. Through this table, you can explore firewall-specific details such as creation and update times, current status, and associated rules.
Examples
Basic info
Retrieve a list of all firewalls in your Linode account to get an overview of your security infrastructure.
select id, created, updated, labelfrom linode_firewall;
select id, created, updated, labelfrom linode_firewall;
Firewalls that are enabled
Explore the enabled firewalls to ensure that your security configurations are active and properly managed.
select label, status, created, updatedfrom linode_firewallwhere status = 'enabled';
select label, status, created, updatedfrom linode_firewallwhere status = 'enabled';
Recently updated firewalls
List all firewalls that have been updated in the last 30 days to track recent changes in your security settings.
select label, updated, statusfrom linode_firewallwhere updated >= current_date - interval '30 days';
select label, updated, statusfrom linode_firewallwhere updated >= date('now', '-30 days');
Get inbound rule details of firewalls
This query retrieves detailed information about the inbound rules configured for each Linode firewall, including label, ports, action, protocol, description, and addresses.
select f.id, f.label, i ->> 'label' as inbound_label, i ->> 'ports' as inbound_ports, i ->> 'action' as inbound_action, i ->> 'protocol' as inbound_protocol, i ->> 'description' as inbound_description, i -> 'addresses' as inbound_addressesfrom linode_firewall as f, jsonb_array_elements(rules -> 'inbound') as i;
select f.id, f.label, json_extract(i.value, '$.label') as inbound_label, json_extract(i.value, '$.ports') as inbound_ports, json_extract(i.value, '$.action') as inbound_action, json_extract(i.value, '$.protocol') as inbound_protocol, json_extract(i.value, '$.description') as inbound_description, json_extract(i.value, '$.addresses') as inbound_addressesfrom linode_firewall as f, json_each(rules -> 'inbound') as i;
Get outbound rule details of firewalls
This query retrieves detailed information about the outbound rules configured for each Linode firewall, including label, ports, action, protocol, description, and addresses.
select f.id, f.label, o ->> 'label' as outbound_label, o ->> 'ports' as outbound_ports, o ->> 'action' as outbound_action, o ->> 'protocol' as outbound_protocol, o ->> 'description' as outbound_description, o -> 'addresses' as outbound_addressesfrom linode_firewall as f, jsonb_array_elements(rules -> 'outbound') as o;
select f.id, f.label, json_extract(o.value, '$.label') as outbound_label, json_extract(o.value, '$.ports') as outbound_ports, json_extract(o.value, '$.action') as outbound_action, json_extract(o.value, '$.protocol') as outbound_protocol, json_extract(o.value, '$.description') as outbound_description, json_extract(o.value, '$.addresses') as outbound_addressesfrom linode_firewall as f, json_each(rules -> 'outbound') as o;
Schema for linode_firewall
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
created | timestamp with time zone | The date and time this firewall was created. | |
euuid | text | An external unique identifier for this account. | |
id | bigint | = | The unique ID of this Firewall. |
label | text | The firewall’s label is for display purposes only. | |
rules | jsonb | The rules associated with the firewall. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | The status of the firewall. Possible values are 'enabled', 'disabled', or 'deleted'. | |
tags | jsonb | Tags applied to this firewall. | |
updated | timestamp with time zone | The date and time this firewall was updated. |
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)" -- linode
You can pass the configuration to the command with the --config
argument:
steampipe_export_linode --config '<your_config>' linode_firewall