Default deny, allow what you need
The right firewall posture is simple: deny everything inbound by default, allow only the specific ports you need. Anything else is reasoning your way to swiss cheese. With key-only SSH + fail2ban + firewall scoped to known sources, you've eliminated 99% of practical attack surface.
ufw on Linux, pf on macOS
Linux ufw (Uncomplicated Firewall) is a friendly front-end to iptables/nftables. macOS ships with the BSD-derived pf packet filter; the GUI "Application Firewall" is a separate, weaker layer. For a fleet, the right pattern is to manage host-level firewalls per OS and trust your LAN/Tailnet boundary as the additional perimeter.