Commit graph

647 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
c22e358fce
added CONFIG_PROC_EVENTS to check-requirements
Check if the kernel has support for the Process Events Connector feature,
to see if we can use it.

https://lwn.net/Articles/157150/
2023-09-30 21:59:45 +02:00
Gustavo Iñiguez Goia
c8a17d6e8a
fixed monitor methods initialization
When using proc as monitor method, the ProcsEventsMonitor was not
being initialized.
2023-09-30 20:49:42 +02:00
Gustavo Iñiguez Goia
0556dc1c81
obtain process's parent hierarchy, checksums improvements
- Obtain the process's parent hierarchy.
 - Display the hierarchy on the pop-ups and the process dialog.
 - [pop-ups] Added a Detailed view with all the metadata of the
   process.
 - [cache-events] Improved the cache of processes.
 - [ruleseditor] Fixed enabling md5 checksum widget.

Related: #413, #406
2023-09-30 18:31:19 +02:00
Gustavo Iñiguez Goia
7a04a53eb1
display checksums on the process dialog
Display the checksums on the process details dialog.
Improved process' icon discovery.
2023-09-23 12:26:21 +02:00
Gustavo Iñiguez Goia
81a964bf83
updated rules tests 2023-09-22 01:21:27 +02:00
Gustavo Iñiguez Goia
1176fa5b9c
updated go.mod
Bumped gopacket and netlink versions.
2023-09-22 01:05:20 +02:00
Gustavo Iñiguez Goia
7a9bb17829
allow to filter connections by process checksum
Now you can create rules to filter processes by checksum. Only md5 is
available at the moment.

There's a global configuration option that you can use to enable or
disable this feature, from the config file or from the Preferences
dialog.

As part of this feature there have been more changes:

   - New proc monitor method (PROCESS CONNECTOR) that listens for
     exec/exit events from the kernel.
     This feature depends on CONFIG_PROC_EVENTS kernel option.

   - Only one cache of active processes for ebpf and proc monitor
     methods.

More info and details: #413.
2023-09-22 00:36:26 +02:00
Huoxi-any
5f907e545d update golang.org/x/net v0.0.0-20211209124913-491a49abca63 to 0.7.0 2023-09-05 20:49:33 +08:00
Gustavo Iñiguez Goia
ce7c3f8002
Bump versions to v1.6.2 2023-07-31 00:36:33 +02:00
Gustavo Iñiguez Goia
00a1dc4249
added Created column to the rules list
Closes #683
2023-07-30 18:16:56 +02:00
Gustavo Iñiguez Goia
efded9edab
added icmp destination-unreachable to system-fw.json
Allow destination-unreachable ICMP types by default, not to display ICMP
pop-ups under certain circumstances.
More info:
https://github.com/evilsocket/opensnitch/discussions/946#discussioncomment-6035934
2023-07-26 11:40:17 +02:00
Gustavo Iñiguez Goia
57a7f5b63d
removed debugging logs, fixed build 2023-07-25 02:11:35 +02:00
Gustavo Iñiguez Goia
26b8415925
force to reestablish non-local connections on start
When we start to intercept connections, we flush out the conntrack
table, to force already established connections reconnect again so we
can intercept them, and let the user choose if allow or deny them.

Since we no longer use conntrack states to intercept TCP connections, we
now close existing connections, leaving to the applications reestablish
them again.
Local connections are excluded, because it may cause problems with some
local servers.

Both options interfere with the established connections, so you may
experience ocasional network interruptions when enabling the
interception for the first time.

Discussion: #995
2023-07-25 01:42:54 +02:00
Gustavo Iñiguez Goia
d1598fdf67
sys fw: allow to use wildcards to match interfaces
Now it's possible to use "br*" to match all network interfaces that
start with "br".

