Commit graph

798 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
0d242aeb7a
Bumped ui version to v1.6.8 2025-02-22 11:18:47 +01:00
Gustavo Iñiguez Goia
3b839784ea
ui,popups: fixed dest host regexp
We were not matching the end of the domain, which could lead to allow
more domains than expected.

kudos to @FWDekker for reporting this issue.

Details: #1264
2025-02-21 00:35:19 +01:00
Gustavo Iñiguez Goia
68e0afed70
ui,stats: fixed deleting rules
fix #1245

(cherry picked from commit 824b5c789a)
2025-01-05 00:10:39 +01:00
Gustavo Iñiguez Goia
00eec58906
ui,stats: fixed Events search with different languages
When a language other than English was used, the search in the Events
did not work.
2024-12-30 23:07:19 +01:00
Gustavo Iñiguez Goia
3416c3883e
ui: fixed acting on selected rows
When selecting rows with CTRL we were not copying/deleting rules
correctly.

Closes #1245
2024-12-27 20:41:21 +01:00
Gustavo Iñiguez Goia
f9e1a6a41f
ui,stats: fixed displaying fw button icon
In some distros like Ubuntu 25, we were not displaying the fw button
icon, which made the button practically hidden to the user.

We assumed that if 'document-new' icon was available, the rest of the
icons would be available as well, so we wouldn't need to fallback to
Qt's builtin icons.

However on Ubuntu 25 for example, despite of 'document-new' being
available, the icon 'security-high' was not being displayed when it was
loaded from the stats.ui file.

Loading it from code with QIcon.fromTheme() works fine, and even if
it's not found (which sometimes happens), we'd fallback to Qt's builtin
icons.

Other icons may be optional, but icons without text need to have an
icon always.
2024-12-27 16:32:21 +01:00
Gustavo Iñiguez Goia
da1b3d69e2
ui: improved Makefile 2024-12-26 22:45:06 +01:00
Gustavo Iñiguez Goia
f91f1a9e7b
ui: allow to use multiple protobuffer versions
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
2024-12-26 20:11:50 +01:00
Gustavo Iñiguez Goia
4282fe4ce5
ui,stats: fixed Events tab search 2024-12-26 14:24:44 +01:00
Gustavo Iñiguez Goia
d1f58ebfc2
ui,stats: improved nodes search 2024-12-26 14:12:31 +01:00
Gustavo Iñiguez Goia
7dcba7b106
ui,stats: fixed PID column name 2024-12-26 11:58:14 +01:00
Gustavo Iñiguez Goia
17929c6e4e
bumped GUI version to v1.6.7 2024-12-25 13:00:36 +01:00
Gustavo Iñiguez Goia
361f11cafa
ui,stats: fixed displaying proc details dialog 2024-12-24 17:12:21 +01:00
Gustavo Iñiguez Goia
906b225427
ui: display all fields in the details of a view 2024-12-23 23:20:22 +01:00
Gustavo Iñiguez Goia
2b3028e9d9
ui: display all fields in the detail views 2024-12-23 20:33:13 +01:00
Gustavo Iñiguez Goia
f8e2ab3569
ui: removed hard-coded labels color
It was set to blue, and when using dark themes it didn't look good.
2024-12-21 01:29:50 +01:00
Gustavo Iñiguez Goia
332ec0fee6
ui: fixed searching in tab Users 2024-12-20 16:23:11 +01:00
Gustavo Iñiguez Goia
ef39788b0c
ui: improved columns state restoration 2024-12-19 22:34:21 +01:00
Gustavo Iñiguez Goia
2f3b594857
ui,popups: restrict widgets width, allow split words
Long paths or binary names can misalign the dialog.

In order to prevent this:
 - don't allow labels to grow more than the dialog's width.
 - if the labels text is larger than max_value, use zero-width space to
   allow to split words.
2024-12-19 21:51:08 +01:00
Gustavo Iñiguez Goia
dbae93afe1
ui,popups: more layout improvements
Align message label to the right.
2024-12-19 21:50:04 +01:00
Gustavo Iñiguez Goia
14a1c3bf58
ui: improved popups layout
Removed fixed values.
Changed size policies.
2024-12-19 17:11:52 +01:00
Gustavo Iñiguez Goia
6004f36d66
ui,popups: improved dialog resizing
If the first popup shown misaligned the dialog, the next dialogs were
not resized to the original size.
2024-12-19 01:16:17 +01:00
Gustavo Iñiguez Goia
94fba0bffb
ui,popups: strip non-printable characters from labels
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.
2024-12-19 01:11:14 +01:00
Gustavo Iñiguez Goia
abdfd39394
ui,stats: simplified columns configuration
There're only two points where we need to reconfigure the columns:
on showEvent() and when saving the settings.

There should be a slight performance improvement.
2024-12-18 23:04:53 +01:00
Gustavo Iñiguez Goia
54ef3f6fac
ui: allow to configure QT_QPA_PLATFORM from the GUI
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.
2024-12-17 21:29:11 +01:00
Gustavo Iñiguez Goia
ee089af79b
ui,fw: fixed enable/disable global button
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.

(cherry picked from commit aa0d5f14dd)
2024-12-16 21:18:07 +01:00
Gustavo Iñiguez Goia
12baf1a7d3
ui,fw: fixed restoring policies when disabling fw
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
(cherry picked from commit d825f1e9b0)
2024-12-16 21:15:09 +01:00
Gustavo Iñiguez Goia
99cd9f1d45
ui,popups: fixed exception getting node address when adding a new rule
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.
2024-12-16 20:27:42 +01:00
Gustavo Iñiguez Goia
36f9242e11
ui: fixed delay closing the GUI
When closing the GUI we were not stopping notifications channel in all
cases, causing some issues (delays, log in/out problems, ...).

