Hi everyone! I'm using Ubuntu 24.04 and I want to completely block internet access for all apps on my system except for one particular app, like Brave Browser (located at /opt/brave.com/brave/brave). I've tried setting up some iptables rules, but they didn't work to whitelist Brave as I expected. Can anyone help me with this?
5 Answers
You could use Firejail to sandbox the applications. This tool allows you to restrict which apps can access the internet. You can whitelist Brave or even specify which domains it can connect to, but don’t forget you’ll need apt to have internet access for system updates.
One cool solution is to install all your apps through Flatpak and then use Flatseal to block internet access for all apps except Brave. This can be a straightforward way to manage internet access without too much hassle.
Just block all inbound connections, and make sure only the necessary outbound ports (like 443) are open for Brave. Just know that blocking all access might lead to unexpected issues later, like DNS resolution problems or update failures.
Another option is using fapolicyd, which allows granular control over which executables can run and access the network. It’s mainly available for Red Hat distros, but check if there’s a version for Ubuntu.
Keep in mind that iptables isn’t application-aware; it manages connections based on protocols, ports, and addresses, not specific applications. You might need to explore a tool that offers more granular control.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures