In this lesson, we explore alternative techniques for continuous sandboxing and introduce gVisor, a robust solution developed by Google to enhance container isolation. The Linux kernel is a highly complex foundation that supports a vast array of application scenarios—from streaming high-definition Netflix videos to powering critical control systems for space missions. It enables applications to perform thousands of operations via system calls while offering additional privileges and capabilities as needed. However, this extensive functionality also enlarges the attack surface, making the kernel more vulnerable to exploits such as Dirty COW, which can compromise the host system. While tools like Seccomp and AppArmor can mitigate these risks by enforcing blacklist and whitelist rules to control container actions, the fundamental challenge in multi-tenant environments remains: every container interacts directly with the same operating system and kernel. This shared access amplifies security risks.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
gVisor creates an extra isolation layer between the container and the Linux kernel by intercepting system calls, thereby reducing the attack surface.
gVisor Architecture
gVisor’s sandbox architecture comprises two main components that cooperate to provide stronger isolation compared to traditional containers:- Sentry:
Sentry functions as an independent, application-level kernel specifically designed for container environments. It intercepts and processes system calls made by containerized applications. Due to its container-specific design, Sentry supports only a limited set of functionalities compared to the full Linux kernel. This streamlined feature set minimizes the risk of exploitable vulnerabilities.

- Gofer:
When an application inside the container requires file access, Sentry does not forward the call directly to the kernel. Instead, it communicates with a dedicated process called Gofer, which acts as a file proxy. Gofer handles the necessary logic for accessing system files for containerized applications, effectively serving as a middleman between the container and the operating system. This separation further prevents potential exploits.

Benefits and Considerations
Each container is assigned its own isolated gVisor kernel, which serves as a virtualized sandbox between the application and the Linux kernel. This dedicated approach significantly reduces the overall attack surface by ensuring that even if one gVisor instance fails or is compromised, the isolation prevents other containers from being affected.While gVisor provides enhanced security by intercepting system calls and isolating container environments, not all applications are fully compatible with its architecture. It is essential to test your applications for compatibility issues, as processing system calls through a middleman may introduce a slight performance overhead.