ufw_rule
Add or delete UFW firewall rules on managed Linux hosts to open or close ports, with a dry-run plan before applying changes.
Instructions
Add or delete a UFW rule on hosts, e.g. open a new public port for an inbound (allow 8443/tcp on the internet interface) or close one. Public exposure of 22/2222/5443/5444/9100 is blocked unless allowDangerous. The rule list before the change is shown in the dry run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ||
| from | No | source IP/CIDR; default Anywhere | |
| port | Yes | ||
| apply | No | false (default) = dry run: show what will happen on which hosts and a planHash. true = run it; needs planHash | |
| iface | No | interface, e.g. eth0 (public) or tailscale0; default: any | |
| proto | No | tcp | |
| target | No | hosts: all | <host> | <glob nl-*> | <group> | role:<edge|remnanode|panel|docker> | tag:<tag>; comma-separated, !x excludes | all |
| planHash | No | planHash from the dry run of the very same call, good for one apply; refused if targets or their state changed since | |
| allowDangerous | No |