Live data from Hacker News

Microsandbox: Virtual Machines that feel and perform like containers

github.com

141–150 of 195 posts

Re: Microsandbox: Virtual Machines that feel and perform like containers

#141
post #97

Earlier quoted context omitted.

You cannot build a secure container runtime (against malicious containers) because underlying it is the Linux kernel. The only way to make Linux containers a meaningful sandbox is to drastically restrict the syscall API surface available to the sandboxee, which quickly reduces its value. It's no longer a "generic platform that you can throw any workload onto" but instead a bespoke thing that needs to be tuned and rec…

One can definitely build a container runtime that uses virtualization to protect the host For example there is Kata containers https://katacontainers.io/ This can be used with regular `podman` by just changing the container runtime so there’s no even need for any extra tooling In theory you could shove the container runtime into something like k8s

> container runtime that uses virtualization to protect the host

True, by "container" I really meant "shared-kernel container".

> In theory you could shove the container runtime into something like k8s

Yeah this is actually supported by k8s.

Whether that means it's actually reasonable to run completely untrusted workloads on your own cluster is another question. But it definitely seems like a really good defense-in-depth feature.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#142

Thanks for sharing! I'm the creator of microsandbox. If there is anything you need to know about the project, let me know. This project is meant to make creating microvms from your machine as easy as using Docker containers. Ask me anything.

I like the idea. But when you say "bullet proof" security, there are exploits to break out of VMs that exist. Have you looked into those?

Will fix the docs

Re: Microsandbox: Virtual Machines that feel and perform like containers

#143
post #60

Earlier quoted context omitted.

Thank you! > Can we build our own python sandbox using the sandboxfile spec? Yes and I plan to make that work with the SDK. PS: Multi-stage build is WIP.

Great will join the discord. Is this embeddable? Will it work with a cross platform desktop app(Tauri)?

If by embeddable, you mean having the vm run in the same process, then no. The vm aborts its process when it's done so it has to run as separate process.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#144

Thanks for sharing! I'm the creator of microsandbox. If there is anything you need to know about the project, let me know. This project is meant to make creating microvms from your machine as easy as using Docker containers. Ask me anything.

Cool project. Off topic question: Are the images in the "Use Cases" section in the README from a real app? I like the clean UI design.

No they are not.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#145

Thanks for sharing! I'm the creator of microsandbox. If there is anything you need to know about the project, let me know. This project is meant to make creating microvms from your machine as easy as using Docker containers. Ask me anything.

Can you explain how this compares to Kata Containers? [0] That also supports OCI to run microVMs. You can also choose different hypervisors such as firecracker to run it on. [0] https://katacontainers.io/

Katacontainers is an interesting project. Microsandbox is a more opinionated project with a UX that focuses on getting up and running with microVMs quickly. I want this experience for Linux, macOS and Windows users.

More importantly is making sandboxing really accessible to AI devs with `msb server`.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#146

Earlier quoted context omitted.

You can optimize a lot to start a Linux kernel in under a second, but if you're using a standard kernel, there are all manners of timeouts and poll attempts that make the kernel waste time booting. There's also a non-trivial amount of time the VM spends in the UEFI/CSM system preparing the virtual hardware and initializing the system environment for your bootloader. I'm pretty sure WSL2 uses a special kernel to avoid…

That's not what I'm asking about. I'm saying it takes a long time for it to even execute a single instruction, in the BIOS itself. Even for the window to pop up, before you can even pause the VM (because it hasn't even started yet). What you're describing comes after all that, which I already understand and am not asking about.

I have always wondered the same, never tried looking into it but I wouldn't be surprised if Defender at least played a part in it. Defender is a huge source for general slowness on Windows from my experience.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#147
post #92

This is great! I'd like to see a formal container security grade that works like: 1) Curate a list of all known (container) exploits 2) Run each exploit in environments of increasing security like permissions-based, jail, Docker and emulator 3) The percentage of prevented exploits would be the score from 0-100% Under this scheme, I'd expect naive attempts at containerization with permissions and jails to score around…

The issue, at least with multitenant workloads, isn't "container vulnerabilities" as such; it's that standard containers are premised on sharing a kernel, which makes every kernel LPE a potential container escape --- there's a long history of those bugs, and they're only rarely flagged as "container escapes"; it's just sort of understood that a kernel LPE is going to break containers.

> it's just sort of understood that a kernel LPE is going to break containers.

I think it's generally understood that any sort of kernel LPE can potentially (and therefore is generally considered to) lead to breaking all security boundaries on the local machine, since the kernel contains no internal security boundaries. That includes both containers, but also everything else such a user separation, hardware virtualization controlled by the local kernel, and kernel private secrets.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#148
post #95

Earlier quoted context omitted.

You cannot build a secure virtualization runtime because underlying it is the VMM. Until you have a secure VMM you are subject to precisely the same class of problems plaguing container runtimes. The only meaningful difference is that Linux containers target partitioning Linux kernel services which is a shared-by-default/default-allow environment that was never designed for and has never achieved meaningful security.…

> You cannot build a secure virtualization runtime because underlying it is the VMM There are VMMs (e.g. pKVM in upstream Linux) with small SLoC that are isolated by silicon support for nested virtualization. This can be found on recent Google Pixel phones/tablets with strong isolation of untrusted Debian Arm Linux "Terminal" VM. A similar architecture was shipped a decade ago by Bromium and now on millions of HP bus…

> silicon support for nested virtualization

Is there any guarantee that this "silicon support" is any safer than the software? Once we break the software abstraction down far enough it's all just configuring hardware. Conversely, once you start baking significant complexity into hardware (such as strong security boundaries) it would seem like hardware would be subject to exactly the same bugs as software would, except it will be hard to update of course.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#149
post #95

Earlier quoted context omitted.

You cannot build a secure virtualization runtime because underlying it is the VMM. Until you have a secure VMM you are subject to precisely the same class of problems plaguing container runtimes. The only meaningful difference is that Linux containers target partitioning Linux kernel services which is a shared-by-default/default-allow environment that was never designed for and has never achieved meaningful security.…

I see your point but even if your VMM is a zillion lines of C++ with emulated devices there are opportunities to secure it that don't exist with a shared-monolithic-kernel container runtime. You can create security boundaries around (and even within!) the VMM. You can make it so an escape into the VMM process has only minimal value, by sandboxing the VMM aggressively. Plus you can absolutely escape the model of C++ e…

Could you elaborate on how you could secure those architectures better? It's unclear to me how being in device firmware or being a VMM provides you with any further abilities. Surely you still have the same fundamental problem of being a shared resource.

Intuitively there are differences. The Linux kernel is fucking huge, and anything that could bake the "shared resources" down to less than the entire kernel would be easier to verify, but that would also be true for an entirely software based abstraction inside the kernel.

In a way it's the whole micro kernel discussion again.

Re: Microsandbox: Virtual Machines that feel and perform like containers

#150

Thanks for sharing! I'm the creator of microsandbox. If there is anything you need to know about the project, let me know. This project is meant to make creating microvms from your machine as easy as using Docker containers. Ask me anything.

How does the microvm architecture compare with firecracker?

They are similar. We use libkrun under the hood. Firecracker team seems not to be interested in a macOS implementation
Post reply on HN