mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
Proper packaging ... more or less.
This commit is contained in:
parent
56e202fd98
commit
94196d403b
13 changed files with 229 additions and 25 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,2 +1,6 @@
|
|||
*.swp
|
||||
*.pyc
|
||||
build
|
||||
dist
|
||||
*.egg-info
|
||||
.idea
|
||||
*.swp
|
||||
|
|
7
MANIFEST.in
Normal file
7
MANIFEST.in
Normal file
|
@ -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
|
10
README.md
10
README.md
|
@ -6,6 +6,16 @@ OpenSnitch is a GNU/Linux port of the Little Snitch application firewall.
|
|||
|
||||

|
||||
|
||||
## 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.
|
||||
|
|
42
bin/opensnitch
Executable file
42
bin/opensnitch
Executable file
|
@ -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()
|
24
main.py
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()
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 *
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
39
setup.py
Normal file
39
setup.py
Normal file
|
@ -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' ]
|
||||
)
|
Loading…
Add table
Reference in a new issue