← Back to context

Comment by gozzoo

5 hours ago

The article doesn't mention docker at all. I don't understand why containers are not viable solution for headless browsers.

Docker doesn't provide any security. You install Docker on your local laptop, and the container you spin up when you execute `docker run` interacts with your laptop's kernel directly. It provides logical isolation between containers but provides zero protection for your host kernel (assuming you decide to install Docker on a remote server instead).

Firecracker provides an isolation between the host kernel, on the one hand, and the guest microVM, on the other hand. So on AWS, you use an Amazon Machine Image (AMI) to specify the OS and other components and libraries installed on an EC2 server such as c5.metal, or if you're using nested virtualization, you can use c8i, s8i, or m8i instances at a discount of about 80%-90% at some performance and other cost, and you bundle Linux along with the Firecracker binary. Then you compile a build artifact including `rootfs` for the Firecracker baked image which is the microVM image (analogous to a Docker image that results from executing `docker build`). But the microVM process has its own virtual kernel and is a guest on the host machine. So for instance, you can place Docker inside the microVM, then the container is executing against the microVM kernel, not the host EC2 kernel. Communication is achieved securely between the two using `vsock` and probably something like `socat` so that data travels, say, from guest RAM to host RAM directly to an S3 quarantine bucket, for instance, without ever touching the host's kernel or filespace.

So I've been playing and tweaking for a while with running different browsers in containers. And it took a long while to get working well, but it's doable.

The only issue is scaling, the containers aren't super quick to start (so we keep a spare container ready) and there's plenty of other issues. Also docker isn't really a security boundary so there's issues and concerns there.

Their competitive advantage is not so much running the browser but rather making the browser undetectable.

They boast a large residential proxy network too, which tells you all you need to know.

Or processes. Chrome has builtin process isolation for every browser tab. It starts up darn near instantly, and scores as 'pretty good' as far as sandboxing is concerned.

docker is not a security boundary but a resource boundary.

  • It is security boundary but a weak one. Escaping from docker is very hard.

    • > Escaping from docker is very hard.

      You mean a microVM.

      A docker LPE (local privilege escalation) requires a kernel exploit such as Copyfail would work under docker but not in a microVM.