Closes #996
2023-07-24 16:11:12 +02:00
Gustavo Iñiguez Goia
a828ccdcba
reorganized sockets code
Moved sockets code block to netlink package.
2023-07-24 11:18:09 +02:00
Gustavo Iñiguez Goia
662cd2eda3
Better ebpf module errors
Report to the GUI and the logs, whether the modules have been found
or not, and if found, whether there have been any errors loading them.

Closes #868
2023-07-23 23:35:19 +02:00
Gustavo Iñiguez Goia
cb4d82f9ac
respect packet mark when requeueing packet 2023-07-23 22:33:08 +02:00
Gustavo Iñiguez Goia
8b4c8922c5
Added sample rule to allow localhost connections 2023-07-23 22:30:49 +02:00
Gustavo Iñiguez Goia
28f98e4fb6
misc
- Removed 'rules' from .gitignore
- Fixed typo.
2023-07-23 22:29:47 +02:00
Gustavo Iñiguez Goia
6e340a7e39
remote loggers improvements
- Remote logger: fixed a couple of leaks.
- Allow to use multiple remote loggers.
- Allow to use rfc3164 format.
2023-07-23 22:27:28 +02:00
Gustavo Iñiguez Goia
cdf6497ea7
Bump versions to v1.6.1 2023-07-23 22:18:58 +02:00
Gustavo Iñiguez Goia
f652174f75
changed addrs polling by async events
For the eBPF monitoring method, we listed and stored local addresses
every second, so that we could later check if the source IP of an
outbound connection was local or not, because sometimes we received
outbound connections like:
 443:1.1.1.1 -> 192.168.1.123:12345

This could have been alread solved on this change e090833, so maybe
we no longer need this code.

 - Now we subscribe to local addresses events, to receive add/remove
   events asynchronously, without having to list local addrs
   every second, alliviating CPU usage.

 - Fixed creating context object to cancel subroutines. It was not
   working properly when switching between proc monitor methods.
2023-07-23 21:14:47 +02:00
Gustavo Iñiguez Goia
e090833d29
intercept packets only with the SYN flag set
Using "ct state NEW" to intercept packets causes some undesired effects:
  We intercept packets that not only have the SYN flag set, like ACK,
  ACK+PSH or SYN+ACK. Mainly response packets.

  This means that the IPs are not always in the expected order:
  443:1.1.1.1 -> 192.168.1.123:12345
  which causes sometimes not to obtain the process of the connection,
  because the connection in the system appears as
  12345:192.168.1.123 -> 1.1.1.1:443

Intercepting packets with *only* the SYN flag set seems to resolve
this problem.
2023-07-23 15:14:05 +02:00
chncaption
6ede8f06a1 update golang.org/x/sys v0.0.0-20211205182925-97ca703d548d to 0.1.0 2023-07-21 14:42:51 +08:00
Gustavo Iñiguez Goia
c97c322bcb
allow to secure (abstract) unix socket comms
- Allow to use SSL certificates to secure unix sockets communications.
- Allow to use abstract users sockets for server and nodes.

Go gRPC doesn't seem to understand unix sockets addresses that start
with "unix-abstract:", and python gRPC doesn't seem to understand
"unix:@" addresses.
Therefore, on the server (python gRPC) we use the format "unix:@" to
specify the address where the server will listen on, and rewrite it to
"unix-abstract:" before starting the server.

Note about certs and abstract unix sockets:
 When creating the SSL certificates, you'll have to specify the
 address of the unix socket as the Common Name of the certificates:

  Address: "unix:@my-abstract-socket"

  Common Name: @my-abstract-socket
2023-07-19 01:31:13 +02:00
Gustavo Iñiguez Goia
aa7b1e1a02
misc: removed debug msg, fixed warning msg
- Fixed displaying verdict warning message.
 - Removed debug message.
2023-07-17 16:48:44 +02:00
Gustavo Iñiguez Goia
8740755f64
sys fw: report errors to the GUI after reloading
- Send errors to the server (GUI) if there's any error when reloading
   the system fw rules (far from being perfect/optimal, needs a
   rewrite).
 - Don't load the configuration after saving it, let the watcher reload
   it on write change to avoid double reload/duplicated errors.
