Course contentsShow
← Security
Lesson 1505 of 3,05230. Operating System Security - MonitoringFree lesson

Real-Time vs Scheduled FIM

Comparing scheduled scan approaches with real-time monitoring using inotify/fanotify and their performance trade-offs.

Real-Time vs Scheduled FIM

What you'll learn: How to choose between continuous file monitoring and periodic scanning for file integrity, understanding the performance and detection trade-offs of each approach.

The Core Decision

File Integrity Monitoring can run in two fundamentally different modes: scheduled (periodic scans) or real-time (continuous monitoring). Scheduled FIM, like what you've used with AIDE and Tripwire, runs at defined intervals—daily, hourly, or on-demand—comparing current file states against stored baselines. Real-time FIM uses kernel mechanisms (Linux's inotify or fanotify) to detect changes as they happen, triggering immediate alerts.

Scheduled FIM: The Batch Approach

Scheduled scanning is like a security guard making rounds at set times. It's resource-efficient because checks only consume CPU/disk during scan windows. You control exactly when system load occurs, making it predictable and suitable for production environments. However, attackers have a detection window—the gap between when a file changes and when your next scan runs. An intruder could modify files, complete an attack, and clean up evidence between scans.

Best for: Systems with predictable change patterns, compliance-focused environments, or resource-constrained servers.

Real-Time FIM: Instant Detection

Real-time monitoring is like having a motion sensor on every door. Using inotify (user-level file events) or fanotify (system-wide access control), changes trigger immediate notifications. Detection delay drops from hours to milliseconds. However, this comes at a cost: constant kernel hooks create CPU overhead, and high-activity directories (like /tmp or log directories) can flood the system with events, potentially degrading performance or causing event loss.

Best for: High-security systems, servers handling sensitive data, or environments where immediate incident response is critical.

Key Takeaway: Scheduled FIM minimizes system impact but creates detection gaps; real-time FIM provides immediate alerts but requires careful tuning to manage performance overhead and event noise.