5 ms·
POSIX doesn't speak to the problem at all (except for chroot). It's just not part of the standard. With linux, it's because the tools are exposed piecewise.
by ajross 8y ago
POSIX doesn't speak to the problem at all (except for chroot). It's just not part of the standard.
With linux, it's because the tools are exposed piecewise. Creating a process namespace isn't the same thing as creating a virtual network device. You can use cgroups to stop a container all at once, sure, but you can also use them for other useful purposes and the code is the same. Some of these APIs are simple, some less so. But they're tools.
I know, I know, now you're asking "well, why didn't someone just put all the tools together in one box that would do it with one sane UI?!"
They did. It's called Docker.
- wyldfire 8y agoActually lxc is fairly mature and a more "Linux native" sandboxing feature. But docker certainly was/is more popular.
- ajross 8y agoI know. And the linked project is an effort in that direction too. The point was that a knee jerk "sandboxing in linux is hard" argument is just silly on its face. Because Docker. Just go read any of the bajillion tutorials and testimonials about how to get your process to run in a sandbox.
- hedora 8y agoAre any of the linux sandboxes considered secure yet? Last I checked, they weren’t suitable for multi-tenant machines or for running untrusted code.
- cpuguy83 8y agoFundamentally they share a kernel with the host. This has its own implications. Beyond that it is very difficult to get things right, and there's definitely some information leakage (e.g. see the output of `mount` in a docker container... not a docker specific problem). The main issue is, having a VM layer is always going to be "more secure" (because it's another security boundary) than not having a VM layer. Of course VM's have their own issues. So if you have a need to run multi-tenant/untrusted workloads it's kind of a CYA situation where if you don't use this extra security boundary and there is a problem sometime down the line then you'll have to answer questions like "why didn't you do ..." The reality is you can do a lot to lock things down with seccomp+selinux/apparmor.
- ajross 8y agoSecure for what? I mean, sandboxing is more or less inherently a security technique. An app running in a Docker (or whatever) container is less exposed than one running on a big shared host. Is it as firm an isolation as you get from a proper virtual machine layer? No. But then, as we've discovered over the past year the hardware itself can have bugs that poke holes in that protection. No free lunch. But yeah, Linux's suite of "container" tools are basically as secure as any other OS's "containers", no matter what spin you're reading elsewhere.
- amelius 8y ago> I know, I know, now you're asking "well, why didn't someone just put all the tools together in one box that would do it with one sane UI?!" > They did. It's called Docker. Yes I see that. But I was hoping more for a toolbox like GNU fileutils, not a toolbox with a billion dollar valuation (which is what Docker is)
- ytjohn 8y agoTake a look at rkt. It seems like it would be much closer as it does script based container execution. https://coreos.com/rkt/ https://coreos.com/rkt/
- meddlepal 8y agoRkt is pretty much dead as a standalone technology. It was influential in a number of ways though (for example, it forced the CRI to come into existence in Kubernetes).
- icebraining 8y agoIf you're already using systemd, there's systemd-nspawn.
- zbentley 8y ago> I was hoping more for a toolbox like GNU fileutils, not a toolbox with a billion dollar valuation What do you see as the primary differences between those two projects, or types of projects?
- groestl 8y agoWell, there is unshare. The problem really is network devices, which require tinkering with C.
- maccio92 8y agoSo because a tool is valuable you don't want to use it?
- alexandre_m 8y agopodman: https://github.com/containers/libpod https://github.com/containers/libpod