Commit graph

2,069 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
b404c4c631 ui,i18n: updated nl, it and tr translations
Some checks failed
CI - build eBPF modules / build (6.0, 1.5.0) (push) Has been cancelled
CI - build eBPF modules / build (6.0, master) (push) Has been cancelled
Test resources validation / Install tools (push) Has been cancelled
Build status / Build (push) Has been cancelled
v1.8.0
2025-12-13 11:58:40 +01:00
Gustavo Iñiguez Goia
1bf2129ddd
ui: fixed possible crash handling notifications 2025-12-12 21:21:35 +01:00
Gustavo Iñiguez Goia
ede079fb9f
ui: minor window adjustments 2025-12-11 23:36:04 +01:00
Gustavo Iñiguez Goia
ad0df38e8c ui: better system notifications
Try to use Desktop Environment notifications whenever possible, and
fallback to Qt's notifications system if it fails.

Related: #1464
2025-12-11 17:33:27 +01:00
Gustavo Iñiguez Goia
ff05d94f41 pkgs,rpm: added python311-PyQt6 as dependency
Some distros like OpenSuse Leap 15.6 ships with python3.6 by default.
PyQt6 is not available for python3.6, but python311-PyQt6 is.
So there's no generic python3-PyQt6, but python311-PyQt6.

In this specific case, the user will have to change the default python3
version to python3.11. And they'll have to install some packages like
slugify from pip.

But as a best effort, we'll try to install PyQt6 from the distro
repositories.
2025-12-11 17:16:53 +01:00
Gustavo Iñiguez Goia
73f2d40242 ui,nodes: removed print call 2025-12-11 12:27:12 +01:00
Gustavo Iñiguez Goia
481dc1cd53
avoid to send empty stats to the GUI (server)
By default, every second we send to the GUI the collected statistics by
the daemon: metrics + events (connections).

This call has a hard-coded timeout of one second, and if it reaches the
deadline, a warning message is printed to the log.

After several timeouts, the daemon closes the connection and tries to
reconnect again.

The daemon invokes this call even if there're no statistics to send.
With one daemon and one GUI, it's not much of a problem. But if there're
n nodes, the GUI will receive a minimum of n connections every second.
In many scenarios, these empty calls are unnecessary.

So, in order to optimize this behaviour, if the daemon has not collected
new statistics, we won't invoke this call. This will slightly reduce the
load on the GUI (server) when managing multiple nodes, and will save
some CPU cycles on the daemon side.

The connection status between the daemon and the GUI is managed with the
following gRPC options:

 - The server and the daemon configures a 5-seconds keepalive to keep
   the channel open:
   'grpc.keepalive_time_ms', 5000
 - If after 5 seconds the keepalive msg is not received, then after 20
   seconds the connection with the daemon will be closed if the server
   doesn't receive a response:
   'grpc.keepalive_timeout_ms', 20000

So after about 30 seconds, if the daemon can't communicate with the GUI
(server), it'll close the connection and retry it every second.
2025-12-11 12:07:10 +01:00
Gustavo Iñiguez Goia
f2e2e52aef removed parameters from init services
The daemon no longer requires the parameter -rules-path.

The default path is /etc/opensnitchd/rules, and it's configurable from
the configuration.
2025-12-10 21:31:33 +01:00
Gustavo Iñiguez Goia
a0af75b0d1
ui,stats: better nodes monitoring
When clicking on a node, the GUI starts a background task to obtain the
system stats of the daemon (ram, swap, uptime, load avg, ...).

We were not handling the monitoring/unmonitoring actions properly.
2025-12-10 17:07:35 +01:00
Gustavo Iñiguez Goia
90dfba1380
ui,stats: nodes view improvements
- Use the address of the node as the unique index to select rows.
 - Restore order of the nodes properly when coming back from the details
   view.
2025-12-10 13:25:53 +01:00
Gustavo Iñiguez Goia
321c152f26
ui,nodes: improved adding nodes to the db
When a node connected to the gui for the first time, we were not
updating the db accordingly. We were doing it when populating the
stats or adding events.

Unfortunately, not all fields are available when a node subscribes to
the GUI, they're sent when the node posts new events. Because of this,
some fields may appear blank until the node send new events.

It'll be fixed in future releases.
2025-12-10 01:55:05 +01:00
Gustavo Iñiguez Goia
74a7cb80f7 ui,stats: fixed restoring nodes detail view
When showing/hiding the main window by clicking on the systray icon, if
the user was reviewing the connections of a node before hiding the
window, the node table was not restored again.

We changed a few weeks ago how the window is shown (showEvent() ->
show()), so this is an unexpected error from that change.
2025-12-10 00:24:44 +01:00
Gustavo Iñiguez Goia
9b33f7bdc8 discard notification replies if channel is closed
Sometimes, when closing the notifications channel, we could end up
trying to reply to a notification after the channel was already
closed. For example when changing the server address of a node.

