Page 1 of 1

Shortest possible firewall rule set

Posted: Sun Jun 21, 2020 3:46 pm
by shasum
There's a lot of webpages out there that try to explain the ins and outs of firewall rules.
Often these webpages seem to be oriented to people configuring servers.
I'm just setting up a Rpi 8GB, which BTW is great.
I'm curious what would be the shortest possible firewall rule set, either for iptables or ufw, to do the following:
1. Block all incoming packets unless they're a part of an ongoing connection.
2. Don't block outgoing packets (yet).
3. Let my processes talk to one another.
Any ideas?
In the future I may want to block outgoing connections for ports that are uncommonly used i.e. not http, https, mail, time, coin-related etc.

Re: Shortest possible firewall rule set

Posted: Sun Jun 21, 2020 6:07 pm
by knute
sudo apt ufw install

sudo ufw allow <your services eg. ssh>

sudo ufw enable

I can't imagine why you would want to block outgoing ports, it is only going to give you grief. Tell me what harm you think you would be preventing?