{"id":426,"date":"2025-11-25T13:05:00","date_gmt":"2025-11-25T13:05:00","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=426"},"modified":"2025-11-25T13:05:00","modified_gmt":"2025-11-25T13:05:00","slug":"sandboxed-containers","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=426","title":{"rendered":"Sandboxed Containers: What They Are and How They Isolate Workloads"},"content":{"rendered":"<p>In this blog, we will look at how sandboxed containers improve workload isolation, reduce security risks, and whether they\u2019re right for the infrastructure.<\/p>\n<p>By the end of this blog, you will have learned the following:<\/p>\n<ul>\n<li>Sandboxed containers<\/li>\n<li>Container runtime and host kernel access<\/li>\n<li>Performance trade-offs<\/li>\n<li>Organizations that use sandboxed containers in production<\/li>\n<li>Should you use sandboxed containers?<\/li>\n<\/ul>\n<h2 id=\"what-are-sandboxed-containers\">What Are Sandboxed Containers?<\/h2>\n<p>Sandboxed containers are a type of container runtime that provides an additional layer of security by isolating containers from the host operating system (OS) and other containers.<\/p>\n<p>You can also call it as virtualised containers.<\/p>\n<p>Here is how it works.<\/p>\n<p>Unlike traditional containers (e.g., Docker, which shares the host OS kernel), sandboxed containers use lightweight virtualization or other isolation mechanisms to fully isolate them.<\/p>\n<p>This prevents container breakout attacks. Meaning that a container can&#8217;t escape its limits and gets access to the host OS Kernel or other containers.<\/p>\n<p>This ensures stronger security for multi-tenant environments (when many users\/orgs share the same system.)<\/p>\n<p>Some popular sandboxed container runtimes include:<\/p>\n<ul>\n<li><a href=\"https:\/\/gvisor.dev\/?ref=devopscube.com\" rel=\"noreferrer\"><strong>gVisor<\/strong><\/a><strong>&nbsp;<\/strong>(Developed by Google) \u2013 A user-space kernel that intercepts&nbsp;syscalls&nbsp;to provide extra security.<\/li>\n<li><a href=\"https:\/\/katacontainers.io\/?ref=devopscube.com\" rel=\"noreferrer\"><strong>Kata Containers<\/strong><\/a><strong>&nbsp;<\/strong>&nbsp;\u2013 Runs each container inside a lightweight VM, ensuring strong kernel isolation.<\/li>\n<\/ul>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/blog.techiescamp.com\/content\/images\/2025\/02\/image-12.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"720\" height=\"627\"><\/figure>\n<p>Instead of sharing the host kernel directly, these runtimes introduce an additional layer that limits direct access to system calls. <\/p>\n<p>It isolates the workloads much better than standard container runtimes.<\/p>\n<p>For example,<\/p>\n<ul>\n<li>gVisor has its own &#8220;mini-kernel&#8221; (called&nbsp;<strong>Sentry<\/strong>) that runs in user space (not directly on the host OS). When an app inside the container makes a syscall, gVisor&nbsp;<strong>intercepts<\/strong>&nbsp;it and&nbsp;<strong>emulates<\/strong>&nbsp;(pretends to handle) it instead of letting it go directly to the host OS.<\/li>\n<li>Kata runs containers in lightweight VMs. The VM kernel typically allows ~200-300 syscalls (similar to a normal Linux kernel). The app inside the container makes syscalls to the VM&#8217;s kernel, not the host OS kernel.<\/li>\n<\/ul>\n<h2 id=\"container-runtime-and-host-kernel-access\">Container Runtime and Host Kernel Access<\/h2>\n<p>To understand sandboxed containers, we first need to know how much access a typical container has to the host kernel.<\/p>\n<p>Most containers today run on container runtimes such as&nbsp;<code>containerd<\/code>&nbsp;or&nbsp;<code>cri-o<\/code>.<\/p>\n<p>Let\u2019s consider what happens when you run a basic container:<\/p>\n<ul>\n<li>It uses the host\u2019s system calls directly.<\/li>\n<li>It shares the same kernel version and capabilities.<\/li>\n<li>It is controlled through&nbsp;Linux capabilities, which limit privileged operations.<\/li>\n<\/ul>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/blog.techiescamp.com\/content\/images\/2025\/02\/image-11.png\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"570\" height=\"549\"><\/figure>\n<p>However, despite these controls, containers can still,<\/p>\n<ul>\n<li>Make direct system calls (~300) to the kernel, which could be exploited if there are vulnerabilities.<\/li>\n<li>Read kernel version and system information.<\/li>\n<li>Access kernel modules and subsystems (though with some restrictions).<\/li>\n<\/ul>\n<p>This level of access poses a risk when running untrusted workloads, especially in multi-tenant environments like CI\/CD platforms.<\/p>\n<h2 id=\"performance-trade-offs\">Performance Trade-offs<\/h2>\n<p>With good security benefits, sandboxed containers come with some performance trade-offs.<\/p>\n<p>Since sandboxed containers rely on user-space kernels, they may consume more CPU and memory compared to traditional containers.<\/p>\n<p>Unlike standard containers, which start almost instantly, sandboxed containers may take slightly longer to boot due to the added virtualization layer.<\/p>\n<h2 id=\"organizations-that-use-sandboxed-containers\">Organizations that Use Sandboxed Containers<\/h2>\n<p>Following are some of the top organizations that use sandboxed containers in production:<\/p>\n<ol>\n<li>OpenAI is using gVisor runtime to run some of its high-risk tasks.<\/li>\n<li>Cloudflare uses gVisor for its building infrastructure<\/li>\n<li>NVIDIA uses Kata Containers to support AI\/ML workloads<\/li>\n<li>Blink is a DevOps platform that uses gVisor for the EKS Pods to run securely.<\/li>\n<\/ol>\n<h2 id=\"use-case\">Use Case<\/h2>\n<p>Let&#8217;s say you are building a SaaS-based CI\/CD platform like CircleCI or BuildKite, where other companies run their build pipelines.<\/p>\n<p>Let&#8217;s say this service lets users define their own build steps and run any Docker container they need for builds.<\/p>\n<p>Ultimately, these build jobs run as containers or pods inside your cluster, and the separation between companies is mostly logical. <\/p>\n<p>While companies are logically separated, they still&nbsp;<strong>share the same underlying system kernel.<\/strong><\/p>\n<p>Now, let\u2019s say someone on your team mistakenly allows&nbsp;<strong>privileged mode<\/strong>&nbsp;in pod security settings.<\/p>\n<p>This means a compromised build job could gain access to the host system. If that happens, one company\u2019s build could access another company\u2019s source code, secrets, or sensitive data.<\/p>\n<p>This is a huge security risk!<\/p>\n<p>So how do you avoid this?<\/p>\n<p>To prevent such risks, we need stronger isolation between builds. This is where Sandboxed Containers come into play.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-blue\">\n<div class=\"kg-callout-emoji\">\ud83d\udca1<\/div>\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note:<\/strong><\/b>&nbsp;The use case is just an example.<\/div>\n<\/div>\n<h2 id=\"should-you-use-sandboxed-containers\">Should You Use Sandboxed Containers?<\/h2>\n<p>If you&#8217;re running sensitive, multi-tenant workloads like:<\/p>\n<ul>\n<li>CI\/CD services<\/li>\n<\/ul>\n<blockquote><p>Serverless functions (e.g., AWS Lambda, Cloud Run)<\/p><\/blockquote>\n<ul>\n<li>SaaS platforms where customers execute arbitrary code<\/li>\n<\/ul>\n<p>Then sandboxed containers are a great way to minimize risk and ensure better isolation.<\/p>\n<p>However, if your workloads run in a trusted environment (such as an internal microservices architecture), the&nbsp;<strong>overhead may not be worth it.<\/strong><\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Although sandboxed containers have certain performance trade-offs, some enterprises use this technology to run their workflows securely.<\/p>\n<p>Companies that use sandboxed containers have made performance tweaks to make them work at almost the same speed as normal containers.<\/p>\n<p>Hope this blog serves as a primer on sandboxed containers.<\/p>\n<p>Want to Stay Ahead in DevOps &amp; Cloud? Join the Free Newsletter Below.<\/p>\n<p><!--kg-card-begin: html--><br \/>\n<iframe loading=\"lazy\" src=\"https:\/\/embeds.beehiiv.com\/2a495ef4-3de7-4600-8a0d-de5dc968b372\" data-test-id=\"beehiiv-embed\" width=\"100%\" height=\"320\" frameborder=\"0\" scrolling=\"no\" style=\"border-radius: 4px; border: 2px solid #e5e7eb; margin: 0; background-color: transparent;\"><\/iframe><br \/>\n<!--kg-card-end: html--><\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/sandboxed-containers\/\" target=\"_blank\" rel=\"noopener noreferrer\">Sandboxed Containers: What They Are and How They Isolate Workloads \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/sandboxed-containers\/<\/p>\n","protected":false},"author":1,"featured_media":427,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-426","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=426"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/426\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/427"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}