├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature-request.md └── workflows │ ├── build_ebpf_modules.yml │ ├── generic_validations.yml │ └── go.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── daemon ├── .gitignore ├── Gopkg.toml ├── Makefile ├── conman │ ├── connection.go │ └── connection_test.go ├── core │ ├── core.go │ ├── ebpf.go │ ├── gzip.go │ ├── system.go │ └── version.go ├── data │ └── rules │ │ ├── 000-allow-localhost.json │ │ └── 000-allow-localhost6.json ├── default-config.json ├── dns │ ├── ebpfhook.go │ ├── parse.go │ ├── systemd │ │ └── monitor.go │ └── track.go ├── firewall │ ├── common │ │ └── common.go │ ├── config │ │ ├── config.go │ │ └── config_test.go │ ├── iptables │ │ ├── iptables.go │ │ ├── monitor.go │ │ ├── rules.go │ │ └── system.go │ ├── nftables │ │ ├── chains.go │ │ ├── chains_test.go │ │ ├── exprs │ │ │ ├── counter.go │ │ │ ├── counter_test.go │ │ │ ├── ct.go │ │ │ ├── ct_test.go │ │ │ ├── enums.go │ │ │ ├── ether.go │ │ │ ├── ether_test.go │ │ │ ├── iface.go │ │ │ ├── iface_test.go │ │ │ ├── ip.go │ │ │ ├── ip_test.go │ │ │ ├── limit.go │ │ │ ├── log.go │ │ │ ├── log_test.go │ │ │ ├── meta.go │ │ │ ├── meta_test.go │ │ │ ├── nat.go │ │ │ ├── nat_test.go │ │ │ ├── notrack.go │ │ │ ├── operator.go │ │ │ ├── port.go │ │ │ ├── port_test.go │ │ │ ├── protocol.go │ │ │ ├── protocol_test.go │ │ │ ├── quota.go │ │ │ ├── quota_test.go │ │ │ ├── utils.go │ │ │ ├── verdict.go │ │ │ └── verdict_test.go │ │ ├── monitor.go │ │ ├── monitor_test.go │ │ ├── nftables.go │ │ ├── nftest │ │ │ ├── nftest.go │ │ │ ├── test_utils.go │ │ │ └── utils.go │ │ ├── parser.go │ │ ├── rule_helpers.go │ │ ├── rules.go │ │ ├── rules_test.go │ │ ├── system.go │ │ ├── system_test.go │ │ ├── tables.go │ │ ├── tables_test.go │ │ ├── testdata │ │ │ └── test-sysfw-conf.json │ │ ├── utils.go │ │ └── utils_test.go │ └── rules.go ├── go.mod ├── go.sum ├── log │ ├── formats │ │ ├── csv.go │ │ ├── formats.go │ │ ├── json.go │ │ ├── rfc3164.go │ │ └── rfc5424.go │ ├── log.go │ └── loggers │ │ ├── logger.go │ │ ├── remote.go │ │ ├── remote_syslog.go │ │ └── syslog.go ├── main.go ├── netfilter │ ├── packet.go │ ├── queue.c │ ├── queue.go │ └── queue.h ├── netlink │ ├── ifaces.go │ ├── procmon │ │ └── procmon.go │ ├── socket.go │ ├── socket_linux.go │ ├── socket_packet.go │ ├── socket_test.go │ └── socket_xdp.go ├── netstat │ ├── entry.go │ ├── find.go │ ├── parse.go │ └── parse_packet.go ├── network_aliases.json ├── opensnitchd-dinit ├── opensnitchd-openrc ├── opensnitchd.service ├── procmon │ ├── activepids.go │ ├── audit │ │ ├── client.go │ │ └── parse.go │ ├── cache.go │ ├── cache_events.go │ ├── cache_events_test.go │ ├── cache_test.go │ ├── details.go │ ├── ebpf │ │ ├── cache.go │ │ ├── config.go │ │ ├── debug.go │ │ ├── ebpf.go │ │ ├── events.go │ │ ├── find.go │ │ ├── monitor.go │ │ └── utils.go │ ├── find.go │ ├── find_test.go │ ├── monitor │ │ └── init.go │ ├── parse.go │ ├── process.go │ ├── process_test.go │ └── testdata │ │ └── proc-environ ├── rule │ ├── loader.go │ ├── loader_test.go │ ├── operator.go │ ├── operator_aliases.go │ ├── operator_lists.go │ ├── operator_test.go │ ├── rule.go │ ├── rule_test.go │ └── testdata │ │ ├── 000-allow-chrome.json │ │ ├── 001-deny-chrome.json │ │ ├── invalid-regexp-list.json │ │ ├── invalid-regexp.json │ │ ├── lists │ │ ├── domains │ │ │ └── domainlists.txt │ │ ├── ips │ │ │ └── ips.txt │ │ ├── nets │ │ │ └── nets.txt │ │ └── regexp │ │ │ └── domainsregexp.txt │ │ ├── live_reload │ │ ├── test-live-reload-delete.json │ │ └── test-live-reload-remove.json │ │ ├── rule-disabled-operator-list-expanded.json │ │ ├── rule-disabled-operator-list.json │ │ ├── rule-operator-list-data-empty.json │ │ └── rule-operator-list.json ├── statistics │ ├── event.go │ └── stats.go ├── system-fw.json ├── tasks │ ├── base.go │ ├── doc.go │ ├── main.go │ ├── main_test.go │ ├── nodemonitor │ │ ├── main.go │ │ └── main_test.go │ ├── pidmonitor │ │ ├── main.go │ │ └── main_test.go │ └── socketsmonitor │ │ ├── dump.go │ │ ├── main.go │ │ └── options.go └── ui │ ├── alerts.go │ ├── auth │ └── auth.go │ ├── client.go │ ├── client_test.go │ ├── config │ └── config.go │ ├── config_utils.go │ ├── notifications.go │ ├── notifications_tasks.go │ ├── protocol │ └── .gitkeep │ └── testdata │ ├── default-config.json │ └── default-config.json.orig ├── ebpf_prog ├── Makefile ├── README ├── arm-clang-asm-fix.patch ├── bpf_headers │ ├── bpf_core_read.h │ ├── bpf_helper_defs.h │ ├── bpf_helpers.h │ └── bpf_tracing.h ├── common.h ├── common_defs.h ├── opensnitch-dns.c ├── opensnitch-procs.c └── opensnitch.c ├── proto ├── .gitignore ├── Makefile └── ui.proto ├── release.sh ├── screenshots ├── opensnitch-ui-general-tab-deny.png ├── opensnitch-ui-proc-details.png └── screenshot.png ├── ui ├── .gitignore ├── LICENSE ├── MANIFEST.in ├── Makefile ├── bin │ └── opensnitch-ui ├── i18n │ ├── Makefile │ ├── README.md │ ├── generate_i18n.sh │ ├── locales │ │ ├── cs_CZ │ │ │ └── opensnitch-cs_CZ.ts │ │ ├── de_DE │ │ │ └── opensnitch-de_DE.ts │ │ ├── es_ES │ │ │ └── opensnitch-es_ES.ts │ │ ├── eu_ES │ │ │ └── opensnitch-eu_ES.ts │ │ ├── fi_FI │ │ │ └── opensnitch-fi_FI.ts │ │ ├── fr_FR │ │ │ └── opensnitch-fr_FR.ts │ │ ├── hi_IN │ │ │ └── opensnitch-hi_IN.ts │ │ ├── hu_HU │ │ │ └── opensnitch-hu_HU.ts │ │ ├── id_ID │ │ │ └── opensnitch-id_ID.ts │ │ ├── it_IT │ │ │ └── opensnitch-it_IT.ts │ │ ├── ja_JP │ │ │ └── opensnitch-ja_JP.ts │ │ ├── lt_LT │ │ │ └── opensnitch-lt_LT.ts │ │ ├── nb_NO │ │ │ └── opensnitch-nb_NO.ts │ │ ├── nl_NL │ │ │ └── opensnitch-nl_NL.ts │ │ ├── pt_BR │ │ │ └── opensnitch-pt_BR.ts │ │ ├── ro_RO │ │ │ └── opensnitch-ro_RO.ts │ │ ├── ru_RU │ │ │ └── opensnitch-ru_RU.ts │ │ ├── sv_SE │ │ │ └── opensnitch-sv_SE.ts │ │ ├── tr_TR │ │ │ └── opensnitch-tr_TR.ts │ │ ├── uk_UA │ │ │ └── opensnitch-uk_UA.ts │ │ └── zh_TW │ │ │ └── opensnitch-zh_TW.ts │ └── opensnitch_i18n.pro ├── opensnitch │ ├── __init__.py │ ├── actions │ │ ├── __init__.py │ │ ├── default_configs.py │ │ ├── enums.py │ │ └── utils.py │ ├── auth │ │ └── __init__.py │ ├── config.py │ ├── customwidgets │ │ ├── __init__.py │ │ ├── addresstablemodel.py │ │ ├── colorizeddelegate.py │ │ ├── firewalltableview.py │ │ ├── generictableview.py │ │ ├── main.py │ │ ├── netstattablemodel.py │ │ └── updownbtndelegate.py │ ├── database │ │ ├── __init__.py │ │ ├── enums.py │ │ └── migrations │ │ │ ├── upgrade_1.sql │ │ │ ├── upgrade_2.sql │ │ │ └── upgrade_3.sql │ ├── desktop_parser.py │ ├── dialogs │ │ ├── __init__.py │ │ ├── conndetails.py │ │ ├── firewall.py │ │ ├── firewall_rule.py │ │ ├── preferences.py │ │ ├── processdetails.py │ │ ├── prompt │ │ │ ├── __init__.py │ │ │ ├── _checksums.py │ │ │ ├── _constants.py │ │ │ ├── _details.py │ │ │ └── _utils.py │ │ ├── ruleseditor.py │ │ └── stats.py │ ├── firewall │ │ ├── __init__.py │ │ ├── chains.py │ │ ├── enums.py │ │ ├── exprs.py │ │ ├── profiles.py │ │ ├── rules.py │ │ └── utils.py │ ├── nodes.py │ ├── notifications.py │ ├── plugins │ │ ├── __init__.py │ │ ├── downloader │ │ │ ├── __init__.py │ │ │ ├── _gui.py │ │ │ ├── downloader.py │ │ │ └── example │ │ │ │ └── downloaders.json │ │ ├── highlight │ │ │ ├── __init__.py │ │ │ ├── example │ │ │ │ ├── commonActionsDelegate.json │ │ │ │ └── rulesActionsDelegate.json │ │ │ └── highlight.py │ │ ├── sample │ │ │ ├── __init__.py │ │ │ └── sample.py │ │ └── virustotal │ │ │ ├── __init__.py │ │ │ ├── _popups.py │ │ │ ├── _procdialog.py │ │ │ ├── _utils.py │ │ │ ├── example │ │ │ └── virustotal.json │ │ │ └── virustotal.py │ ├── proto │ │ ├── __init__.py │ │ ├── pre3200 │ │ │ ├── ui_pb2.py │ │ │ └── ui_pb2_grpc.py │ │ ├── ui_pb2.py │ │ └── ui_pb2_grpc.py │ ├── res │ │ ├── __init__.py │ │ ├── firewall.ui │ │ ├── firewall_rule.ui │ │ ├── icon-alert.png │ │ ├── icon-off.png │ │ ├── icon-pause.png │ │ ├── icon-pause.svg │ │ ├── icon-red.png │ │ ├── icon-white.png │ │ ├── icon-white.svg │ │ ├── icon.png │ │ ├── preferences.ui │ │ ├── process_details.ui │ │ ├── prompt.ui │ │ ├── resources.qrc │ │ ├── ruleseditor.ui │ │ ├── stats.ui │ │ ├── terminal.svg │ │ └── themes │ │ │ └── dark │ │ │ └── icons │ │ │ ├── LICENSE │ │ │ ├── accessories-text-editor.svg │ │ │ ├── application-exit.svg │ │ │ ├── applications-system.svg │ │ │ ├── computer.svg │ │ │ ├── dialog-cancel.svg │ │ │ ├── dialog-close.svg │ │ │ ├── dialog-error.svg │ │ │ ├── dialog-information.svg │ │ │ ├── dialog-ok.svg │ │ │ ├── dialog-warning.svg │ │ │ ├── document-new.svg │ │ │ ├── document-open.svg │ │ │ ├── document-properties.svg │ │ │ ├── document-save.svg │ │ │ ├── edit-clear-all.svg │ │ │ ├── edit-clear.svg │ │ │ ├── edit-delete.svg │ │ │ ├── emblem-default.svg │ │ │ ├── emblem-documents.svg │ │ │ ├── emblem-important.svg │ │ │ ├── emblem-system.svg │ │ │ ├── folder-remote.svg │ │ │ ├── format-justify-fill.svg │ │ │ ├── go-bottom.svg │ │ │ ├── go-down.svg │ │ │ ├── go-jump.svg │ │ │ ├── go-previous.svg │ │ │ ├── go-top.svg │ │ │ ├── go-up.svg │ │ │ ├── help-browser.svg │ │ │ ├── list-add.svg │ │ │ ├── list-remove.svg │ │ │ ├── media-playback-pause.svg │ │ │ ├── media-playback-start.svg │ │ │ ├── network-server.svg │ │ │ ├── network-wired.svg │ │ │ ├── network-workgroup.svg │ │ │ ├── preferences-desktop.svg │ │ │ ├── preferences-system.svg │ │ │ ├── reload.svg │ │ │ ├── security-high.svg │ │ │ ├── system-run.svg │ │ │ ├── system-search.svg │ │ │ ├── view-sort-ascending.svg │ │ │ ├── view-sort-descending.svg │ │ │ └── window-close.svg │ ├── rules.py │ ├── service.py │ ├── utils │ │ ├── __init__.py │ │ ├── duration │ │ │ ├── __init__.py │ │ │ └── duration.py │ │ ├── infowindow.py │ │ ├── languages.py │ │ ├── network_aliases │ │ │ ├── __init__.py │ │ │ ├── network_aliases.json │ │ │ └── network_aliases.py │ │ ├── qvalidator.py │ │ ├── sockets.py │ │ └── xdg.py │ └── version.py ├── requirements.txt ├── resources │ ├── icons │ │ ├── 48x48 │ │ │ └── opensnitch-ui.png │ │ ├── 64x64 │ │ │ └── opensnitch-ui.png │ │ └── opensnitch-ui.svg │ ├── io.github.evilsocket.opensnitch.appdata.xml │ ├── kcm_opensnitch.desktop │ └── opensnitch_ui.desktop ├── setup.py └── tests │ ├── README.md │ ├── __init__.py │ ├── dialogs │ ├── __init__.py │ ├── test_preferences.py │ └── test_ruleseditor.py │ └── test_nodes.py └── utils ├── legacy └── make_ads_rules.py ├── packaging ├── build_modules.sh ├── daemon │ ├── deb │ │ └── debian │ │ │ ├── NEWS │ │ │ ├── changelog │ │ │ ├── control │ │ │ ├── copyright │ │ │ ├── gbp.conf │ │ │ ├── gitlab-ci.yml │ │ │ ├── opensnitch.init │ │ │ ├── opensnitch.install │ │ │ ├── opensnitch.logrotate │ │ │ ├── opensnitch.service │ │ │ ├── rules │ │ │ ├── source │ │ │ └── format │ │ │ └── watch │ └── rpm │ │ └── opensnitch.spec └── ui │ ├── deb │ └── debian │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── postinst │ │ ├── postrm │ │ ├── rules │ │ └── source │ │ ├── format │ │ └── options │ └── rpm │ └── opensnitch-ui.spec └── scripts ├── ads └── update_adlists.sh ├── debug-ebpf-maps.sh ├── ipasn_db_sync.sh ├── ipasn_db_update.sh └── restart-opensnitch-onsleep.sh /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: gustavo-iniguez-goya 4 | patreon: # Replace with a single patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐞 Bug report 3 | about: Create a report to help us improve 4 | title: '[Bug Report]
│{1}\t{2}{3}{4}
".format(tree, path.value, spaces, indicator, path.key) 17 | spaces += " " * 4 18 | indicator = "\\_ " 19 | 20 | # XXX: table element doesn't work? 21 | details = """{0} {1}:{2} -> {3}:{4} 22 |Environment variables:
34 | {17} 35 | """.format( 36 | con.protocol.upper(), 37 | con.src_port, con.src_ip, con.dst_ip, con.dst_port, 38 | space * 6, con.process_path, 39 | " ".join(con.process_args), 40 | space * 6, con.process_cwd, 41 | space * 7, con.process_checksums[Config.OPERAND_PROCESS_HASH_MD5], 42 | space * 9, con.user_id, 43 | space * 9, con.process_id, 44 | tree, 45 | "".join('{}={}
'.format(key, value) for key, value in con.process_env.items()) 46 | ) 47 | 48 | detailsWidget.document().clear() 49 | detailsWidget.document().setHtml(details) 50 | detailsWidget.moveCursor(QtGui.QTextCursor.Start) 51 | -------------------------------------------------------------------------------- /ui/opensnitch/firewall/utils.py: -------------------------------------------------------------------------------- 1 | 2 | from google.protobuf import __version__ as protobuf_version 3 | from .enums import * 4 | 5 | class Utils(): 6 | 7 | @staticmethod 8 | def isExprPort(value): 9 | """Return true if the value is valid for a port based rule: 10 | nft add rule ... tcp dport 22 accept 11 | """ 12 | return value == Statements.TCP.value or \ 13 | value == Statements.UDP.value or \ 14 | value == Statements.UDPLITE.value or \ 15 | value == Statements.SCTP.value or \ 16 | value == Statements.DCCP.value 17 | 18 | @staticmethod 19 | def isProtobufSupported(): 20 | """ 21 | The protobuf operations append() and insert() were introduced on 3.8.0 version. 22 | """ 23 | vparts = protobuf_version.split(".") 24 | return int(vparts[0]) >= 3 and int(vparts[1]) >= 8 25 | -------------------------------------------------------------------------------- /ui/opensnitch/plugins/downloader/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is part of OpenSnitch. 2 | # 3 | # OpenSnitch is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # OpenSnitch is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with OpenSnitch. If not, see19 | Whenever a program tries to establish a new connection, it'll prompt the user to allow or deny it. 20 |
21 |22 | The user can decide if block the outgoing connection based on properties of the connection: by port, by uid, by dst ip, by program or a combination of them. These rules can last forever, until the app restart or just one time. 23 |
24 |25 | The GUI allows the user to view live outgoing connections, as well as search by process, user, host or port. 26 |
27 |28 | OpenSnitch can also work as a system-wide domains blocker, by using lists of domains, list of IPs or list of regular expressions. 29 |
30 |