Closes #1217

(cherry picked from commit cdf93c72c1)
2024-11-24 22:46:29 +01:00
Gustavo Iñiguez Goia
446cb1ad09
ui,rules: do not verify lists path on remote nodes
When creating/editing rules to filter by lists of nets/IPs/domains, we
check if the path entered is a directory.

However on remote nodes, the path may not exist where the GUI is
running, but be valid where the daemon is running.

Now we only check the path if the node where it's being configured is
local.

(61727af788)
2024-09-18 01:18:15 +02:00
Gustavo Iñiguez Goia
25e9268171
ui: restrict allowed characters in the rule name
Since the name of the rule is used for the file name on the disk,
certain characters caused issues when saving the rule, like '/'.

Now if the user types or pastes '/' in the name field, a warning is
displayed, indicating that some characters are not allowed.

(2e90f3832d)
2024-09-18 01:13:33 +02:00
Gustavo Iñiguez Goia
9e660e1d48
ui: fixed syntax warning building appimages paths
prompt.py:608: SyntaxWarning: invalid escape sequence '\.'

Closes: #1154
2024-09-17 22:10:37 +02:00
Gustavo Iñiguez Goia
a6fe895a67
ui,ruleseditor: add rules correctly to the db
Operator list was not converted to JSON string when saving the rule to
the DB.

Related: #1047
(cherry picked from commit 67149269cd)
2024-06-27 14:07:45 +02:00
Gustavo Iñiguez Goia
fe66f9aa17
rules: improved operator list parsing and conversion
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)
2024-06-21 11:38:46 +02:00
Gustavo Iñiguez Goia
4e7f1aeae7
Bumped versions to v1.6.6 2024-06-20 00:45:33 +02:00
Gustavo Iñiguez Goia
31fc42a764
ui,prefs: fixed changing qspinbox values
When changing qspinbox values (density scale, refresh interval, etc),
we were unintentionally changing [x] Disable popups option.

(cherry picked from commit acdd2b34ec)
2024-06-20 00:41:04 +02:00
Gustavo Iñiguez Goia
1ec8a0213a
ui: fixed exporting/importing rules
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)
2024-06-19 18:56:25 +02:00
Gustavo Iñiguez Goia
94e8156ce2
ui: keep working if pyinotify fails loading
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)
2024-06-14 01:21:21 +02:00
Gustavo Iñiguez Goia
0fc4239453
ui: fixed exporting rules to the clipboard
We were not formatting the "created" date field properly.
More info: https://github.com/evilsocket/opensnitch/issues/1140#issuecomment-2140904847

(cherry picked from commit b096e664c7)
2024-06-14 01:19:32 +02:00
Gustavo Iñiguez Goia
ff407e72af
ui,prefs: node auth settings improvements
- 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)
2024-06-14 01:17:39 +02:00
Gustavo Iñiguez Goia
03439f4f9c
ui, prefs: ignore SameFile error when enabling autostart
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)
2024-06-14 01:08:31 +02:00
Gustavo Iñiguez Goia
7653a0a1c1
Improve wording
(cherry picked from commit d6f3552fa0)
2024-06-14 01:06:06 +02:00
Gustavo Iñiguez Goia
c5409755bc
ui, prefs: improved loading auth options
(cherry picked from commit 0cc4d88e35)
2024-06-14 01:05:14 +02:00
Gustavo Iñiguez Goia
cd2dc2535c
ui, prefs: load and conf daemon DefaultAction
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)
2024-06-13 00:23:55 +02:00
Gustavo Iñiguez Goia
91190c80aa
added Reject to the list of DefaultActions(s)
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)
2024-06-13 00:09:00 +02:00
Gustavo Iñiguez Goia
362c0da53f
ui: allow to configure screen/themes scale factor
Added new options to the Preferences dialog, to configure screens/themes
scale factor.

If the UI is using the System theme (default), configure Qt scale
options (needs UI restart):
QT_AUTO_SCREEN_SCALE_FACTOR (default True)
QT_SCREEN_SCALE_FACTORS (If auto scale is False, use this value(s))

The user can configure different scale factors for multiple screens, by
separating values with ; (1;1.5, etc...)

https://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qt

If the UI is using a qt-material theme, you can configure the "density"
scale of the theme:
https://github.com/UN-GCPDS/qt-material?tab=readme-ov-file#density-scale

https://github.com/evilsocket/opensnitch/wiki/GUI-known-problems#gui-size-problems-on-4k-monitors

(cherry-picked from bf9801f917)
2024-06-12 22:04:50 +02:00
Gustavo Iñiguez Goia
9a605d3ef3
ui: versions comparing improvements
Some checks failed
CI - build eBPF modules / build (6.0, 1.6.0) (push) Has been cancelled
Test resources validation / Install tools (push) Has been cancelled
Build status / Build (push) Has been cancelled
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)
2024-02-09 17:01:55 +01:00
Gustavo Iñiguez Goia
b05eace022
Bump GUI versions to 1.6.5.1 2024-02-09 14:51:17 +01:00
Gustavo Iñiguez Goia
6809776393
pop-ups: fixed regression for remote nodes
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).
2024-02-09 13:21:01 +01:00
Gustavo Iñiguez Goia
1d2c0703ff
pop-ups: filter by absolute path+cmdline on some cases
Some checks failed
CI - build eBPF modules / build (6.0, 1.6.0) (push) Has been cancelled
Test resources validation / Install tools (push) Has been cancelled
Build status / Build (push) Has been cancelled
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.
2024-02-08 17:53:07 +01:00