I was messing with ChatGPT, and decided that i wanted to make sure my firewall rules on Fedora were set up right out of the box.
I did sudo firewall-cmd --list-all and that output
FedoraWorkstation (default, active)
target: default
ingress-priority: 0
egress-priority: 0
icmp-block-inversion: no
interfaces: enp4s0
sources:
services: dhcpv6-client samba-client ssh
ports: 1025-65535/udp 1025-65535/tcp
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
ChatGPT is saying this isnât safe, because all those ports are open that are listed. This true? This how itâs supposed to be set up? I havenât changed any firewall rules, so feel like all incoming connections should still be blocked? I just want to make sure my PC is as secure as possible, while still working.
To me this seems to be correct. It only blocks the port numbers below 1025, which in the old days are the privileged ports. Also, it doesnât distinguish between connects attempts from the local network and the general internet. Thus, you will need another firewall on you modem-router to block external connect attempts.
I noticed in that post. Someone from the packaging team talks about how there are no firewalls more similar to âWindows Firewall, where the user is prompted to allow particular applications to access the network.â
That was 5 years ago though, has that changed? There anything more like that set up on Linux these days? Where i can close all ports and only allow certain programs when asked?
Security is not a yes/no question.
What matters is what you require to be secure against.
If your system is a deaktop in your house behind a router/firewall that is not the same problem as a laptop in a public space.
What is your requirement? Also call what is the âthreat modelâ by security people.
Itâs a Desktop behind a router, but i am currently behind a router my ISP gave me. Since my old router broke and am waiting for a sale on router that i want. That is why i was looking into the firewall, because i donât have any control over this router that my PC is plugged into and wanted to make sure my desktop is as secure as possible, just in case the ISP router is lacking in that regard.
Portmaster and OpenSnitch are the two Iâm aware of. There may be more - and I think Portmaster is âfreemiumâ so there may be cash involved for the fully feature set
Iâll have to try that out and see if it breaks anything i use. I donât use Gnome file sharing. I mostly just play some games on Steam, browse the web via Firefox and maybe download some stuff off Usenet. Will all that still work or do ports have to be open for that? Iâm no expert when it comes to networking if i am being honest.
Unless you told it to start blocking ports without considering what the consequences would be, it would likely have no effect at all.
Inbound ports which have nothing listening are like a door to a black hole. The rest of the internet can fire as much data as it likes at port 44332 but if I have nothing listening on port 44332 the impact is zero, other than my LAN bandwidth being consumed. Ergo, if you want to block traffic from the outside world, drop it at your router so it never gets onto your LAN in the first place.
All of your actions above demonstrate that you are initiating outbound traffic, so that will be likely be entirely unaffected by closing down vast swathes of port ranges.
Most of these tools donât implement a firewall themselves. They configure the installed firewall to open and close ports based on what you tell it⌠For example, if I run Glasswire on a Windows desktop, itâs merely adding entries into the firewall rules (which themselves are just entries in the registry) saying âAlways permit thisâ and âdeny that unless itâs from this IP rangeâ. The Windows firewall is still doing its job - you just have a pretty front end to help you fiddle with it. I assume OpenSnitch and PortMaster are doing the same thing.
I think Linux firewalls are designed so that applications cannot control firewall rules. Therefore, there is no such firewall implementation, and if an application needs to open a specific port, you still have to configure it manually.
However, I am not sure what you are trying to accomplish here. Are you looking to control/filter incoming or outgoing connections? In either case, a firewall wouldnât be my first choice. If itâs for incoming connections, why start a service and let it bind to a port if you didnât want that? Donât start the service or have it bind to 127.0.0.1 instead of 0.0.0.0. And for outgoing, pretty much the same question, why run an application that you donât trust?
Also, one thing to consider about this type of host-based firewalls that ask for user confirmation, most bad actors donât name their binaries evil-ransomware or something similarly obvious. And I question if most people would have the presence of mind to deny a connection if the binary /tmp/update-os wants to establish a connection.