
A lightweight eBPF program to monitor file creation and modification events on Linux. This tool leverages eBPF (Extended Berkeley Packet Filter) to trace file operations directly from the kernel, providing high-performance monitoring with minimal overhead.
A lightweight eBPF program to monitor file creation and modification events on Linux. This tool leverages eBPF (Extended Berkeley Packet Filter) to trace file operations directly from the kernel, providing high-performance monitoring with minimal overhead.
touch, nano, etc.) directly from the kernel./tmp) will be tracked.cd /tmp; touch file) correctly by tracking directory inodes in the kernel.You can download the latest binaries from the Releases page.
To build the project yourself, you need Go installed.
# Clone the repository
git clone https://github.com/harshavmb/fim-ebpf.git
cd fim-ebpf
# Build the binary
go build -o fim-ebpf .
Create a config.yaml file in the same directory as the binary (or modify the existing one).
monitored_files:
- /tmp/testfile
- /etc/passwd
- /etc/shadow
- /tmp ## monitor the entire directory
ignore_actions:
- read
- stat
ignore_users:
- root
Run the binary with root privileges:
sudo ./fim-ebpf
2025/08/18 07:22:09 Monitoring started. Ctrl+C to exit.
2025/08/18 07:22:37 Event: PID=1745080 UID=6087179 (6087179 (harsha)) CMD=touch FILE=/tmp/testfile FLAGS=00000941 ## actual user
2025/08/18 07:22:54 Event: PID=1745108 UID=0 (0 (root) [Login: 6087179 (harsha)]) CMD=touch FILE=/tmp/testfile FLAGS=00000941 ## even after sudo
2026/01/03 18:55:56 Event: PID=3718310 UID=1002 (1002 (harsha)) CMD=touch FILE=/tmp/testfile ACTION=OPEN FLAGS=00000941 ## monitoring files in a dir
The project uses cilium/ebpf for loading and interacting with the eBPF program. The eBPF code runs in the kernel and sends events to the userspace Go program via a ring buffer.