Permalink
Browse files

Proper packaging ... more or less.

  • Loading branch information...
1 parent 56e202f commit 94196d403b41ad45a590ac5f1fa9e0022f396b18 @evilsocket committed Apr 17, 2017
Showing with 229 additions and 25 deletions.
  1. +5 −1 .gitignore
  2. +7 −0 MANIFEST.in
  3. +10 −0 README.md
  4. +42 −0 bin/opensnitch
  5. +0 −24 main.py
  6. +18 −0 opensnitch/app.py
  7. +18 −0 opensnitch/connection.py
  8. +18 −0 opensnitch/dns.py
  9. +18 −0 opensnitch/proc.py
  10. +18 −0 opensnitch/rule.py
  11. +18 −0 opensnitch/snitch.py
  12. +18 −0 opensnitch/ui.py
  13. +39 −0 setup.py
View
@@ -1,2 +1,6 @@
-*.swp
*.pyc
+build
+dist
+*.egg-info
+.idea
+*.swp
View
@@ -0,0 +1,7 @@
+exclude *.pyc .DS_Store .gitignore MANIFEST.in
+include setup.py
+include distribute_setup.py
+include README.md
+include LICENSE
+recursive-include bin *
+recursive-include opensnitch *.py
View
@@ -6,6 +6,16 @@ OpenSnitch is a GNU/Linux port of the Little Snitch application firewall.
![OpenSnitch](screenshot.png?raw=true)
+## Install
+
+ sudo apt-get install nfqueue-bindings-python
+ cd opensnitch
+ sudo python setup.py install
+
+## Run
+
+ sudo opensnitch
+
## License
This project is copyleft of [Simone Margaritelli](http://www.evilsocket.net/) and released under the GPL 3 license.
View
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+import os
+import sys
+import logging
+
+if not os.geteuid() == 0:
+ sys.exit('OpenSnitch must be run as root.')
+
+logging.basicConfig(format='[%(asctime)s] (%(levelname)s) %(message)s',level=logging.INFO)
+logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
+
+from opensnitch.snitch import Snitch
+
+snitch = Snitch()
+
+try:
+ logging.info( "OpenSnitch running with pid %d." % os.getpid() )
+ snitch.start()
+except KeyboardInterrupt, e:
+ pass
+
+logging.info( "Quitting ..." )
+
+snitch.stop()
View
24 main.py
@@ -1,24 +0,0 @@
-#!/usr/bin/python
-import os
-import sys
-import logging
-
-if not os.geteuid() == 0:
- sys.exit('OpenSnitch must be run as root.')
-
-logging.basicConfig(format='[%(asctime)s] (%(levelname)s) %(message)s',level=logging.INFO)
-logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
-
-from opensnitch.snitch import Snitch
-
-snitch = Snitch()
-
-try:
- logging.info( "OpenSnitch running with pid %d." % os.getpid() )
- snitch.start()
-except KeyboardInterrupt, e:
- pass
-
-logging.info( "Quitting ..." )
-
-snitch.stop()
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import glob
import re
import os
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from opensnitch.proc import get_process_name_by_connection
from opensnitch.app import Application
from dpkt import ip
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import logging
from threading import Lock
from scapy.all import *
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import re
import glob
import os
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import nfqueue
import logging
from threading import Lock
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import os
import logging
import nfqueue
View
@@ -1,3 +1,21 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import easygui as g
import nfqueue
View
@@ -0,0 +1,39 @@
+# This file is part of OpenSnitch.
+#
+# Copyright(c) 2017 Simone Margaritelli
+# evilsocket@gmail.com
+# http://www.evilsocket.net
+#
+# This file may be licensed under the terms of of the
+# GNU General Public License Version 2 (the ``GPL'').
+#
+# Software distributed under the License is distributed
+# on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+# express or implied. See the GPL for the specific language
+# governing rights and limitations.
+#
+# You should have received a copy of the GPL along with this
+# program. If not, go to http://www.gnu.org/licenses/gpl.html
+# or write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+from setuptools import setup, find_packages
+import os
+
+try:
+ long_description = open( 'README.md', 'rt' ).read()
+except:
+ long_description = 'OpenSnitch - An application level firewall for GNU/Linux.'
+
+setup( name = 'opensnitch',
+ version = '0.0.1',
+ description = long_description,
+ long_description = long_description,
+ author = 'Simone Margaritelli',
+ author_email = 'evilsocket@gmail.com',
+ url = 'http://www.github.com/evilsocket/opensnitch',
+ packages = find_packages(),
+ scripts = [ 'bin/opensnitch' ],
+ license = 'GPL',
+ zip_safe = False,
+ install_requires = [ 'scapy', 'easygui', 'dpkt' ]
+)

0 comments on commit 94196d4

Please sign in to comment.