List firewall rules

List a firewall's rules, with the direction, protocol, addresses and ports each one matches.

GET https://{availability_zone}.betterstackcloud.com/v1/firewalls/{firewall_id}/rules
firewall_id string required

The ID of the firewall whose rules to list.

page integer default: 1

The page to return, starting at 1.

per_page integer default: 25

How many entries to return per page. Maximum 1000.

Authorization string required

Bearer $TOKEN

Results are paginated

Use page and per_page to move through pages. See Pagination.

200 OK
{
  "data": [
    {
      "id": "example",
      "direction": "inbound",
      "protocol": "tcp",
      "ip_addresses": [
        "0.0.0.0/0",
        "::/0"
      ],
      "port_from": 443,
      "port_to": 443
    }
  ],
  "meta": {}
}

Returns the list of firewall rules.

id string

The rule's ID, a UUID.

direction string

Which traffic the rule matches.
Valid values:
inbound: The rule matches traffic that arrives at the server.
outbound: The rule matches traffic that leaves the server.

protocol string

The IP protocol the rule matches. any matches every protocol. Possible values: tcp, udp, icmp, gre, esp, any.

ip_addresses array of strings

The addresses the rule applies to, in CIDR notation, such as 10.0.0.0/8. Use 0.0.0.0/0 and ::/0 for every address. The list can't be empty.

port_from integer

The first port of the range, from 0 to 65535. Every rule needs it. A protocol without ports, such as icmp, ignores it.

port_to integer or null

The last port of the range, from port_from to 65535.