/security/firewall/rules
0.1.0Unchanged since publicationAdd a firewall rule
securityallSet kind to port to open an additional port or closed to drop traffic to a port even when a service is listening. For either kind, value accepts a port from 1 to 65535 or an inclusive range such as 30000-31000, with the lower port first. TCP is the default. Append /udp for UDP or /tcp for TCP. A closed rule lasts until removed, and IP addresses on the Allow list retain access. Closing a web interface or SSH port requires the caller's IP address to be on the Allow list.
For kind allow or deny, value accepts an IPv4 or IPv6 IP address or a network in CIDR notation. An allow rule can create an exception inside a larger denied network and lifts any active bans it covers. UrbeStack rejects duplicate rules, a deny rule fully covered by an existing allow rule, and an allow rule that would fully cover an existing deny rule. It also rejects a deny rule that covers the caller's IP address, a server IP address, or loopback. Invalid rule input returns 400.
Adding a deny rule requires that no other change be pending. UrbeStack restores the previous rules after five minutes unless you confirm with urbestack-firewall-confirm or through the Confirm button in the web interface. Verify access in a new session before confirming.
As a command
Run as root on the serverkindstring, one of port, allow, deny, closedRequiredvaluestring, up to 64 charactersRequirednotestring, up to 80 charactersExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/security/firewall/rules" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"kind": "port",
"note": "added by hand",
"value": 8443
}'201 Created{
"lifted": 1,
"revert": {
"armed": true,
"deadline": "text",
"what": "text"
},
"rule": {
"created_at": "2026-09-09T10:15:00Z",
"id": 1,
"kind": "port",
"note": "added by hand",
"value": 8443
},
"way_in": "panel"
}Errors
12 errors, each a status and a sentence400Invalid IPv4 address400Invalid IPv6 address400Invalid id400Refused. <value> 400Refused. <value> is loopback: the server's own services talk to each other over it400Say which bans: an address or network, a service or rule, a search, or a time window; or clear all blocks400kind must be port, allow, deny or closed401Authentication required404Ban <id> not found409<value> holds <dn.value>, which is on Deny: remove it there first409<value> is on Allow as <al.value>: remove it there first409A <kind> rule for <value> already existsurbestack.com/docs/api/post-security-firewall-rules/