Commit graph

1098 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
0a4c44bf71 ui: better rules listing
- Reduce query complexity by querying only connections table.
- Fixed filtering fields.
2022-03-01 16:37:02 +01:00
Gustavo Iñiguez Goia
e7ba2bdf7b ui: fixed launching the GUI on LxQt
Closes #618
2022-02-27 01:30:18 +01:00
Gustavo Iñiguez Goia
43adcef675 ui, events: fixed crash when clicking on the Rules column 2022-02-23 10:40:51 +01:00
Gustavo Iñiguez Goia
93f61d09e8 ebpf cache improvements
The eBPF cache is meant mainly for certain applications that
establish 2-4 new connections in under 1-2 seconds. Thus, a cache of 1
minute per item was too much, 10-20 seconds is enough.

Also, check old items every minute to keep the number of items low.
2022-02-22 20:33:29 +01:00
Gustavo Iñiguez Goia
4babc52524 exclude ::1 from dns cache
It caused some problems. See #629
2022-02-21 17:51:29 +01:00
Gustavo Iñiguez Goia
f575ba0651
Merge pull request #625 from cinerea0/master
Allow building on systems using musl
2022-02-19 22:03:45 +01:00
Gustavo Iñiguez Goia
377b4c8f48 ui, events: improved UX, fixed Users' query
- Improved user experience, by remembering rows selection when going
  back from a detail view. Fixes #620.
- Fixed Users' view query (it didn't list user's connections
  correctly and it wasn't efficient).
2022-02-19 10:55:54 +01:00
cinerea0
a550252f79 daemon: allow building on musl 2022-02-18 20:36:56 -05:00
Gustavo Iñiguez Goia
026f05d9cc dns, ebpf: do not crash on exit when in DEBUG
If the daemon crashes on exit, fw rules are not deleted.
2022-02-18 00:42:54 +01:00
Gustavo Iñiguez Goia
51c5cd53da actions: updated go version to 1.15
Needed to compile the daemon with latest nftables lib version.
2022-02-18 00:33:26 +01:00
Gustavo Iñiguez Goia
1f79b3a8fd fw, nftables: better rules deletion on exit
We were not deleting our rules correctly on exit if another fw tool had
added rules to the nftables tables. This problem caused to detect that
our rules were not added, so we added them again.
2022-02-17 23:54:55 +01:00
Gustavo Iñiguez Goia
88b30e98d1 go.mod: updated nftables version
google/nftables removed koneu/natend lib, so we don't need it anymore.

Reported here: #623
2022-02-17 16:16:44 +01:00
Gustavo Iñiguez Goia
3128dec63c ui, events: improved restoring rules' columns
Restore rules' columns properly after:
 - double clicking on the Rules column of the main tab -> and then
   clicking on the back button.
 - clicking on the Temporary/Permanent items of the Rules tab.
 - clicking on a Rule and going back again to the list of rules.

Misc:
 - Disallow double-clicks when entering into a detail view from the
Events tab.
 - Removed extra/repeated columns adjusting.