In that scenario, the goroutine never finished and attempted to
reply to the notification.
2025-12-09 23:35:32 +01:00
Gustavo Iñiguez Goia
f0a90a1d71
ui: fixed start/stopping interception by node 2025-12-09 22:14:06 +01:00
Gustavo Iñiguez Goia
3e87ceac0c
ui: fixed creating QFileDialog widgets 2025-12-09 18:08:57 +01:00
Gustavo Iñiguez Goia
7592aae0c5
ui: added server config items 2025-12-09 01:56:26 +01:00
Gustavo Iñiguez Goia
ada74a2d8f
ui,prefs: allow configuring server's max workers and clients
Related: c356c82ac7
2025-12-09 01:35:47 +01:00
Gustavo Iñiguez Goia
12da478135
ui: fixed .ui designers files
again.

See commit: 807ba02bb9
2025-12-08 23:26:16 +01:00
Gustavo Iñiguez Goia
c356c82ac7
ui: allow to configure max nodes and server workers
- allow to configure max number of nodes (incoming connections).
   If the server address is a unix socket, it'd make sense to limit it
   to 1.
 - allow to configure server workers.
   By default ThreadPoolExecutor max_workers value is calculated based
   on the number of CPUs: min(32, os.cpu_count() + 4).

   When the GUI (server) is configured to manage multiple nodes, if
   there're not enough server workers (for example because there's
   only 1 CPU, thus ~6 threads), it can end up freezing, blocking new
   requests (new nodes, new stats, new rule requests, etc).

   The server uses one worker per node to handle notifications, and
   it's not released until the node exits.
   Every second, the nodes send the statistics to the server, which also
   consumes one worker for at least one second.
   Additionally the server may receive new rule requests and alerts,
   which also consume one worker each temporarily.

   So if there're 6 nodes, the server may need ~3 workers per node.

Related: #1453
2025-12-08 19:35:34 +01:00
Gustavo Iñiguez Goia
49b929523b
ui: fixed rules name validator 2025-12-08 11:55:50 +01:00
Gustavo Iñiguez Goia
0bbbbb546a
ui: hide node column by default if nodes < 2 2025-12-07 15:06:56 +01:00
Gustavo Iñiguez Goia
e7c36e29ae ui,prefs: improved node management
Added better alerts when changing nodes or server address.
2025-12-07 13:36:34 +01:00
Gustavo Iñiguez Goia
5b67e2e53e stop notifications at the server's request 2025-12-07 13:14:50 +01:00
Gustavo Iñiguez Goia
e9f64682a0
ui: improved remote nodes status management
- Close notifications channel in more cases.
 - misc: use the word "proto" only for protocol, instead of protobuffer.

Related: #1453.
2025-12-07 01:08:07 +01:00
Gustavo Iñiguez Goia
8270be1278
check TaskMgr validity 2025-12-05 23:12:51 +01:00
Gustavo Iñiguez Goia
fefbf385f1
lower ping() log level to DEBUG
When sending the events to the GUI (server), there's a hardcoded timeout
of one second. If the call takes longer, we were writing a warning to
the logs for each call, which in some cases could be excessive.

Hitting the timeout can be normal under some circumstances, such as when
connecting to a GUI with multiple nodes and a lot of activity.

More info: #1453
2025-12-05 22:45:42 +01:00
Gustavo Iñiguez Goia
7a0c96c17e initiate Ping() timeout after collecting the stats
We have a hardcoded timeout of one second to send the daemon stats to
the GUI. In some cases it's not unusual to hit the deadline.

So in order to just measure the network call, we now initiate the
timeout after collecting the daemon statistics.

