Commit graph

962 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
544887adeb ui, pkgs: added packaging step to fix pb2 files. 2021-07-17 11:13:34 +02:00
Gustavo Iñiguez Goia
be32ddc574 added script to update ads lists, old script relocated.
There's a new way of blocking lists of domains:
https://github.com/evilsocket/opensnitch/wiki/block-lists

However the update of the lists is not implemented yet. You can use
this or other simple script to download and update the lists (in hosts
format).
2021-07-17 00:41:13 +02:00
Gustavo Iñiguez Goia
708a7e6333 Bump versions to v1.4.0rc3 2021-07-16 23:41:02 +02:00
Gustavo Iñiguez Goia
cec619aa3b removed debugging log message 2021-07-16 23:24:52 +02:00
Gustavo Iñiguez Goia
85802811d1 fixed race condition counting lists of domains
Removed the number of loaded lists of domains, that caused a race
condition and added no value. It was only used for debugging
purposes.
2021-07-07 18:50:30 +02:00
Gustavo Iñiguez Goia
5e56e9033f ui, process monitor dialog: fixed exception
Fixed exception when stopping the monitor fails and an error is
returned.
2021-06-19 01:00:33 +02:00
Gustavo Iñiguez Goia
38e3bd45ed
Merge pull request #442 from shollingsworth/issue-439-python-module-conflict-fix
fixes #439 - module namespace conflict
2021-06-19 00:08:21 +02:00
Steven Hollingsworth
de559dccf8
Changed import ui_pb2 from global to relative 2021-06-18 12:54:17 -07:00
Steven Hollingsworth
3d9b44cb50
fixes #439 - module namespace conflict 2021-06-17 16:39:35 -07:00
Gustavo Iñiguez Goia
1c73a48b9c
Merge pull request #438 from gnuhead-chieb/master
Update Japanese translation
2021-06-16 14:34:38 +02:00
gnuhead-chieb
a006f25fb3
Add files via upload 2021-06-16 11:39:42 +00:00
Gustavo Iñiguez Goia
21c6a914d6 drop connections while a pop-up is running
Prior to v1.4.x versions, when a pop-up asked the user to allow or deny
a connection, the rest of the network traffic was dropped until an
action was taken.

We fixed it, but when a pop-up was asking to allow or deny a new connection,
we let it passing by if the daemon's DefaultAction option was set to
allow, even if the user hadn't taken an action on it yet.

It also caused some confusion if the users had configured the pop-up's
DefaultAction to deny, they were expecting to not allow the connection
until they had decided what to do.

Now the previous behaviour has been restored, having these usage
scenarios:
- If the GUI is connected + daemon DefaultAction set to allow or deny.
  Result:
    1. Prompt the user to allow or deny the new connection.
    2. Deny the new connection until the user takes an action on it.
    3. Allow the rest of traffic, allowing known connections, and
       denying new ones until the active pop-up is closed and we can
       prompt the user again.

- GUI disconnected.
  Result:
    1. Apply daemon's DefaultAction from the configuration file
       default-config.json.

closes: #392
2021-06-16 09:50:36 +02:00
Gustavo Iñiguez Goia
eaa015870b ui,rules: fixed refreshing list after delete,
- Fixed refreshing rules list after delete a rule(s).
  (There was an annoying delay).
