Linux Container Security
mjg59.dreamwidth.org
mjg59.dreamwidth.org
Because of modern requirements features that already exist get abused (vertical isolation of daemons through different users) and new features get tacked onto already existing ones. This leads to very complicated code-paths that are bug-prone for privilege escalation. Users already offer horizontal isolation similar to containers that sit next to each other. But instead of making users more general they are half-emulated in containers.
The way which taken to fix this is by adding even more complexity, so I guess it will take long until we will come to a point where linux containers are reliable.
That is, finding ways to isolate applications on one machine from each other, while sharing the same resources, just flat out sounds difficult. That two applications can have different /etc/hosts files, for example, just doesn't really grok that easily.
That two machines could have this is easy.
A virtual machine software essentially is an operating system that offers emulated native hardware as an interface. You don't have to show both applications the same file, you can mount different filesystems for them for /etc/ for instance. Or maybe the applications shouldn't read /etc/hosts directly
But, this really doesn't answer my question. Sure, emulating a full machine can be expensive. That is typically why you do it with a very powerful machine in the first place. If the losses are such that they are causing problems, you can always go to real hardware, even.
More to the point, this implies that containers are somehow "free." I am skeptical that could be the case. You are adding a whole new layer onto the operating system to possibly present multiple copies of files or only subsets. Simply put, there can be no free lunches. The price is paid somewhere.
With LXC, the guest processes are separated via cgroups, which is the same way systemd separates processes on the same host during it's init.
And, again, my main concern is more of a cognitive one. It is fairly hard to "pull back the curtains" and think about a system that has different /etc files for each application/container on it. (Heck, the implication seems to be that it would be possible for malware to somewhat easily hide stuff from the other users on the machine.)
I mean, I realize it can be done. And pretty soon it would become the more standard way to do things. Just seems a larger mental shift to me than you are making it sound.
Having a different /etc doesn't require a hypervisor, you're just telling the kernel that a PID's "/" is actually "/usr/local/containers/guest01/". Linux / UNIX has been doing this stuff for years and years.
My main concern would still be the cognitive overhead of my looking at it. Or, is there a way to see a "global" / according to all processes? (That make sense?)
Docker was about application portability first-and-foremost. Then, after a while, they decided they better bolt on some security. Unfortunately it's not quite there. Running multi-tenant vm's on a single host still is a far more secure way to go than multi-tenant containers on a single host. If you are running applications on a single-tenant host, then docker doesn't provide really much for trusted apps other than portability.
Security is one these 'not going to happen to me' thing. Then of course eventually it does.
What's wrong with qemu's support for AppArmor as available in Ubuntu? What does sVirt do that this doesn't do?