Commit graph

1663 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
69c23e0250
pkgs: Bumped versions to v1.6.8 2025-02-22 11:26:16 +01:00
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
fbdef1673d
ebpf: obtain udpv6 source IP in more scenarios
Following the previous change 20a03e11fe,
now we obtain the source IP for UDPv6 connections with it's set in
an ancillary message.
2025-01-21 00:56:02 +01:00
Gustavo Iñiguez Goia
20a03e11fe
ebpf: obtain udp source ip in more cases
Sometimes the source IP of an outbound UDP connection is specified
via ancillary messages, by using IP_PKTINFO or IPV6_PKTINFO.

In these cases the source IP of the sock struct is empty (0.0.0.0,
sk->__sk_common.skc_rcv_saddr).

Now in udp_sendmsg(), if sk->sk_rcv_saddr is empty, we'll try to
extract it from the ancillary message. IPv4 only for now.
2025-01-17 20:26:11 +01:00
Gustavo Iñiguez Goia
f44d3e896b
eBPF: fixed obtaining connection details
Sometimes we failed to retrieve the details of a connection, which
inadvertently caused us to block certain applications (Parsec).

By using inet_dgram_connect() we're now able to identify the PID of
a connection in more cases, such as in #1246.

Note: it's excluded from armhf, since I've been unable to make it work
on that platform.
2025-01-12 20:12:45 +01:00
Gustavo Iñiguez Goia
93d1cefbc2
eBPF: code formatting, removed unused code 2025-01-12 19:46:12 +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
6eb62d8d7d
Bumped pkg versions to 1.6.7 2024-12-27 21:21:46 +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
4fe43fc251
pkg, ui deb: added python3-packaging dependency 2024-12-26 23:57:57 +01:00
Gustavo Iñiguez Goia
80eef7f163
pkg, ui rpm: improvements
- Added python3-packaging as dependency to load dynamically the
   protobuffers (python3-packaging for Fedora, python-rpm-packaging
   metapackage for OpenSuse).
 - Fixed patching protobuffers.
2024-12-26 23:17:53 +01:00
Gustavo Iñiguez Goia
1c2e1f68c7
pkg, ui rpm: make python3-notify2 package optional
python3-notify2 has been deprecated since long time ago, and for example
it has been removed from OpenSuse Tumbleweed.
2024-12-26 22:46:11 +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
b1e9060526
pkg,deb: updated notes for grpcio issue #647 2024-12-25 12:59:40 +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
5877e6c6d0
deb: warn about buggy python3-grpcio version (1.30.2-3build6)
Ubuntu jammy package python3-grpcio, version 1.30.2-3build6, has a bug
which causes applications to use 100% of the CPU.

If after installing we detect that the buggy version is installed,
display a warning to the user with instructions on how to solve the
problem and links to the bug reports.

More information:
 - https://bugs.launchpad.net/ubuntu/+source/grpc/+bug/1971114
 - https://github.com/evilsocket/opensnitch/issues/647

(cherry picked from commit c89b4908ce)
2024-07-02 00:17:20 +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
ae9aa40c37
deserialize rules operator list correctly
In b93051026e we disabled sending/parsing
list operators as JSON strings. Instead, now it's sent/parsed as
protobuf Rule, and saved to disk as JSON array, which ease the task of
manually creating new rules if needed.

This change was missing in the previous commit.

(cherry picked from commit 2fc9ed276b)
2024-06-21 14:35:15 +02:00
Gustavo Iñiguez Goia
987a227a42
updated rules tests
(cherry picked from commit 40b738ffea)
2024-06-21 14:11:54 +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