OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
Find a file
2017-05-04 03:13:46 +08:00
bin Make sure matplotlib wont load PyQt4, remove PyQt4 compat 2017-05-04 02:54:23 +08:00
opensnitch Make sure matplotlib wont load PyQt4, remove PyQt4 compat 2017-05-04 02:54:23 +08:00
.gitignore Removed garbage files 2017-04-30 11:13:04 +02:00
LICENSE Yo 2017-04-17 16:34:50 +02:00
MANIFEST.in Proper packaging ... more or less. 2017-04-17 17:30:25 +02:00
README.md Update README with qt5 2017-05-04 03:13:46 +08:00
screenshot.png Updated screenshot 2017-05-03 15:48:07 +02:00
setup.py Better UI using PyQt. Implements 'Until Quit' action. 2017-04-19 13:38:18 -04:00

OpenSnitch

OpenSnitch is a GNU/Linux port of the Little Snitch application firewall.

OpenSnitch

Warning: This is still alpha quality software, don't rely on it (yet) for your computer security.

Requirements

You'll need a GNU/Linux distribution with iptables, NFQUEUE and ftrace kernel support.

Install

sudo apt-get install build-essential python-dev python-setuptools libnetfilter-queue-dev python-qt5
cd opensnitch
sudo python setup.py install

Run

sudo opensnitch

Known Issues / Future Improvements

Before opening an issue, keep in mind that the current implementation is just an experiment to see the doability of the project, future improvements of OpenSnitch will include:

Split the project into opensnitchd, opensnitch-ui and opensnitch-ruleman:

  • opensnitchd will be a C++ daemon, running as root with the main logic. It'll fix this.
  • opensnitch-ui python (?) UI running as normal user, getting the daemon messages. Will fix this.
  • opensnitch-ruleman python (?) UI for rule editing.

How Does It Work

OpenSnitch is an application level firewall, meaning then while running, it will detect and alert the user for every outgoing connection applications he's running are creating. This can be extremely effective to detect and block unwanted connections on your system that might be caused by a security breach, causing data exfiltration to be much harder for an attacker. In order to do that, OpenSnitch relies on NFQUEUE, an iptables target/extension which allows an userland software to intercept IP packets and either ALLOW or DROP them, once started it'll install the following iptables rules:

OUTPUT -t mangle -m conntrack --ctstate NEW -j NFQUEUE --queue-num 0 --queue-bypass

This will use conntrack iptables extension to pass all newly created connection packets to NFQUEUE number 0 (the one OpenSnitch is listening on), and then:

INPUT --protocol udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass

This will also redirect DNS queries to OpenSnitch, allowing the software to perform and IP -> hostname resolution without performing active DNS queries itself.

Once a new connection is detected, the software relies on the ftrace kernel extension in order to track which PID (therefore which process) is creating the connection.

If ftrace is not available for your kernel, OpenSnitch will fallback using the /proc filesystem, even if this method will also work, it's vulnerable to application path manipulation as described in this issue, therefore it's highly suggested to run OpenSnitch on a ftrace enabled kernel.

TODOs

grep -r TODO opensnitch | cut -d '#' -f 2 | sort -u

License

This project is copyleft of Simone Margaritelli and released under the GPL 3 license.