NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A High-performance Real-time Container File Monitoring Approach Based on Virtual Machine Introspection

Kai Tan, Dongyang Zhan, Lin Ye, Hongli Zhang, Binxing Fang, Zhihong Tian

TL;DR

This paper introduces a high-performance, real-time container file monitoring method that leverages Virtual Machine Introspection (VMI) to thwart container escape attacks. By isolating and monitoring the memory caches (dentry objects) of specific target files rather than intercepting all file system calls, the approach maintains strong hypervisor-level security while keeping performance overhead under 2%.

What Problem Does This Paper Address?

Containers are the backbone of modern cloud-native applications, but their shared-kernel architecture makes them vulnerable. If an attacker exploits a vulnerability to achieve a "container escape" (like the infamous CVE-2019-5736 runc vulnerability), host-based security tools can be easily compromised or bypassed.

To solve this, researchers turn to Virtual Machine Introspection (VMI), placing the security monitor inside the hypervisor (outside the virtual machine hosting the containers). Because the hypervisor is strongly isolated, it remains secure even if the guest OS is compromised. However, traditional VMI file monitoring is notoriously slow. Intercepting every file access or system call causes frequent, expensive context switches between the VM and the hypervisor (known as VMExits), severely degrading container performance.

The authors address this security-versus-performance trade-off by designing a system that achieves real-time, hypervisor-level file protection without the crushing performance penalty.

Methods

The authors propose a memory-monitoring approach tailored for container-in-VM architectures (like Kata Containers). Instead of hooking system calls globally, the system targets the Linux kernel's dentry cache (dcache) mechanism.

When a file is accessed, the kernel creates a dentry object in memory to store metadata and tracks active users via a reference count (d_count). The core architecture consists of several key components:

  1. Container Parsing Module: Runs in a secure VM (Domain 0) and uses VMI to traverse the guest VM's active process list and namespaces, mapping containerized processes to their respective containers.
  2. Isolated Cache Creation: Standard memory allocation places multiple kernel objects on the same memory page, leading to "false alarms" if adjacent, unrelated files are accessed. To fix this, the authors introduced a customized system call inside the guest VM that forces the target file's dentry object into its own independent or isolated memory page.
  3. Memory Monitoring via EPT: The hypervisor uses Intel Extended Page Tables (EPT) to set the permissions of these specific target memory pages to unreadable/unwritable. When a process attempts to access a monitored file, it triggers an EPT violation (VMExit). The monitor checks if the write/read targets the dentry reference count, allowing it to detect file access instantly.
  4. Abnormal Response & Protection: If an unauthorized access attempt occurs, the system alters the system call return value to a negative error code and clears out the relevant memory fields to prevent resource leaks. It also monitors the KILL system call to prevent attackers from terminating the monitoring agents.
System Architecture

Datasets

The paper does not introduce a new public dataset. Instead, the authors evaluated their prototype using standard system benchmarking tools and real-world container environments:

  • Environment: Xen Hypervisor, Ubuntu 16.04 guest VM, and Docker as the container engine.
  • Volatility Framework: Used to automatically map and bridge the "semantic gap" of the guest VM's kernel structures.
  • IOzone: A standard filesystem benchmark used to measure file read/write performance under different block sizes.
  • mbw: A memory bandwidth benchmark used to evaluate the impact of memory page monitoring on overall system memory copy speeds.

Key Insights and Ideas

  • Targeting the Cache, Not the Call: The major "aha" moment is shifting the monitoring focus from the execution path (system calls) to the data structure (the dentry cache). By watching the data change in memory rather than intercepting the code execution, they drastically cut down on unnecessary VMExits.
  • Defeating the Semantic Gap Cooperatively: VMI typically struggles to understand raw binary memory without heavy processing (the semantic gap problem). This approach uses a lightweight, rootkit-hidden security agent inside the guest VM to cooperatively set up the caches before the container starts, bypassing the slow injection techniques used by previous tools like CFWatcher.
  • Page Isolation is Crucial: Granular memory protection happens at the page level (typically 4KB). Isolating critical file metadata into dedicated pages prevents unrelated OS noise from triggering false security alerts.

Key Results

The prototype was evaluated against simulated web-tampering attacks and actual container escape exploits (CVE-2019-5736), successfully blocking unauthorized modifications in real time.

  • Minimal File I/O Overhead: IOzone testing showed that the read/write performance penalty introduced by monitoring 500 critical container files was within 2%. For a 2048KB block size, read speeds only dropped from 62.72 MB/s to 61.69 MB/s.
  • Rapid Startup Times: Creating 500 file metadata caches added only about 7ms of overhead to the container startup time (557ms total vs. 550ms baseline)—a negligible 1.3% increase.
  • Negligible Memory Footprint: Monitoring 500 files required only 24 memory pages, totaling a mere 96KB of memory overhead.
  • Memory Performance: The mbw benchmark showed less than a 1% difference in memory copy speeds with the monitor active.

Limitations and Future Work

Despite the impressive performance, the authors note a few limitations:

  • Read-Heavy Environments: The system currently triggers on both read and write operations. In environments with high read volumes, this creates unnecessary overhead. Future iterations plan to implement selective monitoring that prioritizes write operations.
  • Usability and Integration: The approach requires modifying the guest VM kernel and container images to support the custom system calls, adding deployment complexity.
  • File Locking Issues: Because the security agent keeps target files open to maintain the dentry cache in memory, containers attempting to acquire exclusive locks on those files might experience failures.

The authors plan to extend this framework beyond file integrity to monitor system calls, network behavior, and container configurations using machine learning-based anomaly detection.

Summary updated

BibTeX
@article{tan2025high,
  author = {Kai Tan and Dongyang Zhan and Lin Ye and Hongli Zhang and Binxing Fang and Zhihong Tian},
  title = {{A High-performance Real-time Container File Monitoring Approach Based on Virtual Machine Introspection}},
  journal = {Journal of Supercomputing},
  year = {2025},
  doi = {10.1007/s11227-024-06779-2},
}
Figure