Commit graph

1,672 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
d423e7addc
Bump versions to v1.6.9
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
v1.6.9
2025-04-28 01:39:04 +02:00
Gustavo Iñiguez Goia
dd39fe3060
make connections flushing configurable
By default when adding the interception rules, we were killing all
existing connections, to force them go to the netfilter queue.

However in some environments this is not acceptable, so now it's configurable.

Besides, we were doing this only for nftables, so now it also works for
iptables.

This option will only take effect if FlushConnsOnStart is true, and the
user has (re)configured the ProcMonitorMethod option (typically on
start, or when changing it manually).

cherry picked from commits:
  8e9c1d2178
  8935bfe6b0

related commits:
  661e3da48f
  1e6d2d464b
2025-04-25 23:48:11 +02:00
Gustavo Iñiguez Goia
ae1ace693d
allow to configure GC percentage
Added config option to set how often the garbage collector runs.

For example:

  "Internal": {
      "GCPercent": 75
  },

If this option is not specified in the config file, or the value
is 0, then the GC percentage is not configured.

More info:

https://pkg.go.dev/runtime/debug#SetGCPercent

(cherry picked from commit dc43d5913c)
2025-04-25 22:20:18 +02:00
Gustavo Iñiguez Goia
a955ccc301
ui: make sure 'service' variable is set
Fixes error when running `opensnitch-ui` again:
>     if service:
>        ^^^^^^^
> NameError: name 'service' is not defined. Did you mean: 'UIService'?

(cherry picked from commit  9e2ef5f491)
2025-04-24 00:29:20 +02:00
Gustavo Iñiguez Goia
3593ea4046
delete all generated protobuffers with make clean
fixes #1322

(cherry picked from commit 6649a4dffa)
2025-04-23 23:46:01 +02:00
Gustavo Iñiguez Goia
0cd8b04276
Merge pull request #1300 from lainedfles/v1.6.8-version-fix
chore: update version to 1.6.8
2025-04-03 15:44:49 +02:00
selfdenial
113d41bc98 chore: update version to 1.6.8
Synchronize version with latest release & tag.
2025-03-30 13:35:39 -06:00
Gustavo Iñiguez Goia
a1b4885468
fixed crash compiling unknown rules operator
If a rule contained an unknown rule type or unknown operand, the daemon
crashed.

Issue: #1295
2025-03-18 01:09:00 +01:00
Gustavo Iñiguez Goia
bcfae74097
actions/upload-artifact bumped to v4 2025-02-25 16:14:33 +01:00
Gustavo Iñiguez Goia
69c23e0250
pkgs: Bumped versions to v1.6.8
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
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
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
v1.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