Is eBPF the Optimal Choice for Integrity Control Tasks?
This article examines eBPF as a tool for file monitoring in Linux and compares it with inotify and fanotify. The completeness of the data depends on the logic implemented by the developer.

eBPF allows running verified bytecode in the Linux kernel space without modifying the kernel's source code or rebooting the system. A built-in verifier checks the program before execution, preventing infinite loops, system crashes, and unauthorized memory access.
Unlike inotify and fanotify, eBPF enables developers to define their own business logic. For file monitoring, two layers are used: C code runs in the kernel, while Go handles event interactions. The connection between them is provided by LLVM and special tools, including bpf2go. Logic can be attached to kernel functions via the kprobe mechanism.
For integrity control, the article proposes a custom event structure. It should include the action type, file name, user and process identifiers. Events are transferred between kernel and user spaces via eBPF maps—key-value data structures.
The author notes that eBPF can provide the metadata necessary for information security, but only with sufficient developer effort. The inode is considered as the file identifier, rather than the path or file_handle used by fanotify.





