Fixes error when running `opensnitch-ui` again:
> if service:
> ^^^^^^^
> NameError: name 'service' is not defined. Did you mean: 'UIService'?
Fixes: cdf93c72c1 ("ui: fixed delay closing the GUI")
Protobuffers compiled with protobuf < 3.20.0 are incompatible with
protobuf >= 4.0.0:
https://github.com/evilsocket/opensnitch/wiki/GUI-known-problems#gui-does-not-show-up
This has been a source of problems for some users (#1214, #647), and
in some distributions, previous protobuffer does no longer work due to
incompatibility with the protobuf package version installed
(OpenSuse Tumbleweed).
So in order to solve this issue, we provide several protobuffers,
for old and new protobuf versions:
proto/ui_pb2* for protobuf >= 4.0.0
proto/pre3200/ui_pb2* for protobuf >= 3.6.0 and < 3.20.0
To avoid import errors, each protobuffer must be placed in its own
directory, and the name of the protobuffer files must be named with
the syntax <prefix>_pb2.py/<prefix>_pb2_grpc.py:
ui_pb2.py and ui_pb2_grpc.py
The default compiled protobuffer will be opensnitch/proto/ui_*.py
instead of opensnitch/ui_*.py
- Clicking on a column will display the details of that item (IP,
process, etc).
DstIP, DstPort and UserID columns will open the details of the
selected item.
Clicking on the PID column will open the process monitor dialog.
The rest of the columns will open the details of the process.
- On the Events tab, clicking on the PID column will open the process
monitor dialog.
Commands with non-printable characters were misaligning the labels.
Now these characters are exclude from the labels, and texts are
displayed as a single line.
Under Wayland the GUI doesn't work entirely well (#733).
Setting QT_QPA_PLATFORM to 'xcb' solves some issues, like correctly
positioning popups, but users had to configure it manually.
Now it's possible to configure it from the Preferences dialog.
Setting it to "" will use the default option of the Desktop Environment.
Up until now it when changing the node address, you changed the server
adress as well (i.e: the address where the GUI is listening for
connections).
This simplified configuration when you had 1 node and addresses were
changed at the same time. But in other situations, you were not able to
change the server (GUI) address from the Preferences dialog.
So now:
- the address of each node is changed from the Nodes tab.
- the address of the server (GUI) is changed from the UI tab.
When there were no nodes connected, we disabled the global fw button
that enables/disables the fw.
Unfortunately when a node connected to the GUI, this button was not
clickable anymore.
When disabling the fw, we change the default input and output policy to
Accept, not to block connections.
Due to a problem reloading the fw in the daemon, the policy was not
changed as expected.
This problem must be fixed in the daemon, but for the time being,
sending two configuration changes solves the issue (one for changing the
policy, and another one for disabling the fw).
Closes: #1225
When a popup was displayed to the user, if they took more than 120s to
respond, the address of the node was lost.
This is because the daemon has hardcoded a max timeout of 120s. If it
fires, the call to AskRule is closed and the context is lost.
In this situation, save the address of the node at the start of AskRule,
so we can reuse it later.
Closes: #1219
- Calculate the ram usage of a process in the daemon, using the page
size of the system.
- Added new functions to read some details of a process, so we can use
them in other parts of the code.
Added new task to monitor the resources of remote nodes, like
ram, swap, number of processes or load average of the system.
The task is initiated when the user selects a node, and the data
received from the node is added to the right panel of the Nodes tab.
The task is stopped when changing to another tab, or when deselecting a
node.
Particularly useful for monitoring remote nodes.
daemon tasks are actions that are executed in background by the daemon.
They're started from the GUI (server) via a Notification (protobuf),
with the type TASK_START (protobuf).
Once received in the daemon, the TaskManager starts the task in
background.
Tasks may run at interval times (every 5s, 2days, etc), until they
finish an operation, until a timeout, etc.
Each task has each own configuration options, which will customize the
behaviour of its operations.
In this version, if the GUI is closed, the daemon will stop all the
running tasks.
Each Task has a flag to ignore this behaviour, for example if they need
to run until they finish and only send a notification to the GUI,
instead of streaming data continuously to the GUI (server).
- Up until now we only had one task that could be initiated from the GUI:
the process monitor dialog. It has been migrated to a Task{}.
- go.mod bumped to v1.20, to use unsafe string functions.
- go.sum updated accordingly.
When filtering by checksum and the checksum of a rule changes, we
display a warning on the popup, indicating that something happened.
The user had the option to update the checksum of one rule, directly
from the popup.
Now there's a new button to update all the rules that have a checksum as
filtering parameter.