Commit graph

2,293 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
582823d34a
ui: added English language to the preferences
Allow to select English language from the Preferences.

This is a static entry like "System default".

It will not load a QTranslator object, so the GUI will use the strings
defined in the code, which are in English.

Closes: #1342
2025-05-14 23:24:38 +02:00
Gustavo Iñiguez Goia
56b2d28b66
ebpf: added support for ipv6 tunnels
In order to intercept UDP tunnels traffic, we use iptunnel_xmit for IPv4
connections. The equivalent of IPv6 would be ip6tunnel_xmit, but
unfortunately it's not public.

So instead of ip6tunnel_xmit, we'll use udp_tunnel6_xmit_skb.

This function receives two parameters besides the struct sock*, in6_addr
*saddr and in6_addr *daddr. If these addresses are not set, usually the
connection is a localhost connection.

On the other hand, this function is defined in the module
ip6_udp_tunnel. If this module is not loaded when the daemon starts,
we'll fail to intercept the connections.

Closes: #1250
2025-05-05 00:34:25 +02:00
Gustavo Iñiguez Goia
02da9b7a09
Merge pull request #1339 from Dandan336/master
Add loongarch64 support
2025-05-01 00:21:06 +02:00
Dandan Zhang
45c591bbc4 Add loongarch64 support 2025-04-30 02:39:27 +00:00
Gustavo Iñiguez Goia
568d69520f
fixed reporting connection UID
When getting a connection from the cache, use the UID of the connection,
instead of the process UID.

more info: https://github.com/evilsocket/opensnitch/issues/1315#issuecomment-2829072245

Closes: #1315
2025-04-27 23:54:52 +02:00
Gustavo Iñiguez Goia
94913683e0
Merge pull request #1336 from petterreinholdtsen/ebpf-riscv64
Added ebpf build rule mapping for riscv64 to riscv.
2025-04-27 23:28:23 +02:00
Petter Reinholdtsen
94f950120f Added ebpf build rule mapping for riscv64 to riscv.
This ensure the kernel headers are found during compilation.
2025-04-27 06:35:22 +02:00
Gustavo Iñiguez Goia
0576c71d77
Merge pull request #1335 from petterreinholdtsen/ebpf-loongarch64
Added ebpf build rule mapping for loongarch64 to loongarch.
2025-04-27 01:09:51 +02:00
Petter Reinholdtsen
f680bbedd6 Added ebpf build rule mapping for loongarch64 to loongarch.
This ensure the kernel headers are found during compilation.
2025-04-26 22:35:21 +02:00
Gustavo Iñiguez Goia
8248c2e0ed ui: better app icon discovery
On some DEs like Xfce4 (Ubuntu 24) we were not displaying icons on the
popups.
2025-04-25 17:30:14 +02:00
Gustavo Iñiguez Goia
f077ac8f19
Merge pull request #1333 from petterreinholdtsen/ebpf-s390x
Added ebpf build rule mapping for s390x to s390.
2025-04-25 17:24:38 +02:00
Petter Reinholdtsen
25ea03a8e6 Added ebpf build rule mapping for s390x to s390.
This ensure the kernel headers are found during compilation.
2025-04-25 08:03:07 +02:00
Gustavo Iñiguez Goia
aeb2018d27
log the UID of exec events 2025-04-24 23:55:42 +02:00
Gustavo Iñiguez Goia
12c21c7a26
removed debug line 2025-04-24 23:53:50 +02:00
Gustavo Iñiguez Goia
82b09c3ac6
removed not needed log line 2025-04-24 18:00:31 +02:00
Gustavo Iñiguez Goia
7ca5c0905f
added network_aliases init file 2025-04-24 16:49:23 +02:00
Gustavo Iñiguez Goia
c8bec89d70
reorganized network aliases feature
- Moved to their own files/dirs.
 - Added Nolan Carouge as author and contributor.