Closes #619
2022-02-17 01:45:22 +01:00
calesanz
a4b7f57806
Add ebpf based dns lookup hooks (#582)
When using DoT or DoH opensnitch cannot intercept the dns packets.
Therefore the UI always shows IP addresses instead of hostnames. To fix
this issue an ebpf (uprobe) filter was created to hook getaddrinfo and
gethostbyname calls.

In order to be independent of libbcc an additional module was added to
ebpf_prog. Without libbcc the libc function offsets must be resolved
manually. In order to find the loaded glibc version some cgo code was
added.
2022-02-15 21:25:35 +01:00
Gustavo Iñiguez Goia
dd7cb13777 ui, pop-ups: fixed exception when app args are empty
reported here: #617
2022-02-10 21:56:35 +01:00
Marko Zajc
feaf8de508
Fix a minor typo (#610)
* ui, preferences: fixed typo
2022-02-05 20:58:27 +01:00
Gustavo Iñiguez Goia
c396ed652c ui, stats: fixed typo 2022-02-02 18:32:15 +01:00
Gustavo Iñiguez Goia
87722a71cd ui: fixed displaying clean events button
The button to delete events of a view is not displayed on the Nodes or
Rules view. It's only displayed in these views when entering into a
detail view.

Closes #605
2022-02-02 18:16:38 +01:00
Gustavo Iñiguez Goia
d0bbf41b61
Merge pull request #608 from staticssleever668/feat/systemd_unit_name
Improve systemd service unit name
2022-02-02 12:54:14 +01:00
Yaroslav Chvanov
64dc70aa7a
Improve systemd service unit name
It was a full sentence that looked out of place. Official documentation
of systemd recommends to make it a short capitalized label, preferably a
noun.
See man page `systemd.unit`.[1]

[1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Description=
2022-02-02 14:24:13 +03:00
Gustavo Iñiguez Goia
e633588139 fw: fixed formatting directives 2022-01-29 19:42:32 +01:00
Gustavo Iñiguez Goia
46ee6925d2
Merge pull request #607 from tioguda/master
Update Brazilian Portuguese translation
2022-01-29 17:55:36 +01:00
tioguda
c716a9862a
Update Brazilian Portuguese translation 2022-01-29 13:19:14 -03:00
Gustavo Iñiguez Goia
c67e72075c ui, events window: allow to delete rules pressing DEL key
misc: initialize properly tables' header labels.

closes #601
2022-01-29 12:55:24 +01:00
Gustavo Iñiguez Goia
d9e8699702 Bump versions to v1.5.0 2022-01-28 23:29:31 +01:00
Gustavo Iñiguez Goia
fcf03405e1 tests, conman: added new tests 2022-01-28 23:16:51 +01:00
Gustavo Iñiguez Goia
49841d4f73 tests, netlink: added tests for netlink functions 2022-01-28 23:02:25 +01:00
Gustavo Iñiguez Goia
c86125824c ui, notifications: fixed crash when dbus service fails
In some scenarios, showing a notificatio led to a crash with the error:

Dbus.Error.ServiceUnknown: The name ... was not provided by any .service
files.
2022-01-28 16:27:13 +01:00
Gustavo Iñiguez Goia
70486d8cd2 misc: fixed directive formatting 2022-01-28 14:07:48 +01:00
Gustavo Iñiguez Goia
5d6121bb77 fixed connecting to the GUI via TCP on localhost
There are two issues when connecting to the GUI via TCP on localhost:

- Sometimes when the daemon is launched with the GUI already running, the
  notifications channel is not established.

  * Give 10 seconds to connect, if it timeouts, disconnect everything
    and try to reconnect again.

- After some time the notifications channel is closed from the server
  side (i.e., the GUI), and it is not restablished.

  * Forcefully disconnect everything, and let it reconnect again.

Both issues should be investigated further to find the root problem.
2022-01-28 01:47:29 +01:00
Gustavo Iñiguez Goia
05144869e9 tests: fixed formatting directive 2022-01-28 01:42:05 +01:00
Gustavo Iñiguez Goia
cbe8f5ab9a rules: added operator unit tests
New tests for operator type lists.domains_regexp, lists.ips and
lists.nets.

New tests to check leaks when reloading lists:
53419fe
2022-01-27 00:17:46 +01:00
Gustavo Iñiguez Goia
53419fe8bc rules: fixed leak/panic when parsing/loading lists
Rules of type lists [domains, IPs, network ranges] are reloaded
whenever a file containing the data changes.

One could expect to update these files once or twice a day, but
by updating the files continuously it was possible to cause a leak,
leading to a crash.
2022-01-26 21:12:16 +01:00
Gustavo Iñiguez Goia
a936e8755a deb packages: fixed installing on old distros
debhelper-compat 12 caused on ubuntu 16 errors after installing.
debhelper-compa 11 doesn't fail on ubuntu 16, and works on SysVinit
and systemd based systems.

On ubuntu 16 though, the service is not enabled nor started
automatically.
2022-01-20 23:34:08 +01:00
Gustavo Iñiguez Goia
75cfd39ee1 ui, events: fixed delay displaying the main window
If the events were saved to a DB on disk,
there were long delays when opening the events window.

Now the events window loads faster, but the Events view is not as
performant as before. It means that while you're monitoring connections,
the GUI may consume 1-5% of the CPU and ~25% when you apply a filter
(only in that moment).

With the previous approach the CPU usage was close to 0-1% in both
cases, so we need to find a way of not causing long delays while being
performant.

More about this:
https://github.com/evilsocket/opensnitch/issues/566#issuecomment-1014930627
2022-01-20 00:04:56 +01:00
Gustavo Iñiguez Goia
bb253629e8 Bump versionis to v1.5.0rc2 2022-01-17 01:10:38 +01:00
Gustavo Iñiguez Goia
9326f91733
Merge pull request #586 from Scrumplex/readme-repology
add Repology badge to README
2022-01-17 01:04:10 +01:00
Gustavo Iñiguez Goia
3ef33f6b31 ui: updated translations 2022-01-16 13:25:12 +01:00
Gustavo Iñiguez Goia
d8a36f8d41 ui, tests: fixed, added new ones. 2022-01-14 01:25:56 +01:00
Gustavo Iñiguez Goia
fd231e7645 ui: set app icon on all dialogs, misc.
- Use a good quality icon on all dialogs.
- Set the icon off when closing, to let the user know that we're
  exiting.
- Decreased time to wait to exit to 5secs.
2022-01-10 19:40:39 +01:00
Gustavo Iñiguez Goia
568ce696b5 ui: fixed crash with old pyqt, db improvements.
- setDesktopFileName() is only available since 5.7.
- use pragma quick_check to improve DB loading when events are saved to
  disk.
- optimize DB on close.
2022-01-09 13:08:19 +01:00
Gustavo Iñiguez Goia
2c825409da ui, deb: added python3-notify2 dependency
Also add python3-pyasn as Recommends.
2022-01-08 16:09:14 +01:00
Gustavo Iñiguez Goia
d264bb0e3a ui: fixed disabled buttons, improved svg icon 2022-01-08 11:58:39 +01:00
Gustavo Iñiguez Goia
7e5d809683 ui, prefs, notifications: fixes
- Fixed preferences dialog status error messages.
- Improved notifications
2022-01-08 01:00:04 +01:00
Gustavo Iñiguez Goia
1c523784a8 ui, notifications: fixed timeout
Timeouts are milliseconds, not seconds.
2022-01-07 19:07:23 +01:00
Gustavo Iñiguez Goia
843412d73e ui, notifications: allow to use system notifications
WIP.

Until now we used Qt's systray notifications. They couldn't be disabled
and didn't integrate well with non-Qt based Desktop Environments. Also
we depended on the system tray availability, which is not always
available (i3, phosh, ...).

Now the user can choose to use Qt's notifications, the system
notification service or disabled them completely.

Pros:
 - The notification style is defined by the Desktop Environment.
 - Can be configured globally from the system settings.
 - In many DEs, the notifications are grouped into a single view. So if
   you miss any event, you can go there and check out what happened.
 - Now we can display notifications on DEs where we couldn't before.
 - It's a standard supported by major DEs.

Cons:
 - Sometimes we can't connect to the D-Bus mainloop instance. We need to
   investigate it.

TODO:
 - Deny/Allow new outgoing connections from the notifications,
   replacing the current pop-ups.

Requested here: #468 , #476 and #477 .
2022-01-07 18:32:17 +01:00
Gustavo Iñiguez Goia
2d2a970735 ui, prefs: use buttons to change spins' values
Instead of the builtin buttons to increase the value of spin boxes, use
regular buttons. It'll be easier to use on touchable devices.

Note: This feature can also be achieved by customizing SpinBoxes' css
style.
2022-01-06 11:43:05 +01:00
Sefa Eyeoglu
8d54ca637d
chore: add Repology badge to README 2022-01-06 10:33:03 +01:00
Gustavo Iñiguez Goia
db901a870b ui, prefs: allow to configure events purge interval
Depending on the amount of network traffic, it may be necessary to purge
events faster.
2022-01-04 16:00:57 +01:00
Gustavo Iñiguez Goia
a2a0b8be20 ui: misc improvements
- If sys.exit() fails, force exit after 10s.
- Close db connection on exit.
- When closing the GUI (server), set connected nodes to offline.
  The status will be updated when nodes connect again / when the server
  is available again.
  Otherwise, we may end up with nodes marked as _online_ when in reality
  they're not connected.
- Add nodes on the main thread.
2022-01-04 00:21:30 +01:00