Commit graph

863 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
58cb9544e4
ui: popups layuout improvements
- Removed hardcoded sizes for buttons.
 - Buttons horizontal layout adjusted to properly show the countdown
   (#1274).

Note:
 'Maximum' vertical policy does not seem to work with qt-material
 and QToolButton, the button height is resized to 0. 'Preferred' seems
 to work as expected.
2025-02-26 21:25:48 +01:00
Gustavo Iñiguez Goia
d46f1562ff
ui:renamed daemon version label for better clarity
The GUI and daemon versions are displayed in 2 different locations:
 - ui: in the title of the main window.
 - daemon: in the lower right corner.

Now instead of showing the daemon version as "Version: x.y.z", we
show "Daemon version: x.y.z".

Closes: #1278
2025-02-25 13:11:50 +01:00
Gustavo Iñiguez Goia
acf7c653af
ui: replace hardcoded emoji by its code
to avoid rendering issues.
2025-02-24 23:24:13 +01:00
Gustavo Iñiguez Goia
d81374ebc7
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.

Closes: #1264
2025-02-21 00:28:22 +01:00
Gustavo Iñiguez Goia
8c1da76dff
ui: avoid restart messages when changing node options
Some checks failed
Build status / Build (push) Has been cancelled
When saving the preferences, we check if the user changed the address of
the node. Usually the current node address is the same than the one
loaded, but some gRPC versions does not report it, so we use
"unix:/local" as the address of the node.

As this address is different than the one configured, we were displaying
unnecessary restart messages to the users.
2025-02-19 00:04:39 +01:00
Gustavo Iñiguez Goia
5fdb60dccb
ui,prefs: fixed QueueBypass option. 2025-02-18 23:40:56 +01:00
Gustavo Iñiguez Goia
e25d741f76
ui: improved compatibility with python3.8
- Do not use placeholdertext with comboboxes.
 - Do not use removesuffix().
2025-02-18 15:44:51 +01:00
Gustavo Iñiguez Goia
65d6cccd63
ui: perform db updates in the main thread
Some checks failed
Build status / Build (push) Has been cancelled
we may end up with db corruptions otherwise.
2025-02-17 16:49:49 +01:00
Gustavo Iñiguez Goia
4c805331bb
Merge pull request #1266 from MEschenbacher/ui-stats-optimize-format
Some checks are pending
Build status / Build (push) Waiting to run
ui: dialogs: stats: optimize string format
2025-02-14 00:21:59 +01:00
Gustavo Iñiguez Goia
740465a447
ui: improved search in detail views
Allow to filter by more fields.
2025-02-10 00:58:40 +01:00
Gustavo Iñiguez Goia
4afa22c5b5
ui: fixed displaying icons
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' or 'emblem' icons were 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.

 - minor formatting change.
 - removed unused code.
2025-02-10 00:20:16 +01:00
Maximilian Eschenbacher
4ea11a1ca7
ui: dialogs: stats: optimize string format
This commit does not change behaviour but reduces the multitude text
arguments of format() down to one.

Ref: c5e24c04f1 ("ui,netstat: allow to filter listed connections")
2025-02-07 19:23:31 +01:00
Gustavo Iñiguez Goia
4a37c88db6
ui: fixed typo 2025-02-07 00:02:23 +01:00
Gustavo Iñiguez Goia
b87bc2e826
ui: stop scheduled task on exit
On closing the GUI, stop the schedulded tasks to disable temporal rules.
Otherwise the GUI won't exit until all tasks finish.
2025-02-06 23:51:14 +01:00
Gustavo Iñiguez Goia
1a39122c1d
netstat: dump AF_PACKET sockets from the kernel
We'll try to dump the AF_PACKET sockets from the kernel. If it's not
possible, we'll fallback to read /proc/net/packet.
2025-02-06 01:49:40 +01:00
Gustavo Iñiguez Goia
335f2a783d netstat: allow to list XDP sockets
- daemon: Allow to dump XDP sockets from kernel.
 - ui: Added options to filter by RAW protocol and AF_XDP family.
 - Bumped vishvananda/netlink version to v1.3.0.
 - Updated go.mod and go.sum
2025-02-05 00:05:02 +01:00
Gustavo Iñiguez Goia
c5e24c04f1
ui,netstat: allow to filter listed connections 2025-02-03 23:18:33 +01:00
Gustavo Iñiguez Goia
83eb82a343 netstat: added option to monitor AF_PACKET sockets
For now, we parse /proc/net/packet, because vishvananda/netlink does not
have support to dump AF_PACKET sockets from kernel.
2025-02-03 21:09:51 +01:00
Gustavo Iñiguez Goia
70e868ad8c
ui: format node addr correctly
When scheduling a temporary rule to disable it, use the correct node
address.
2025-01-31 09:36:13 +01:00
Gustavo Iñiguez Goia
85173c3553
ui,popups: mark temporary rules as inactive
Once the temporary rules expire, mark them as inactive in the DB.
2025-01-31 00:28:11 +01:00
Gustavo Iñiguez Goia
6696d1c141
ui,fw: fixed adding dst/src port rules 2025-01-25 01:46:49 +01:00
Gustavo Iñiguez Goia
0dfec48120
ui, fw: fixed adding rules when using service name
We were failing adding system fw rules when the user selected a
destination port by service name.

We allow to specify port ranges with '-' (8080-8088), and as some
service names contain '-' in the name (ftp-data, netbios-ns), it was
failing.
2025-01-25 01:09:33 +01:00
Yaroslav Chvanov
9e2ef5f491
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'?

Fixes: cdf93c72c1 ("ui: fixed delay closing the GUI")
2025-01-13 22:04:58 +03:00
Gustavo Iñiguez Goia
c0be3d15dc
ui: fixed closing the GUI with a popup active 2025-01-06 20:22:49 +01:00
e3dio
824b5c789a
fix #1245 2025-01-03 22:19:01 -07:00
Gustavo Iñiguez Goia
337b81a89b
ui: fixed acting on selected rows
When selecting rows with CTRL we were not copying/deleting rules
correctly.

Closes #1245
2025-01-04 00:44:34 +01:00
Gustavo Iñiguez Goia
6f41dc6c3e
ui: added proto/ directory 2025-01-03 15:02:48 +01:00
Gustavo Iñiguez Goia
5dd4ef06bb
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
2025-01-03 14:48:35 +01:00
Gustavo Iñiguez Goia
24a5105d77
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 22:21:59 +01:00
Gustavo Iñiguez Goia
d8c3684f2b
ui,stats: improved nodes search 2024-12-26 13:27:44 +01:00
Gustavo Iñiguez Goia
37bb9742a4
ui,stats: fixed displaying proc details dialog 2024-12-24 17:10:34 +01:00
Gustavo Iñiguez Goia
6e7aaf935b
ui: netstat/events view improvements
- 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.
2024-12-21 23:31:25 +01:00
Gustavo Iñiguez Goia
5595a69927
ui: removed hardcoded labels color
It was set to blue, and when using dark themes it didn't look good.
2024-12-21 01:25:23 +01:00
Gustavo Iñiguez Goia
8f2ba67077
ui: fixed searching in tab Users 2024-12-20 15:44:52 +01:00
Gustavo Iñiguez Goia
fcaf3b8181
ui: display all fields in the detail views 2024-12-20 15:40:06 +01:00
Gustavo Iñiguez Goia
5629e2a405
ui,stats: simplified columns configuration
There're only two points where we need to reconfigure the columns:
on showEvent() and when saving the settings.
2024-12-18 21:40:28 +01:00
Gustavo Iñiguez Goia
843f537000
ui,stats: improved restoring columns 2024-12-18 16:18:54 +01:00
Gustavo Iñiguez Goia
eab75b8a48
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-18 00:52:10 +01:00
Gustavo Iñiguez Goia
01e1341770
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 20:07:27 +01:00
Gustavo Iñiguez Goia
ed84394dfc
Merge pull request #1237 from nolancarougepro/lan_access_control
Lan access control
2024-12-17 00:15:37 +01:00
Gustavo Iñiguez Goia
dd89509b1c
ui,stats: don't allow clicking on empty hosts
In the Events tab, don't allow double clicking on the DstHost column if
the cell is empty.
2024-12-16 23:50:36 +01:00
Gustavo Iñiguez Goia
dc2c6959e9
ui,stats: fixed Events tab search
Closes #1243
2024-12-16 12:42:13 +01:00
nolancarougepro
ee0a1586ff Alias to DstIp combobox 2024-12-16 11:09:39 +01:00
Nolan CAROUGE
31da993797
Merge branch 'evilsocket:master' into lan_access_control 2024-12-16 09:46:50 +01:00
Gustavo Iñiguez Goia
80ab972203
ui,prefs: better feedback when saving options 2024-12-15 23:09:53 +01:00
Gustavo Iñiguez Goia
4e8b222bd4
ui,events: display all columns in the Events tab
Display by default all columns in the Events tab, and allow to configure
what columns to display.

Closes #1223
2024-12-15 23:04:47 +01:00
Gustavo Iñiguez Goia
7944532922
ui,prefs: allow to configure server (GUI) address
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.
2024-12-15 01:36:26 +01:00
Gustavo Iñiguez Goia
4264134856
ui,stats: minor adjustment to splitter widgets
- set a better size for rules' left panel.
 - hide node additional info by default.
2024-12-14 23:32:37 +01:00
Gustavo Iñiguez Goia
aa0d5f14dd
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.
2024-12-13 23:38:28 +01:00
Gustavo Iñiguez Goia
d825f1e9b0
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
2024-12-13 21:11:50 +01:00