- Added button to delete connections associated with a rule, from the
  details view of a rule. (related: #334).
2021-06-09 00:25:24 +02:00
Gustavo Iñiguez Goia
465d531496 find PID: use legacy methods if the PID is not found.
Some times, processes that establish connections to localhost are only
found in /proc/net/* files. So if we fail to get the PID of a
connection, fallback to legacy method to find it.
2021-06-08 14:11:19 +02:00
Gustavo Iñiguez Goia
f143107639 ebpf: fixed race condition when listing connections
Better fix for locking already established connections.
2021-06-07 22:55:08 +02:00
Gustavo Iñiguez Goia
da23c827f7 added nftables support
Added basic nftables support, which adds the needed rules to intercept
outgoing network traffic and DNS responses. System rules will be added
soon.

What netfilter subsystem to use is determined based on the following:
- nftables: if the _iptables_ binary is not present in the system, or
  if the iptables version (iptables -V) is
  "iptables vX.Y.Z (nf_tables)".
- iptables: in the rest of the cases.
2021-06-07 01:32:05 +02:00
Gustavo Iñiguez Goia
3d11134363 fixed race condition when deleting a rule from disk 2021-06-05 16:33:50 +02:00
Gustavo Iñiguez Goia
ff40e99f77 tests, rules: added Duration change test
Verify that if the user changes the Duration of a temporary rule, the
old timer does not delete the rule.
2021-06-03 17:35:48 +02:00
Gustavo Iñiguez Goia
bae8b711bd
Merge pull request #430 from ovari/master
Update opensnitch_ui.desktop
2021-06-03 00:14:24 +02:00
ovari
5f73dc1069
Update opensnitch_ui.desktop 2021-06-03 06:44:21 +10:00
Gustavo Iñiguez Goia
403c218209 prevent deleting temporary rules when the Duration changes
When the Duration of a rule changed (from 1h to 5m, from 5m to until
restart, etc), the timer of the old rule was fired, causing deleting the
rule from the list.

This erroneous behaviour could be one of the reasons of #429
2021-06-01 23:52:02 +02:00
Gustavo Iñiguez Goia
95a30c4959 ui, rules editor: fixed editing/adding rules
There was a race condition that caused several problems when editing or
adding rules.

for rules of type "list", the operand must be "list" as well.

related: #429 #425
2021-05-31 20:22:44 +02:00
Gustavo Iñiguez Goia
e5b54f0a6b eBPF: ignore netlink errors if there're no connections
When enabling the eBPF monitor method we dump the active connections,
but in some cases there're no active connections, and because of this
we're failing enabling this monitor method.

If there're no connections established, netlink returns 0 entries. It's
not clear if it's an indication of error in some cases or the expected
result.

Either way:
- fail only if we're unable to load the eBPF module.
- dump TCP IPv6 connections only if IPv6 is enabled in the syste,-
2021-05-29 00:16:18 +02:00
Gustavo Iñiguez Goia
1db03b5570 eBPF procs monitor method: fixed race conditions
It'd probably be a good idea to write a module and encapsulate all the
functionality of the fields in funcs(), to lock them properly
(get/set maps, etc).

TODO: replace monitorLocalAddress() by
netlink.AddrSubscribeWithoptions(), to receive addresses' events
asynchronously.
2021-05-26 22:52:33 +02:00
Gustavo Iñiguez Goia
60414931d6 when deleting a rule stop lists of domains monitor 2021-05-25 22:21:05 +02:00
Gustavo Iñiguez Goia
2c1f8e1d8c ui: added description to the .desktop file
closes #422
2021-05-23 16:14:36 +02:00
Gustavo Iñiguez Goia
0464001501
Merge pull request #418 from ovari/master
Update opensnitch-hu_HU.ts
2021-05-20 23:05:04 +02:00
ovari
cbabc84076
Update opensnitch-hu_HU.ts 2021-05-21 06:57:25 +10:00
ovari
5ae629bde4
Update opensnitch-hu_HU.ts 2021-05-20 19:49:23 +10:00
Gustavo Iñiguez Goia
259a02026c
Merge pull request #417 from raboof/add-gobpf-to-go.mod
Add gobpf to go.mod
2021-05-19 21:51:24 +02:00
Arnout Engelen
356428b6c9
Add gobpf to go.mod
gobpf was introduced in #397 but not added to go.mod yet
2021-05-19 21:21:27 +02:00
Gustavo Iñiguez Goia
6ea63f72dc make "linux kernel" connections configurable
Sometimes when a new connection is about to be established, we don't get
the PID of the process using the eBPF proc monitor method. But in some
rare situations, the kernel still holds information about the connection
(sock_diag struct basically). We assume that these connections are
initiated from kernel space.

Per some debugging, this doesn't seem to be always the root cause, so
these connections will only be shown if InterceptUnknown config field is
set to true.
2021-05-16 23:58:28 +02:00
Gustavo Iñiguez Goia
423dbd6ff3 deb,rpm: minor changes to ease packing 2021-05-16 23:55:34 +02:00
Gustavo Iñiguez Goia
050292601e translations: deleted hu_HU file from wrong directory 2021-05-14 01:57:18 +02:00
ovari
5be9911f00
Add translation template for hu_HU and sort TRANSLATORS alphabetically (#411)
* Update opensnitch_i18n.pro

List `TRANSLATIONS` alphabetically

* Create opensnitch-hu_HU.ts
2021-05-13 23:34:56 +02:00
Gustavo Iñiguez Goia
03f378687b updated translation files, added ro_RO and hu_HU
New translation files not yet translated.
2021-05-12 21:06:20 +02:00
Gustavo Iñiguez Goia
1be19788ed ui: updated spanish translation 2021-05-10 21:37:21 +02:00
Flávio Costa
49cd9052eb
Update Brazilian Portuguese translation (#409)
* Update Brazilian Portuguese translation

* Update Brazilian Portuguese translation
2021-05-10 21:31:57 +02:00
Gustavo Iñiguez Goia
f0b4d7ab68 ui, systray menu: fixed translations
translations must occur inside __init__():
2021-05-09 23:03:17 +02:00
Gustavo Iñiguez Goia
0e6489bab7
Update i18n instructions 2021-05-08 00:06:56 +02:00
Gustavo Iñiguez Goia
2e42e989d4 Bump versions to 1.4.0rc2
As we've added eBPF interception method, we need go iovisor ebpf package,
which is not packaged for Debian yet, so the way I was compiling it
differs a little bit (instead of using gbp buildpackage,
dpkg-buildpackage is used).

Aside from that, there'll be a new eBPF module (.o ELF), which must be
packaged with the packages. Will be compiled on the fly, but maybe it
could be hosted in the repo, because it won't change that much.
2021-05-07 21:24:42 +02:00
Gustavo Iñiguez Goia
042b04e3fb ui: main window improvements
- disable clicks when the user enters into the details of an item
  (process, host, user, etc).
- fixed displaying the button to inspect a process.
- improved listing connections of a process.
2021-05-01 01:29:30 +02:00
Gustavo Iñiguez Goia
dc56be495c ui: display 50 events by default, fixed pop-up crash
- By default there was no limit of events to display. If the user had
  the GUI opened for a long period of time, that could lead to an
  excessive CPU usage and thus a bad user experience. So by default
  set it to 50.
- pop-ups: Fixed crash when getting malformed icons from .desktop
  files.
2021-04-27 01:29:05 +02:00
Gustavo Iñiguez Goia
e05658226c
Merge pull request #383 from raboof/allow-newer-grpcio-tools
Allow using newer grpcio-tools
2021-04-27 01:14:14 +02:00
Arnout Engelen
517ecd7e13
Allow using newer grpcio-tools
My OS comes with grpcio-tools 1.36.1, which seems to work fine, so it
would be nice to allow the ui to use that instead of building 1.10.1
specifically for opensnitch.
2021-04-24 21:05:02 +02:00
Gustavo Iñiguez Goia
82ca19a190 ui: configure more options from the preferences
- pop-ups: allow to configure if the "advanced view" is displayed
  by default or not.
- pop-ups: allow to configure 3 more fields to filter connections by.
- services.py: fixed typo that caused an error when displaying a
  message.

closes #399.
2021-04-23 22:25:51 +02:00
Gustavo Iñiguez Goia
05f7e38f9d ebpf: added patch to compile ebpf module for arm 2021-04-21 20:49:31 +02:00
Gustavo Iñiguez Goia
0f7e93acdc fixed parsing /proc/$pid/stat starttime field
On systems that have been running for a long time (for example 552
days) we were failing parsing the starttime field:

```
Could not find or convert Starttime. This should never happen.
Please report this incident to the Opensnitch developers:
strconv.Atoi: parsing "4242026842": value out of range
```

- extra: fixed tests.
2021-04-20 16:31:49 +02:00
Gustavo Iñiguez Goia
80c9519d08 ui: make UI updates on the main thread
- Updates of the GUI must occur on the main thread of the app. AskRule,
  Ping, Subscribe and Notifications runs on a different thread.
- Fixed paused state when the daemon is running (and paused) and the GUI
  is launched.
- Moved functionality to its own file/class.
2021-04-18 17:01:53 +02:00
Gustavo Iñiguez Goia
966342cbbc ui: allow to stop/start interception from systray
- removed unused import time.
- allow to pause/start interception from tray contextual menu.
- improved case when the daemon is in paused state, and the GUI is
  launched.

There's more work yet to do to improve the states when there're several
nodes connected.

closes #398
2021-04-17 22:09:16 +02:00