2023-07-15 20:32:42 +02:00
Gustavo Iñiguez Goia
3de24febf8
sys fw: improved rules errors logs 2023-07-13 17:24:38 +02:00
Gustavo Iñiguez Goia
ad1cdd4015
tests: better sys-fw log,meta and ip tests 2023-07-12 12:53:13 +02:00
Gustavo Iñiguez Goia
eaec4a825c
tests: added sys-fw conntrack tests 2023-07-11 15:32:15 +02:00
Gustavo Iñiguez Goia
3ca5645c7e
tests: added quota tests 2023-07-11 13:53:01 +02:00
Gustavo Iñiguez Goia
7441aa2ccc
tests: rewritten nat tests
Move common nat checks to its own file.
2023-07-11 13:15:26 +02:00
Gustavo Iñiguez Goia
c2e6032a86
tests: added needed helpers 2023-07-11 01:16:23 +02:00
Gustavo Iñiguez Goia
dad8c0c65d
tests: added queue, nat tests
- Added queue, snat, dnat, redirect, tproxy and masquerade tests.
- Return errors if verdict parameters are not formatted as expected.
2023-07-11 00:57:15 +02:00
Gustavo Iñiguez Goia
6ddd4dcee6
tests: added meta tests, improved ip tests 2023-07-09 23:05:12 +02:00
Gustavo Iñiguez Goia
b1ebc0eb22
sys fw: fixed setting marks on packets
Fix for meta mark set 666
2023-07-09 23:03:50 +02:00
Gustavo Iñiguez Goia
a18404fba9
tests: added sys-fw ip and iface tests
- Added ip daddr, saddr tests.
- Added basic iface tests.
2023-07-08 21:50:46 +02:00
Gustavo Iñiguez Goia
603c4ab39a
tests: added sys-fw verdict tests
- Added accept, drop, return and jump tests.
- Added reject tests.
2023-07-07 13:56:25 +02:00
Gustavo Iñiguez Goia
1a063d10e2
tests: added new sys fw tests
- Added counter tests.
- Added ethernet addresses tests.

Added comments to some functions.
2023-07-07 00:46:09 +02:00
Gustavo Iñiguez Goia
e268a88cff
tests: added sys fw ports tests 2023-07-06 17:59:30 +02:00
Gustavo Iñiguez Goia
28fab440da
sys,fw: check for errors when adding ports rules
Verify that ports are correctly converted to int, for single and range
ports.
2023-07-06 17:58:17 +02:00
Gustavo Iñiguez Goia
84df5135ff
tests: added log and protocol expressions 2023-07-06 16:02:14 +02:00
Gustavo Iñiguez Goia
aa8e793dc4
sys,fw: fixed compilation 2023-07-06 14:33:56 +02:00
Gustavo Iñiguez Goia
18e583d20e
tests: updated sys fw tests 2023-07-06 14:27:54 +02:00
Gustavo Iñiguez Goia
344819eb30
sys,fw: export more internal funcs 2023-07-06 14:09:54 +02:00
Gustavo Iñiguez Goia
d474e7f57a
sys,fw: export some internal utils. 2023-07-06 13:36:57 +02:00
Gustavo Iñiguez Goia
d94154f0bd
tests: added missing testdata for ui/client 2023-07-04 13:57:58 +02:00
Gustavo Iñiguez Goia
2acace985e
small ui/client reorganization 2023-07-04 13:35:58 +02:00
Gustavo Iñiguez Goia
234984f85b
tests: added daemon config tests
- Test that the default config is loaded properly.
- Test that changes to the config are saved to disk.
- Test that changes to the config file on disk are reloaded properly.
2023-07-04 13:25:09 +02:00
Gustavo Iñiguez Goia
97703b65db
ui client: fixed setting daemon config
- Fixed setting daemon config.
- Removed unused code.
2023-07-04 01:31:16 +02:00