add_firewall_rule
Adds a firewall rule to control inbound or outbound traffic by protocol, port range, and CIDR block.
Instructions
Add an inbound/outbound rule to a cloud firewall. Requires scope services:write. Plain write — not gated. id is the firewall id from list_firewalls / get_firewall. direction and protocol are required; portRangeMin/portRangeMax (1-65535) narrow the rule to specific ports (omit both to match all ports); remoteCidr restricts the rule to a CIDR block (e.g. '0.0.0.0/0'); description is an optional label (max 255 chars). The server enforces portRangeMin <= portRangeMax; a rule violating that ordering is rejected with a 400.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Firewall id from list_firewalls / get_firewall. | |
| protocol | Yes | Protocol the rule matches. | |
| direction | Yes | Traffic direction the rule matches. | |
| remoteCidr | No | Remote CIDR block the rule applies to, e.g. '0.0.0.0/0'. | |
| description | No | Optional label for the rule (max 255 chars). | |
| portRangeMax | No | Upper bound of the port range (1-65535). | |
| portRangeMin | No | Lower bound of the port range (1-65535). |