iptables and nftables are just different frontends to the netfilter kernel module.
post
OpenSnitch is a nice for the desktop environment, deny by default and prompts the user when an application requests a open port, at first the prompts can get a little overwhelming given how many things want to connect to xyz server but eventually lightens up.
These firewall tools are interesting, but I honestly haven't needed them in years. The premise is a little out of date. Who puts cloud servers on the open internet these days? Everything I see uses a public load balancer and a WAF service.
Sure, but what if youve configured your waf or w/e incorrectly, what if someone gains access to another part of your network? Having sane firewall settings is always better than none at all.
All the cloud services I've used had virtual network firewalls for internal traffic. Security Groups for AWS, Cloud Firewall for GCP, etc. That's typically how lateral traffic gets managed. Defense in depth is good, but as I said I haven't used host firewalls in forever, and we get audited for security certificates every year, and no auditor has asked about them that I recall.
A lot of people host websites created with a static site generator just fine without that extra layer. Unless your site has expensive to generate dynamic pages, lots of video content, or deep changelog pages (wiki history or forge commit diff's publicly available), it makes a lot of sense to keep it simple.
Putting everything behind Cloudflare is just cargo cult behaviour and learning all the ins and outs of it isnt any harder than learning a firewall (which is transferrable knowledge that can also protect your machines from each other).
If you're trying to be cost-effective, renting a VPS for a fixed term instead of using a IaaS platform that provides all these things just by clicking a checkbox, then caring about your firewall is a necessary part of building the system image that you deploy. You can of course set up your own private networking between systems and build the same type of architecture that a IaaS would provide, but to do that you're going to need to understand everything about linux networking and netfilter already.
I didn't realise I wanted to read up about Linux firewalls, but apparently I did. Thanks
I've wanted to for years. I've tried to multiple times. Like I love computers and programming I can get absolutely lost in code for hours. For whatever reason when I start to look at networking my brain switches off and says nope. I can clean enough to hack what I need for the most part, but of I strive for any depth of knowledge on the subject my brain shuts down.
Hoping this article is the ticket.
networking.firewall.enable = true;
Tap for spoiler
Yeah I'm familiar with all the tools but - omg - have NixOS modules ever changed my life
What does it do?
Deletes /dev/null obviously
For me it's clearly not obvious what exactly 'enabling firewall' entails, what policy is applied, what rules, etc., etc.
There are sensible defaults but it ultimately depends on what the module is doing and how you configure it.
The beauty is that this, or your own custom modules, become a declarative and reproducible abstraction layer which (if properly written) lets you focus on the what rather than the how.
... You could also write a bunch of scripts, which is what I used to do before I joined the cult.
On all modern linux's, the iptables command is actually a compatibility layer controlling nftables.
I prefer it over the nft command because it's much easier to read and use. I only use the nft command when checking for the occasional chain/table that iptables didn't show me.
all 16 comments