Commit graph

1818 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
dcb1157365
Merge pull request #1282 from NormPlum/github-templates
Update bug_report.md
2025-02-28 13:42:39 +01:00
NormPlum
1f96fb14dc
Update bug_report.md 2025-02-28 04:52:53 +00: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
7ea473f823 actions/upload-artifact bumped to v4
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
2025-02-25 16:23:50 +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
c6b42890c0
proc.readEnv() improvements
- Minimize the risk of race conditions when we're prompting the user to
   allow/deny a connection, while we're still reading proc's environ file.
   (this was actually a leak).
 - Preallocate the Env map with the expected environ vars.
2025-02-17 14:15:28 +01:00
Gustavo Iñiguez Goia
6ba7265364
tests: bumped minimum Go required version to v1.21
Some checks failed
Build status / Build (push) Has been cancelled
2025-02-14 23:28:31 +01:00
Gustavo Iñiguez Goia
ce006ee1ac
Bumped nftables lib to v0.2.0 2025-02-14 23:06:50 +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
707a5b3c15
Merge pull request #1265 from jermanuts/donate-link
direct link to sponsoring page
2025-02-14 00:20:58 +01:00
Gustavo Iñiguez Goia
2509d21e30
daemon: allow to filter connections by parent path
Some use cases:

 - Reject connections initiated by certain paths:

   Deny all connections initiated by cron*:
        /usr/sbin/cron
            /usr/bin/curl

     "action": "reject",
     "operator: {
        "type": "list",
        "operand": "list",
        "data": "",
        "list": [
     	   {
                "type": "regexp",
                "operand": "process.parent.path",

                // /usr/bin/crond , /usr/bin/crontab, ...
                "data": "^/usr/(s|)bin/cron"
           }
        ]
     }

 - Reject or Allow connections of binaries launched by another app:

       "action": "allow",
       "operator": {
       	"type": "list",
       	"operand": "list",
       	"data": "",
       	"list": [
       	    {
                "type": "simple",
       	        "operand": "process.parent.path",
       	        "data": "/opt/spotify/bin/spotify"
       	    },
       	    {
       	        "type": "simple",
       	        "operand": "process.path",
       	        "data": "/usr/bin/wget"
       	    }
       	  ]
       }

You can also combine multiple parent paths, to allow a command launched
from a specific chain of processes:

    /usr/lib/systemd/systemd
        /usr/sbin/cron
             /bin/sh
                 /usr/bin/curl

The order is checked from the newest process to the oldest (curl -> sh
-> cron -> systemd)

The operand can be used with any of the existing types (simple, regexp,
etc).

Related: #406
2025-02-13 01:23:31 +01:00
Gustavo Iñiguez Goia
deba3e2252
Bumped packaging versions to v1.7.0rc1 2025-02-11 01:24:03 +01:00
Gustavo Iñiguez Goia
5eebaf40fc improved the process tree retrieval 2025-02-11 01:21:06 +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
Gustavo Iñiguez Goia
2a68561557
exclude disabled rules from the active rules
Disabled rules were part of the active rules. The fields were not
evaluated, but we still went through the entire list.

Not adding them to the list of active rules improves matching time,
especially when there're a lot of disabled rules.

It mainly affected when matching rules that were non-priority or
ordered alphabetically, with action Allow.
2025-02-08 15:12:11 +01:00
Gustavo Iñiguez Goia
07a4077a6a
schedule temp rules only if enabled
Avoid scheduling temporary rules if they're not enabled.
2025-02-08 00:37:04 +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
jermanuts
bc217f5c44
direct link to sponsoring page 2025-02-05 21:11:07 +02: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
e403b080bc
cache,events: added debug logs
- Added logs to debug the cache of events.
 - Reduce the expected number of checksums types we may compute
   simultaneously. Probably we only need one.
2025-01-28 23:44:54 +01:00
Gustavo Iñiguez Goia
c1fdfb1d73 cache: delay the deletion time of an process
Sometimes we may receive a connection event after the exit of a
process:

[exec] /bin/xxx, pid 1234
[exit] /bin/xxx, pid 1234
[new conn] pid 1234 -> process unknown (on exec event and no /proc entry)

In these scenarios, we delay the deletion from cache a little
bit, to keep the PID available for a longer time.
2025-01-27 01:08:19 +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
Gustavo Iñiguez Goia
ced8410d43
allow to use lists of md5s to block connections
Besides domains, net ranges and IPs, now it's possible to
filter connections by the MD5 of a binary, if it's enabled.
2025-01-24 00:47:02 +01:00
Gustavo Iñiguez Goia
5184c45086
changed dns log messages
Moved some messages to Trace.
2025-01-22 19:19:57 +01:00
Gustavo Iñiguez Goia
f7803ebdcb
added trace logs for packets and ebpf
- Log packets.
 - Log special case.
 - Updated information on some rare cases when intercepting connections
   via eBPF.
2025-01-22 01:06:10 +01:00
Gustavo Iñiguez Goia
7a32f32f7a
netlink/ more improvements
- Fixed serializing netlink data:
   d237ee16c3 (diff-f7f6108a60b107adfb0930f5f73a6ae229f9943bb01949d1f8f3e247f869b2abL59-L60)
 - misc.
2025-01-22 00:33:10 +01:00
Gustavo Iñiguez Goia
d54f8d4777
netlink/ improvements
- Structs fields alignment fixed.
 - Dump more sockets via netlink, in order to display them with the
   SocketsMonitor task (netstat).
 - Fixed serializing netlink data:
d237ee16c3 (diff-f7f6108a60b107adfb0930f5f73a6ae229f9943bb01949d1f8f3e247f869b2abL59-L60)
2025-01-22 00:16:17 +01:00
Gustavo Iñiguez Goia
63a3b4e446
ebpf improvements
- changed formatting.
 - extract source IPs from UDP packets from ancillary messages.
 - hook inet_dgram_connect to solve intercepting some apps (parsec).
 - remove debugging / unused code.

More info on these changes:
fbdef1673d
20a03e11fe
f44d3e896b
93d1cefbc2

Closes: #1246.
2025-01-21 23:57:01 +01:00
Gustavo Iñiguez Goia
dd6b3c57f7
Merge pull request #1255 from staticssleever668/fix_unbound_service
ui: make sure 'service' variable is set
2025-01-13 21:09:54 +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
45f5b62978
add new log level TRACE 2025-01-12 00:47:49 +01:00
Gustavo Iñiguez Goia
ff3ac6663a
allow to filter connections by username
Added new rule operand 'user.name' to filter connections by username.

More info #1236
2025-01-09 17:15:28 +01:00
Gustavo Iñiguez Goia
c0be3d15dc
ui: fixed closing the GUI with a popup active 2025-01-06 20:22:49 +01:00
Gustavo Iñiguez Goia
2357186093
Merge pull request #1252 from e3dio/master
fix #1245 UI rule deletion
2025-01-04 19:31:32 +01:00
e3dio
824b5c789a
fix #1245 2025-01-03 22:19:01 -07:00