Questions tagged [gvisor]

gVisor is a user-space kernel, written in Go, that implements a substantial portion of the Linux system surface. It includes an Open Container Initiative (OCI) runtime called runsc that provides an isolation boundary between the application and the host kernel. The runsc runtime integrates with Docker and Kubernetes, making it simple to run sandboxed containers.

gVisor

What is gVisor?

gVisor is a user-space kernel, written in Go, that implements a substantial portion of the Linux system surface. It includes an Open Container Initiative (OCI) runtime called runsc that provides an isolation boundary between the application and the host kernel. The runsc runtime integrates with Docker and Kubernetes, making it simple to run sandboxed containers.

Why does gVisor exist?

Containers are not a sandbox. While containers have revolutionized how we develop, package, and deploy applications, running untrusted or potentially malicious code without additional isolation is not a good idea. The efficiency and performance gains from using a single, shared kernel also mean that container escape is possible with a single vulnerability.

gVisor is a user-space kernel for containers. It limits the host kernel surface accessible to the application while still giving the application access to all the features it expects. Unlike most kernels, gVisor does not assume or require a fixed set of physical resources; instead, it leverages existing host kernel functionality and runs as a normal user-space process. In other words, gVisor implements Linux by way of Linux.

gVisor should not be confused with technologies and tools to harden containers against external threats, provide additional integrity checks, or limit the scope of access for a service. One should always be careful about what data is made available to a container.

19 questions
25
votes
2 answers

Kata Containers vs gVisor?

As I understand, Kata Containers Kata Container build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers but provide the workload isolation and security advantages of VMs On the other hand,…
Suresh Vishnoi
  • 17,341
  • 8
  • 47
  • 55
14
votes
1 answer

What is the difference between Ignite and gVisor in terms of their use-case?

I would like to know if there is a difference between gVisor and Weave Ignite in terms of their use-cases (if there is any). To me, both of them seem to try a similar thing: make the execution of code in virtualized environments more secure. gVisor…
User12547645
  • 6,955
  • 3
  • 38
  • 69
6
votes
1 answer

Can you run a sandbox container within a Cloud Run container?

Let's say I would to let the user upload some python or bash script, execute it in the cloud run and get the result back. To do this I would create a Cloud Run service with a service account that has no permissions to access project resources. I…
5
votes
3 answers

Cloud-Run process fails with 500 status-code and a membarrier gvisor error

Backround The service is a simple Go program that pipes a file from Cloud Storage to the browser. Everything works fine on my Macbook, but fails on Cloud-Run (managed) for some requests. Mostly large mp4 files. Problem The logs just show a 500…
Andrioid
  • 3,362
  • 4
  • 27
  • 31
3
votes
1 answer

How to stop Undertow triggering warnings from gVisor in Cloud Run

Recently my Undertow application is triggering Cloud Run to report the following: Container Sandbox Limitation: Unsupported syscall setsockopt(0x13,0x1,0xa,0x3e05747fe5a0,0x4,0xfc1abc10). Please, refer to https://gvisor.dev/c/linux/amd64/setsockopt…
mgenereu
  • 33
  • 3
2
votes
1 answer

How gVisor can protect host from dirty cow PoC?

I'm trying to figure out how gVisor can prevent dirty cow vulnerability PoC. so I read code in sentry in gVisor and it seems madvise() in sentry has locking so sentry can avoid race condition. in pkg/sentry/mm/syscalls.go // Decommit implements the…
1
vote
1 answer

Unable to fetch cpu pod metrics, k8s- containerd - containerd-shim-runsc-v1 - gvisor

I moved from gvisor-containerd-shim (Shim V1) to containerd-shim-runsc-v1 (Shim V2). The metrics server and the Horizontal Pod Autoscaler used to work just fine in the case of gvisor-containerd-shim. But now, with containerd-shim-runsc-v1, I keep…
virt
  • 11
  • 2
1
vote
1 answer

In Linux, how does a process call mmap() and add a VMA for its child?

In the document for gvisor, it is explained that "the sentry stores the effective mapping from virtual address to host file in a host VMA by invoking the mmap system call", so that the containerized application process has the information it needs…
sqd
  • 1,485
  • 13
  • 23
1
vote
2 answers

Cloud Run: Why does my instance need so much RAM?

I have a Golang process that runs SQL queries on a 400MB SQLite file. I am using https://github.com/mattn/go-sqlite3 with the connection string: file:mydb.sqlite?mode=ro&_journal=DELETE When run on my dev machine on Docker it only needs 20MB of…
zino
  • 1,222
  • 2
  • 17
  • 47
0
votes
0 answers

Why Kata's guest kernel is bigger than Gvisor's, although it has been optimized

Kata uses an optimized Linux kernel as a guest kernel and gvisor uses an application kernel. Why Kata's guest kernel is bigger than Gvisor's, although it has been optimized?
0
votes
0 answers

Can Kata Containers and gVisor containers enable transparent huge pages (THP) when transparent huge pages are disabled on the host machine?

I'm running Kata Containers and gVisor containers on a host machine with transparent huge pages (THP) disabled. I would like to enable THP specifically for these containers, but I'm not sure if this is possible or how to do it. Is it possible to…
ray
  • 43
  • 3
0
votes
1 answer

Can't launch pod using gVisor

I'm trying to install the gvisor addon in minikube: https://github.com/kubernetes/minikube/blob/master/deploy/addons/gvisor/README.md minikube start --container-runtime=containerd \ --docker-opt…
morloch
  • 1,781
  • 1
  • 16
  • 23
0
votes
1 answer

Debug logs are not generated for Sandboxed container

I am trying to sandbox a simple docker container is running Unary gRPC server application. following code sandboxes and runs the docker container for me: docker run --runtime=runsc -d -p 50051:50051/tcp docker_image I have enabled the debug logs…
user1606191
  • 551
  • 2
  • 6
  • 14
0
votes
1 answer

How to run untrusted code using gVisor on Google Cloud Run?

According to the Google Cloud Run docs for the new 2nd gen runtime environment, running untrusted code using gVisor is supported (due to moving away from gVisor for 2nd gen as far as I understood). I'd like to use gVisor in a Google Cloud Run…
fls0815
  • 483
  • 4
  • 9
0
votes
0 answers

boost::filesystem not working in Google Cloud Run (using gVisor)

I've created a docker container (ubuntu:focal) with a C++ application that is using boost::filesystem (v1.76.0) to create some directories while processing data. It works if I run the container locally, but it fails when deployed to Cloud Run. A…
jgsogo
  • 706
  • 1
  • 9
  • 18
1
2