2025-04-24 16:06:11 +02:00
Gustavo Iñiguez Goia
6649a4dffa
delete all generated protobuffers with make clean
Closes: #1322
2025-04-23 23:42:04 +02:00
Gustavo Iñiguez Goia
624d628641
Merge pull request #1331 from lainedfles/ipasn_db_sync
feat: Add bash script to sync OpenSnitch ASN data
2025-04-23 21:13:58 +02:00
Gustavo Iñiguez Goia
fb313adab4
Merge pull request #1332 from lainedfles/update-localhost-exclusion-example-rules
refactor: Update localhost rules and add IPv6
2025-04-23 20:58:45 +02:00
Self Denial
056e2ec2ee
refactor: Update localhost rules and add IPv6
- Changed the local host rule from using regexp to network operator
- Updated destination IP check from specific addresses to CIDR notation (127.0.0.0/8)
- Added new rule for IPv6 localhost connections (::1/128)
- Added nolog property to prevent logging of localhost traffic
2025-04-23 12:48:28 -06:00
Self Denial
4dd8c45eea
feat: Add bash script to sync OpenSnitch ASN data
This commit adds a new bash script that automates the synchronization of IP-to-ASN and AS names databases for OpenSnitch. The script:

1. Downloads pre-processed ASN data from a GitHub repository
2. Creates backups of existing files before updates
3. Updates ipasn_db.dat.gz and asnames.json files
4. Restores backups if downloads fail
5. Can be run via cron to keep the databases updated

The script is designed to be easily integrated into system automation tasks and includes error handling for common issues like missing dependencies (wget) or failed downloads.
2025-04-23 12:26:43 -06:00
Gustavo Iñiguez Goia
3ef922ef84
ui,fw: improved fw rule dialog buttons layout
Closes: #1330
2025-04-23 14:11:31 +02:00
Gustavo Iñiguez Goia
c8d96d030e
Merge pull request #1324 from petterreinholdtsen/duration-12-hours
Introduce new 12 hour duration option.
2025-04-23 13:13:50 +02:00
Gustavo Iñiguez Goia
0c2552b7f4
Merge pull request #1327 from petterreinholdtsen/installed-kernel-headers
Changed how ebpf build find kernel headers from running to installed version.
2025-04-23 11:31:25 +02:00
Gustavo Iñiguez Goia
030b849a8c
Merge pull request #1326 from petterreinholdtsen/ebpf-armv8l
Added ebpf build rule mapping for armv8l to work with more armhf machines.
2025-04-23 11:31:07 +02:00
Gustavo Iñiguez Goia
56b456a9b6
Merge pull request #1320 from lainedfles/gui_fix_reorder_system_rules
ui,stats: handle dict-wrapped notifs in callback
2025-04-22 23:42:12 +02:00
Petter Reinholdtsen
42119c5609 Changed how ebpf build find kernel headers from running to installed version.
This get the build working when building in a chroot or when the running
kernel is different from the kernel headers installed.
2025-04-20 09:48:17 +02:00
Petter Reinholdtsen
fd66bb6cc8 Added ebpf build rule mapping for armv8l to work with more armhf machines. 2025-04-20 09:44:55 +02:00
Petter Reinholdtsen
dc3d7c7eee Introduce new 12 hour duration option.
Fixes #1286
2025-04-19 00:25:24 +02:00
Gustavo Iñiguez Goia
2a8f13d439
process path parsing improvements
- Preprend the chroot of a process to the path:
   Even if a process is executed from a chroot (or a different mount
   namespace), the kernel reports the path as it were from the host.
   For chrooted processes, now we prepend the chroot to the path:
   Instead of /usr/bin/curl -> /var/cache/pbuilder/usr/bin/curl

   Note: if the process is emulated (with qemu for example), the
   checksum will be of the emulator.

 - For proceses launched from /proc, like /proc/self/exe or
   /proc/<pid>/fd/<number>, we were replacing in the cmdline "/proc/*"
   with the absolute path of the binary:

   Path: /usr/bin/curl
   Cmdline reported: /proc/<pid>/fd/<number> -L 1.1.1.1
   Cmdline "fixed": /usr/bin/curl -L 1.1.1.1

   Now we only do that for /proc/self/exe, and leave
   /proc/<pid>/fd/<number> as is, since Path is already the absolute
   path to the binary.

   Path: /usr/bin/spotify
   Cmdline reported: /proc/self/exe
   Cmdline "fixed": /usr/bin/spotify

   Path: /usr/bin/curl
   Cmdline reported: /proc/<pid>/fd/<number> -L 1.1.1.1
   Cmdline final: /proc/<pid>/fd/<number> -L 1.1.1.1