See: #1453
2025-12-05 15:32:18 +01:00
Gustavo Iñiguez Goia
8d31289c35
ui,netstat: disable monitoring when changing tab 2025-12-05 01:32:07 +01:00
Gustavo Iñiguez Goia
3a712db2a4 ui: improved netstat view
Removed horizontal autoscrolling, which made impossible to click on all
columns.
2025-12-05 00:54:08 +01:00
Gustavo Iñiguez Goia
528091f513 avoid crashing when executing fw tests
Found while debugging an issue with several Verdict errors on kernel
6.17.x. Something has changed.
2025-12-03 22:33:15 +01:00
Gustavo Iñiguez Goia
4729e6df9b
ui,fw: fixed applying rules to nodes 2025-12-03 21:09:06 +01:00
Gustavo Iñiguez Goia
be037674f5
ui,fw: improved rule dialog
When loading a system firewall rule for editing (save operation), if the
user changes the node, add the rule instead of saving it.
2025-12-03 01:38:35 +01:00
Gustavo Iñiguez Goia
8ac02acbbb
ui: display nodes ip and hostname on more places
Added the hostname to the node comboboxes, to help identify them more
easily.
2025-12-02 01:10:33 +01:00
Gustavo Iñiguez Goia
a741326e50
ui,stats: minor improvements
- Display the column Node only if there's more than 1 node, or if the
   user selected it from the Preferences (rel: #1456).
 - Adjust the Rules panels default sizes.
 - Don't resize the first column of the rules left panel.
2025-12-01 16:53:29 +01:00
Gustavo Iñiguez Goia
f1a04dde25
ui: allow to change firewall rules by node
- Added option to add, save or delete system firewall rules by node.
 - Added new option to apply the action to all nodes.
2025-12-01 13:17:21 +01:00
Gustavo Iñiguez Goia
09bb7e5f0e
ui,fw: allow to configure nodes policies
Previously you could only change firewall policies of one node.
Now if there's more than one node you can select the node, or change the
policies of all nodes.
2025-12-01 01:26:10 +01:00
Gustavo Iñiguez Goia
12d523be76
ui,fw: rules fixes
- Select correctly fw rules by node, table, etc.
 - minor change to nodes.
2025-11-30 23:41:35 +01:00
Gustavo Iñiguez Goia
9b1ae176d6
ui,netstat: open the process dialog from the PID column
It was not working.
2025-11-29 01:01:14 +01:00
Gustavo Iñiguez Goia
6f72bd1221
ui,netstat: allow to select nodes by hostname
display the hostname of a node in the list of nodes of the Netstat tab,
to easily identify remote systems.
2025-11-29 00:47:56 +01:00
Gustavo Iñiguez Goia
427b37c77a ui: allow to select rows pressing shift
TODO: handle selections when the first row selected is out of the
viewport.

See: #1428
2025-11-28 13:14:32 +01:00
Gustavo Iñiguez Goia
55ac4b7fa4
tasks improvements
- fixed some race conditions.
- added more errors logging.
2025-11-28 00:02:52 +01:00
Gustavo Iñiguez Goia
7224acc7bd print the notifications type on error 2025-11-27 21:32:39 +01:00
Gustavo Iñiguez Goia
1a7e4371ba
ui,stats: fixed selecting rows 2025-11-27 02:14:57 +01:00
Gustavo Iñiguez Goia
4f64e04d89
ui,stats: highlight filter line if there's a filter
Closes: #1419
2025-11-27 01:53:25 +01:00
Gustavo Iñiguez Goia
a0bb7b69a7
ui,stats: show the hostname of a node in the rules list 2025-11-26 21:20:01 +01:00
Gustavo Iñiguez Goia
4fed62625f
ui,popups: updated appimage regular expression
Appimages unpack their content under /tmp/._mount<random-chars>/*.
Usually the random part consist of 6 characters, but some appimages do
not follow this rule, like the Eden appimage.

See: #1377.
2025-11-26 01:09:56 +01:00
Gustavo Iñiguez Goia
339c66030a
ui,popups: allow to select snap paths automatically
In the same way that we automatically select AppImages paths, now we'll
also select snap paths.

Usually these paths start with /snap, followed by the name of the app, a
revision number and the path to the executable:

/snap/firefox/12345/usr/lib/firefox/firefox

Internally the rule will create this regular expression, to match the
the snap regardless of the revision:
^\/snap\/firefox\/[0-9]+\/usr\/lib\/firefox\/firefox$

Closes: #1439.
2025-11-26 00:33:21 +01:00
Gustavo Iñiguez Goia
dff12836c2
ui,popups: added missing function parameter 2025-11-26 00:15:13 +01:00
Gustavo Iñiguez Goia
58c379424d
ui: new plugin version checker
Added a basic plugin to check latest release version on github. Disabled
by default.

Since it's not possible to enable plugins from the GUI yet, you have to
copy the configuration to
$HOME/.config/opensnitch/actions/versionchecker.json:

{
  "name": "versionchecker",
  "created": "",
  "updated": "",
  "description": "",
  "type": ["global"],
  "actions": {
      "versionchecker": {
          "enabled": true,
          "config": {
              "check_on_start": false,
              "name": "check-latest-release",
              "interval": "12",
              "units": "hours",
              "url": "https://api.github.com/repos/evilsocket/opensnitch/releases"
          }
      }
  }
}

This configuration example is available under
opensnitch/plugins/versionchecker/.

Requested here: #1461.
2025-11-25 21:27:25 +01:00
Gustavo Iñiguez Goia
41d49c2109
ui: fixed applying rules to remote nodes
Closes: #1438
2025-11-25 01:19:32 +01:00