GUIDE 13 / SECURITY
Firewalls
Inspect zones, ports, runtime rules, and saved network policy.
Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.
Inspect firewalld without changing it
A zone groups rules for interfaces or source addresses. Named services map to ports and other settings; an allowed port does not mean a process is listening.
systemctl is-active firewalld
sudo firewall-cmd --get-active-zones
sudo firewall-cmd --zone=public --list-all
sudo firewall-cmd --permanent --zone=public --list-all
sudo firewall-cmd --info-service=httpsRuntime rules are active now. Permanent rules are saved for future loads. Reloading replaces runtime settings with permanent settings, so a temporary allowance disappears.
Add an intended service persistently
These commands change firewall policy. Use them only when HTTPS is an intended public service and nginx is configured for it. Adding to both configurations avoids replacing unrelated runtime rules with a reload.
sudo firewall-cmd --zone=public --add-service=https
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --zone=public --query-service=https
sudo firewall-cmd --permanent --zone=public --query-service=httpsRetain SSH access when changing remote firewall rules. Docker-published ports can use separate forwarding rules even when absent from the public zone’s port list.