Commit graph

880 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
9d5d53d07f
ui,stats: improved rules selection
Some checks failed
CI - build eBPF modules / build (6.0, 1.5.0) (push) Has been cancelled
CI - build eBPF modules / build (6.0, master) (push) Has been cancelled
Test resources validation / Install tools (push) Has been cancelled
Build status / Build (push) Has been cancelled
Use the Time column to select rows when in detail view, and the Name
column when listing app rules.
2025-04-01 11:57:33 +02:00
Gustavo Iñiguez Goia
320ec18b31
ui: improved rows selection (4)
discard current selection:
 - if the user right clicked on a row not part of a selection.
 - if the user clicked on a row, and there's only one row selected.
 - if the user clicked on a row already selected.
2025-03-31 14:51:12 +02:00
Gustavo Iñiguez Goia
fe715a5cf1
ui: fixed crash selecting rows on old PyQt versions
In PyQt < 5.15 isRowSelected() requires two arguments (row and parent).
Since 5.15, the parent argument is optional, and the default value is an
empty QModelIndex().

In order to support old PyQt versions (Ubuntu 20.x), we add always
the second argument.

- Misc: headers reorganization.
2025-03-30 19:21:20 +02:00
Gustavo Iñiguez Goia
e6bd14e816 ui,stats: fixed copying selected rows 2025-03-30 19:06:35 +02:00
Gustavo Iñiguez Goia
b2f2e44b8a
ui: improved diplaying default icons
In some DEs, like Enlightenment, some builtins icons may be empty.
The icon is not Null, but there're no available sizes, and the
pixmap is empty.

For now we'll use SP_FileIcon as the default icon, which exists
in this scenario, but we should create a new default icon, and
distribute it with the GUI.
2025-03-29 17:05:34 +01:00
Gustavo Iñiguez Goia
f2eb3fab13 ui: fixed selecting rows when in detail view
When the user double clicked on a rule to view the details, we were not
using the correct column to track selections.
2025-03-27 23:56:27 +01:00
Gustavo Iñiguez Goia
b276d36786
ui: fixed deleting rules with DEL key
Adapted to the latest changes.
2025-03-26 00:13:16 +01:00
Gustavo Iñiguez Goia
a3d75476ac
Merge pull request #1298 from atriwidada/l10n-update
Update Indonesian translation
2025-03-21 13:11:26 +01:00
Gustavo Iñiguez Goia
5e91442dfc
ui: display highlighted text properly
when the cells of a table are customized.
2025-03-21 11:15:22 +01:00
Gustavo Iñiguez Goia
7db4c9a9aa
ui: added needed import to highlight rows 2025-03-21 10:13:38 +01:00
Gustavo Iñiguez Goia
12af2c3eb9
ui: fixed displaying highlighted color of cells
When the properties of a cell was customized, the background color of
the highlighted cell was not respected/restored.
2025-03-21 00:43:39 +01:00
Gustavo Iñiguez Goia
f1c8b16281
ui: restore deleted line 2025-03-21 00:04:39 +01:00
Gustavo Iñiguez Goia
0fbbbcca10
ui: improved rows selection (3)
- Pressing the Space key on a view paginates the view forward.
 - Apply rule actions both to visible selections (the ones the user
   sees), and non-visible selections (those out of the viewport).
 - Right clicking on a selection does not discard the selection.
 - Left clicking on a selection discards the selection and selects the
   clicked row.
 - Left clicking on a selected row selects/deselects the row.

ref: #1291
2025-03-20 23:50:11 +01:00
Andika Triwidada
fcd14bc0e9 Update Indonesian translation 2025-03-20 12:18:35 +00:00
Gustavo Iñiguez Goia
b113ed0960
ui: improved rows selection (2)
- Fixed the use of Ctrl + mouse dragging to select/deselect rows of
   an existing selection.
 - Misc: fixed var name, removed unused code, avoid adding non valid
   rows to the selection.

ref: #1291
2025-03-19 16:35:05 +01:00
Gustavo Iñiguez Goia
fe7300825a
ui: improved rows selection
Previously while scrolling, only one row remained selected, and using
the mouse to select rows didn't work.

Now:

 - All selected rows remain selected while scrolling.
 - The mouse can be used to select rows.

Previous functionality has not chaged:
 - Selecting a row toggles the selection.
 - ESC discard the selection.
 - CTRL + key up/down or click selects/deselects rows.
 - CTRL+c copies selected rows to the clipboard.

ref: #1291
2025-03-19 00:35:01 +01:00
Gustavo Iñiguez Goia
c3183c2683
ui,popups: removed extra Allow option
Allow option was duplicated in a combobox.

Reported by @tredondo in #1269.
2025-03-04 22:46:46 +01:00
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
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
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
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