Some kernels or systems may not have tracefs mounted or available
by default.
We need the path /sys/kernel/tracing to be mounted, in order to add
syscalls ebpf probes.
So from now on we'll try to mount /sys/kernel/tracing if it's not
already mounted.
-check-requirements parameter updated to check if this option is
available.
Closes#1450.
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
- Get cmdline arguments from kernel along with the absolute path to the
binary.
If the cmdline has more than 20 arguments, or one of the arguments is
longer than 256 bytes, get it from ProcFS.
- Improved stopping ebpf monitor method.
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.