Monitoring application data traffic
Network Tattletale
OpenSnitch, an application-based firewall, protects you from unwanted data leaks by letting you set customized rules for all your applications.
An application opening a connection to the Internet is a normal procedure and typically completely legitimate, but there are programs – even open source applications – that like to phone home or track the user. On Linux, there is usually an opt-in step – you have to actively agree to the data collection. Often, the collected data relates to telemetry functions and gives the developers information about a user's interaction with their program. However, open source does not always protect you against being investigated. In Firefox, you have to actively opt out of sending telemetry stats if you do not want this to happen.
An application firewall can reveal what's going on behind the user's back. While conventional firewalls examine the data flow packets to and from the CPU, an application firewall takes an application-specific view when monitoring the outgoing data flow. (Do not confuse an application firewall with a web application firewall [1].) Examples of application firewalls include FirePrompt [2] for Linux and GlassWire [3] for Windows. In this article, I'll take a closer look at an open source application firewall: OpenSnitch [4], a Python port of the proprietary Little Snitch [5] personal firewall for macOS. OpenSnitch development began about four years ago.
Snitch
With "snitch" in its name, you can tell much about how OpenSnitch works: Snitching is exactly what this firewall does. OpenSnitch analyzes applications' outgoing data traffic and exposes trackers and similar unpleasantries if configured accordingly, letting you intervene if necessary. In general, if an application tries to connect to the network, OpenSnitch stops it first and asks if you want to allow this to happen. You grant permission by defining a rule for the application.
OpenSnitch is not typically found in the package archives of the popular distributions. On Arch Linux, up-to-date packages can be found in the Arch User Repository. MX Linux offers OpenSnitch, but only the outdated version 1.3.6. The current stable OpenSnitch v1.5.1 can be downloaded as a binary package from the project's GitHub page. Besides DEB and RPM packages [6] for 32- and 64-bit systems, you will also find the source code on GitHub if you want to build OpenSnitch yourself. Additional packages are available for the armhf and arm64 architectures.
Installation
I tested OpenSnitch v1.5.0-rc1, which is likely to be the stable version when this issue reaches the newsstand. I installed the packages for the daemon and the GUI on Debian Siduction ("sid") and Debian 11 ("bullseye").
On Siduction, there was a problem with some Python dependencies, but I was able to fix this by typing
sudo apt --fix-broken install
In Debian 11, the install completed without any hitches. Debian and its derivatives enable the OpenSnitch service automatically after installing the software. With other distributions you may have to do this manually (see Listing 1).
Listing 1
Manually Activating OpenSnitch
# systemctl --now enable opensnitched
After the first launch, you'll find OpenSnitch in the system section of the control bar. Clicking on the OpenSnitch icon opens the application's main window. Right-clicking does the same thing after selecting Statistics but additionally lets you disable or close the firewall and gives you access to the help documentation.
Blockade
Initially, OpenSnitch blocks all connections to the outside world. If an application that does not have a rule tries to access the Internet, OpenSnitch pops up a dialog. Before you even get around to calling OpenSnitch from the system section, several successive pop-up windows will probably already be telling you that applications on your system are trying to contact hosts outside their own network (Figure 1).
If you grant permission for an application to contact the outside world in the pop-up window, this permission will be applied until the next restart by default. However, you can also make the new rule permanent or limit its validity to a specific period of time. Optionally, you can define whether the rule should apply to the running process only, to the targeted URL, or to the domain to be contacted.
OpenSnitch saves the rules you create in JSON format in the /etc/opensnitch/rules
file, which you can also edit manually. If necessary, you can save as a CSV file the list of applications that try to contact external hosts, for example, and process the list further with external applications (Figure 2).
If you do not configure any settings, the window closes after 15 seconds and OpenSnitch blocks the connection by default. I found the time frame a bit short, so you might want to extend the grace period in the Preferences dialog, which you can access via the middle icon at the top of the application window (Figure 3). Under the Pop-ups tab, you can change the default action from deny to allow, set a shorter period instead of the default duration until reboot, or extend the duration to always, depending on your needs. If you missed a window (e.g., because it closed faster than you could react), you can edit the settings in the main window (Figure 4).
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.