3 ms·
Regarding the accusation of FUD regarding the security of new namespaces: https://lwn.net/Articles/671641/ https://lwn.net/Articles/543273/ This blurb fro
by wahern 10y ago
Regarding the accusation of FUD regarding the security of new namespaces:
https://lwn.net/Articles/671641/
https://lwn.net/Articles/543273/
This blurb from the first article is apt:
All of the myriad interactions between various kernel
subsystems (capabilities, namespaces, security modules,
filesystems, /proc, and so on), especially given the "no
regressions for user space" policy, make these kinds of bugs
pretty much inevitable. One could imagine tossing out a
bunch of currently expected behavior to simplify the
complexity of those interactions, but that is not going to
happen, so these types of problems will crop up from time to
time.
That succinctly explains the crux of the issue. More flexible namespacing solutions (which is what containers are--a collection of advanced namespacing features) is fundamentally at odds with what's needed for improved security--simpler code and simpler semantics.
Containers provide lots of flexibility for users and developers. And with that flexibility you can devise some interesting and clever privilege separation solutions. But they're fundamentally relying on a foundation that was made significantly more complex and more bug-prone for the sake of providing that flexibility.
That flexibility exists--it must exist--for the benefit of solving system administration and provisioning chores. And that's why I argue containers aren't fundamentally a security solution, they're a DevOps solution. A powerful and effective one. But it's simply not in the same league as a chroot jail, pledge, seccomp, or Capsicum. None of those things provide any additional privileges nor design flexibility. They're _strictly_ mechanisms for taking away privilege and flexibility. And they're strictly intended to reduce the code interface surface between user processes on the one hand, and kernel and privileged processes on the other. That's their sole function, which means they can, at least theoretically, be kept simple and easy to maintain in the kernel.
EDIT: Technically Capsicum does provide new design flexibility with the introduction of file descriptors as handles to processes. I don't think any _stock_ system implements all of Capsicum, but both Linux and FreeBSD now support process descriptors. Lack of process descriptors was always a huge oversight in the Unix API model, and it's ridiculous it took so long to get them, and still only for Linux and FreeBSD at this point.
- cyphar 10y agoCan you explain why you think that seccomp is even related to chroot? The two are very different technologies with very different goals (in fact, chroot's original goal was _not_ security -- it was a clever hack by Bill Joy in the 80s to allow compiling BSDs on older BSDs...). Even if we pretend that chroots are designed for isolation, seccomp is not. Seccomp is designed to be part of a sandboxing system. Capsicum is a new way of dealing with processes that require privileges. And pledge is sort of like seccomp but with questionable granularity. The point is that sure you can call them "security systems" because they are all based on the idea of blocking things, but that's like saying that bananas and humans are all carbon-based life -- it's technically accurate but not very helpful. Especially since you then go on to talk about the isolation aspects of chroot -- which is something that seccomp, pledge and Capsicum do not give you.