2025-04-18 13:30:51 +02:00
Gustavo Iñiguez Goia
fb16dada09 pkgs: add network-aliases.json
Needed to define net aliases in the rules.
2025-04-18 01:47:27 +02:00
Self Denial
f69d64d067
ui,stats: handle dict-wrapped notifs in callback
Modify the `_cb_notification_callback` method to properly process notifications that are wrapped in a dictionary to ensure consistent handling regardless of how they're sent from different
parts of the codebase.
2025-04-16 00:19:45 -06:00
Gustavo Iñiguez Goia
1b17fe246e
ui: better errors when saving the preferences
Don't overwrite errors if any, to avoid shadowing possible problems.
2025-04-15 12:12:56 +02:00
Gustavo Iñiguez Goia
8ec86c638c
ebpf: arm improvements
- better process interception on aarch64 and armhf.
 - on armhf getting proc arguments is ignored due to an error, but we
   were not marking the event as INCOMPLETE_ARGS, so we were not reading
   the compete cmdline.
2025-04-14 17:43:41 +02:00
Gustavo Iñiguez Goia
566f7b47cb
ebpf fixes for armhf
Change some initializations on inet_dgram_connect, to make the verifier
happy. __builtin_memset() in this particular case was causing errors.
(invalid read from stack off -16+4 size 8)
2025-04-12 00:43:38 +02:00
Gustavo Iñiguez Goia
03863a2346
ebpf fixed on 32bits archs
- fixed loading iptunnel_xmit on i686 and armhf.
 - disable inet_dgram_connect on armhf for now due to errors.
2025-04-11 23:16:56 +02:00
Gustavo Iñiguez Goia
f99700076c
ebpf dns: better error handling
- Avoid crashes if the module is malformed.
 - Better error handling.
2025-04-11 21:07:31 +02:00
Gustavo Iñiguez Goia
452233901d
avoid printing in debug possible invalid var 2025-04-10 21:26:26 +02:00
Gustavo Iñiguez Goia
a92a31de31
ebpf: use btf style maps
Instead of defining the structs with bpf_map_def, now we use BTF style
maps:

https://docs.ebpf.io/linux/concepts/maps/#btf-style-maps
2025-04-10 17:21:00 +02:00
Gustavo Iñiguez Goia
59fec2910e
Merge pull request #1313 from lainedfles/ipasn_db_update_script
feat: Add script to automatically update ipasn and asnames databases
2025-04-10 10:53:40 +02:00
Self Denial
efd87068f8
feat: Add script to automatically update ipasn and asnames databases 2025-04-09 17:56:17 -06:00
Gustavo Iñiguez Goia
feafe87604
migrated ebpf lib from gobpf to cilium
Up until now we've been using https://github.com/iovisor/gobpf/ for
intercepting events from the kernel, and it has worked very well.

Unfortunately it's deprecated since 2021 (iovisor/gobpf#304), which means
that some of the known issues and limitations won't be fixed.

After evaluating some options, I've migrated the code from gobpf to
github.com/cilium/ebpf.

More info: #1222, #1312
2025-04-09 00:15:38 +02:00
Gustavo Iñiguez Goia
297ffbbb42
Merge pull request #1306 from deenle/master
Update i18n ru_RU
2025-04-04 09:44:06 +02:00
Tim
fc7b4243ad
Update i18n ru_RU 2025-04-03 15:25:51 +02:00
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
v1.7.0-rc.2
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
56eddafca8
loggers: handle errors properly
RemoteLogger: don't create the logger if we can't connect with the
server.
2025-03-29 17:21:19 +01:00