Commit graph

7 commits

Author SHA1 Message Date
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
Gustavo Iñiguez Goia
c64b2df03c
ebpf: delete expired exec events from cache
Whenever a process exits, we delete the corresponding entry from
cache.

But when a process executes a new process (sh -c ls), we receive an
exit event for the parent, while the child continues working with *the
same PID*. Sometimes we don't receive exit events for the child, so the
entry was never removed from cache.

We should properly detect the exits, but forthe time being, delete
expired processes from cache every minute.
2022-11-15 23:30:26 +01:00
Gustavo Iñiguez Goia
72483bdcde improved process detection
latest changes to detect short-lived processes caused undesired
behaviour (#694)

Closes #685
2022-07-08 17:15:57 +02:00
Gustavo Iñiguez Goia
e7024e3fe0 ebpf: support for long paths
Added support to report absolute path to a binary up to 4096 characters,
defined here:

https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/limits.h#L13
2022-06-27 14:42:54 +02:00
Gustavo Iñiguez Goia
4ce8b0e57c ebpf: improved process detection/new events module
Improved process detections by monitoring new processes execution.
It allow us to know the path of a process before a socket is opened.

Closes #617

Other improvements:
 - If we fail to retrieve the path of a process, then we'll use the comm
   name of the connection/process.
 - Better kernel connections detection.
 - If debugfs is not loaded, we'll try to mount it, to allow to use
   eBPF monitor method.

Future work (help wanted):
 - Extract command line arguments from the kernel (sys_execve, or mm
   struct).
 - Monitor other functions (execveat, clone*, fork, etc).
 - Send these events to the server (GUI), and display all the commands
   an application has executed.
2022-06-24 01:09:45 +02:00
Gustavo Iñiguez Goia
93f61d09e8 ebpf cache improvements
The eBPF cache is meant mainly for certain applications that
establish 2-4 new connections in under 1-2 seconds. Thus, a cache of 1
minute per item was too much, 10-20 seconds is enough.

Also, check old items every minute to keep the number of items low.
2022-02-22 20:33:29 +01:00
Gustavo Iñiguez Goia
7c87baff13 ebpf: fixes (TODOs) and improvements
Fixed a problem that caused an infinite loop, leading to fallback to
ProcFS and missing some network events.

Discussion: #550
2021-12-20 15:58:16 +01:00