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.
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.
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.
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.
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.
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.
- 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
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
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
- 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.
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.
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.
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.
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.