Rule Engine & Firewall
Readable allow/drop commands, service aliases, namespace dry-run, sensitive ports and protected transaction rollback.
Rule Engine translates readable instructions into backend-specific firewall commands while retaining visibility of native Linux firewall rules. It supports deliberate batching, service aliases and a verification workflow. It is an operator tool, not a substitute for knowing the current default policy, zones and access path.
Readable rules and independent commands
Commas split ports into individual operations while retaining the action. and starts another independent clause. A service alias such as nginx expands to its configured service ports; unlike comma-separated ports, native multiport aliases may be represented by one backend rule when configured.
one-click engine 'allow nginx'
one-click engine 'allow tcp 80,677'
one-click engine 'allow nginx and drop 50,79,23'
one-click engine 'allow udp 5353'The mixed nginx example should generate two TCP ALLOW operations (80 and 443) and three TCP DROP operations (50, 79, 23). Review the actual generated command list because installed backend and alias configuration determine the exact translation.
Backends and exact commands
One-Click detects an active firewall backend; depending on the host and installed revision this may be iptables, nftables compatibility mode, firewalld or UFW. Generated commands should remain readable before approval. A firewalld DROP without a source may require a rich rule, not the same syntax as an ALLOW port.
firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-rich-rule='rule port port="50" protocol="tcp" drop'Native rule semantics depend on zone bindings, rule order, existing policies and IPv4/IPv6; always inspect effective firewall state rather than assuming a single generated rule is authoritative.
Namespace dry-run and approval
The One-Click dry-run was designed as an isolated network namespace simulation, not just a printed preview. It prepares a test environment, exercises supported rule effects, checks selected local service reachability and reports conflicts before offering an apply decision.
one-click engine --dry-run 'allow nginx and drop 50,79,23'A successful sandbox report is not proof of identical behaviour in a production firewalld zone, IPv6, NAT, remote routing or different interface policies. In recent builds the simulator models IPv4/TCP through iptables. Confirm every warning and validate a representative lab host before relying on live firewall changes.
Live transaction, snapshot and watchdog
A protected live update should prepare a restorable snapshot, arm an independent rollback watchdog, apply the approved batch and require explicit confirmation before the protection expires. The rollback mechanism must be available before rules are applied. On a failure, inspect the transaction state and actual rules; do not assume restoration succeeded from a message alone.
sudo firewall-cmd --zone=public --list-ports
sudo firewall-cmd --zone=public --list-rich-rulesThere have been recent Rule Engine regressions involving rollback confirmation and namespace result interpretation. Treat behaviour as version-dependent and verify your installed code and rollback on a disposable VM with console access before production use. Never use a remote SSH session as the only recovery path.
Sensitive ports and warnings
Need the complete commands and configuration walkthrough? See Sensitive Ports & Warnings to list, add, remove and verify protected service ports, including common reasons a warning might not appear.
Sensitive ports receive extra warning treatment. The base set includes SSH (normally 22), FTP 21, SMTP 25, HTTPS 443, MySQL 3306, Cockpit 9090 and WireGuard 51820. Administrators may manage additional ports in the dedicated sensitive-port configuration. Warning coverage depends on the installed sensitive-port checker; older implementations checked only the built-in map.
one-click engine 'sensitive-list'
one-click engine 'sensitive:899'
one-click engine 'sensitive-remove:899'Configured sensitive-port entries are kept under /etc/one-click/rule-engine/.sensitive.ports. Review the installed command syntax, as help text and parser variants have differed across revisions. A missing warning is never a guarantee that changing that port is safe.
Aliases, backups and raw mode
Named IP address groups: alias-create, alias-append, and alias-prune manage reusable source-address aliases. See the complete IP Aliases guide for creation, membership changes, use in rules and the important non-retroactive behaviour.
one-click engine 'show alias'
one-click engine 'backup firewall'
one-click engine 'restore firewall'
one-click engine 'raw: iptables -S INPUT'Alias management supports service names and separately configured source-address aliases. Backup and restore are direct maintenance actions and must not be confused with the independent live-transaction rollback snapshot. Raw commands are for advanced administrators; not every native command can be safely simulated or transactionally reversed by every backend. Refuse unsupported batches rather than guessing.
Troubleshooting checklist
If a command fails, capture the generated command, the backend detected, and whether the failure occurred during validation, namespace checks, transaction preparation, rule application or confirmation. Inspect actual firewall state and relevant logs before retrying. If a rollback is reported, independently verify restored rules; avoid repeated live experiments on a production host.
one-click engine --dry-run 'allow nginx'
sudo firewall-cmd --state
sudo firewall-cmd --get-active-zones