

Additionally, OSSEC generates other security logs of system activity, which provide valuable insight to system administrators. You can also use Monit to monitor files, directories and filesystems on localhost. So from log files you can clearly see who read file using grep or made changes to a file using vi/vim text editor. MODIFY: A file or directory was modified. Events: CREATE: A file or directory was created. In the output of the inotifywait command, you will see the events that occurred, the file that was affected, and the time of the event. To monitor or ignore additional file systems, configure the following advanced settings related to fanotify, a Linux feature that monitors file system events. permmaskread : File was open for read operation. To monitor a directory, use the inotifywait -r -m directory command. exe/bin/grep : Command grep used to access /etc/passwd file. Find Largest Files and Directories under a specific. In our example user is lighttpd used grep command to open a file. Here are more Linux commands to find the largest files in Linux. File descriptor monitoring is at the core of event-driven applications from graphical applications to web servers. Du command will check size for files and directories. This change information can be extremely useful for investigating security incidents. du -sh: display file and directory size in human-readable format sort -rh: Reverse the result based on human-readable numbers head -5: display first 5 largest files. Incron is similar to cron, but instead of running a command based on time, it can trigger commands when a file/directory event occurs (e.g., a modification to a file or to a file’s permissions).

OSSEC is an open-source file integrity monitoring application that records changes to a server's file system to help detect and investigate an intrusion or change. It logs changes to monitored files on the system, and those logs should then be forwarded to centralized logging.
