FileMon
Detector provides events related to file / filesystem operations. Supported LSM hooks:
file_openhook provides info about file owner/permissions + permissions with process accessed the file.mmap_filehook provides info about mmaped file: path, protection flags.path_truncatehook provides info about path truncated by truncate syscall.path_unlinkprovides info about path being deleted.path_chmodprovides info about changing file permissions.path_chownprovides info about changing file owner.sb_mountprovides info about mounted devices.file_ioctlprovides info about ioctl commands.
Required Linux Kernel Version
file_open: 6.2 or greatermmap_file: 6.2 or greatersb_mount: 6.2 or greaterfile_ioctl: 6.2 or greaterpath_truncate: 6.8 or greaterpath_unlink: 6.8 or greaterpath_chmod: 6.8 or greaterpath_chown: 6.8 or greater
Config Description
Config represents a dictionary with supported LSM BPF file hooks:
- file_open
- mmap_file
- path_truncate
- path_unlink
- path_chmod
- path_chown
- sb_mount
- file_ioctl
For each file hook the following options are supported:
enabledenables detection for current hook. False by default.
Event filtering
FileMon detector supports process filtering.
FileMon also supports path filtering for hooks:
- file_open
- path_truncate
- path_unlink
- path_chmod
- path_chown
- mmap_file
- file_ioctl
Config example:
file_open:
enabled: true
path_filter:
name:
- .history
- .bash_history
prefix:
- /boot
path:
- /etc/passwd
mmap_file:
enabled: true
path_truncate:
enabled: false
path_unlink:
enabled: false
path_chmod:
enabled: false
path_chown:
enabled: false
sb_mount:
enabled: false
process_filter:
binary:
name:
- tail
path:
- /usr/bin/cat