Previously when creating a new rule we followed these steps:
- Create a new protobuf Rule object from the ruleseditor or the
pop-ups.
- If the rule contained more than one operator, we converted the
list of operators to a JSON string.
- This JSON string was sent back to the daemon, and saved to the
DB.
- The list of operators were never expanded on the GUI, i.e., they
were not saved as a list of protobuf Operator objects.
- Once received in the daemon, the JSON string was parsed and
converted to a protobuf Operator list of objects.
Both, the JSON string and the list of protobuf Operator objects were
saved to disk, but the JSON string was ignored when loading the
rules.
Saving the list of operators as a JSON string was a problem if you
wanted to create or modify rules without the GUI.
Now when creating or modifying rules from the GUI, the list of operators
is no longer converted to JSON string. Instead the list is sent to the
daemon as a list of protobuf Operators, and saved as JSON objects.
Notes:
- The JSON string is no longer saved to disk as part of the rules.
- The list of operators is still saved as JSON string to the DB.
- About not enabled rules:
Previously, not enabled rules only had the list of operators as JSON
string, with the field list:[] empty.
Now the list of operators is saved as JSON objects, but if the rule
is not enabled, it won't be parsed/loaded.
Closes#1047
(cherry picked from commit b93051026e)
When exporting rules, use rfc3339 format for the Created field.
We were exporting it as timestamp, which caused issues when
importing the rules.
Related:
58aa979cae
issue #1140
(cherry picked from commit 552aed5bc5)
pyinotify has stopped working in python3.12, it fails loading with the
error:
ModuleNotFoundError: No module named 'asyncore'
For now, ignore this error and keep working as usual.
Applications icons will be loaded on GUI startup, but we loose the
ability of discovering the icons of applications while the GUI is
running.
(cherry picked from commit ad8e2f5371)
- Added "More information" label to the preferences dialog, and open a
link to our wiki with more information.
- Allow to configure node auth settings from the GUI:
When we added the authentication options (12b4cf3104,
6556eed1ae, f63d9dce72)
we allowed to configure auth options from the GUI, but only if the
nodes already had the options configured. If the auth options
received were empty, we simply disabled the auth options on the
preferences dialog.
Now we build the configuration in this scenario, and sent it back to
the nodes.
(cherry picked from commit 8c25c3f7df)
When clicking [x] Autostart the GUI upon login, ignore the exception if
src and dst (opensnitch_ui.desktop) are the same file.
(cherry picked from commit 0c8935c6e8)
In f5f30b1e58 we added the option to
reject connections as DefaultAction.
If configured, load and set it in the preferences dialog.
(cherry picked from commit a21a316e34)
We only offered two options for the DefaultAction option: allow/deny.
Since a long time ago we support "reject"ing connections, but it was not
configurable as the DefaultAction.
(cherry picked from commit f5f30b1e58)
When comparing UI/daemon versions to see if they're compatible, we only
use the first 2 components (1.7.xxx), so discard the rest to allow
different versions (1.6.5.1, 1.6.5-1, 1.6.5-rc1, etc)
When a new pop-up is triggered from a remote node, the GUI crashed.
This error was introduced by this commit 9fc1da5.
Thanks to @zero77 for reporting it super fast (#1093).
If the pop-ups' target is to filter by cmdline, but the typed/launched
command is not absolute or it starts with /proc, also filter by the
absolute path to the binary.
If the path of a process starts with /tmp/.mount_*, which is the common
path for appimages, use it as the default target on the popups.
Previously it was only added to the list of targets, but preselecting it
will help users to create rules for appimages.
(cherry picked from commit 016f4842ff)
Up until now, the GUI was refreshed if:
- it was not minimized or hidden.
- if there were new events (even if we received events from the daemon,
they were filtered out if they were duplicated).
But still, there were scenarios where refreshing the views every second
(more or less) was too much, like when monitoring multiple machines.
Now it's possible to configure the views' refresh interval, regardless
of what the daemon sends.
Asked here: #1073
(cherry picked from commit 6006717b86)
If the path of the process starts with /tmp/.mount, it typically
indicates that the application is an AppImage.
These apps create a random directory under /tmp, with the pattern
/tmp/.mount_<appId>XXXXXX, where the AppImage is mounted (it's not
always the case, but it usually is).
a0373541c1/runtime.c (L202)
The problem is that if you allow the path to the executable, the next
time you launch the AppImage, the path won't match the rule, and you'll
be prompted again to allow the outbound connection.
So as a helper for the users, if we find the path of the process starts
with /tmp/.mount_, we add an option to the combo box to select the path,
which creates a regular expression to match the AppImage.
Requested here: #1066, #543, #408
(cherry picked from commit 56775cd62a)
When cloning a rule, or applying a rule to a node, if the rule was of
type List (had multiple operators), the operators were not saved to the
DB.
Closes: #1027
(cherry picked from commit 4499a5aaf0)
Not deleting events from in-memory db can lead to a high mem usage under
certain scenarios.
Previous attempt to solve this issue wrote events to disk in a temporal
file (when using file::memory:?cache=shared).
Related issues: #844#857Closes: #1030
- Fixed painting rows while scrolling using the mouse.
Sometimes blank lines were inserted at the bottom of the views when
scrolling with the mouse.
- Avoid to rerepaint rows when switching views or scrolling.
- Selecting a row marks it for tracking, ensuring it's deselected when
the row is not visible, and reselected when the row becomes visible
during scrolling.
The following behaviour has not changed:
- Selecting a row that was previously selected, deselects it.
- Keyboard navigation.
Not fixed yet:
- Selecting all the rows of a view with the mouse, visibles and not visibles.
- Entering into a detailed view, going back to the previous view, and
select (restore) the row that was previously selected (causes a
segfault in a particular case).
Related: #1037
- Added needed files to upgrade DB schema.
- Use datetime.strptime instead of fromisoformat, to support python3.6
- More debug logs to better analyze problems.
Related: #988