Linux Containers, Docker, and Security
slideshare.net
slideshare.net
<snark> But I'm sure if nobody's talking about it on Reddit, that must mean it's not a big deal. </snark> ;)
kernel bugs affect all containers for example
Fun fact: BSD jails have same (mis)design.
also, jail has an arguably better implementation.
containers, jails, etc. are useful for the right scenarios of course.
But I question their usefulness as "vm-replacements". For the reason tptacek presented the long list of similar possibilities. It's complex and thus it's hard to secure.
Thinking about fault domains is important, but it's only part of the picture.
Definitely unfair to bring it up at this point--it was a while back--but until everyone universally says they're solid, I'm not touching them.
EDIT: Anyway, it's probably an issue with the tooling around containers, not the implementation of kernel containers itself (well, in theory it might have been a bug in the kernel that corrupted the rootfs and you reported it here as it has destroyed your host's system).
I just ran lxc-destroy on what I thought was a container, started running into lots of issues in Chrome running on host so I closed out Chrome to try to restart it, at which point its binary couldn't be found so I blindly restarted hoping it'd fix it. And... there was nothing.
I've had a much smoother experience with lxc on Ubuntu than arch. The core lxc developers work for canonical, and Ubuntu lxc bootstrap scripts are much more refined. Lxc support for arch linux is provided by the community, and at least when I tried last year, there were minor problems here and there.
On arch linux, I've found that systemd-nspawn support is much better than lxc's. The commands mkarchroot and arch-nspawn (in the devtools package) make running arch in arch straightforward.
It has since been fixed and attached to the 'PID' namespace meaning that all processes in the PID namespace get shutdown in the same manner as the host calling shutdown() (ie init gets a specific signal, userspace processes get signaled as well)
For certain use cases they are absolutely fine because the trust boundary between containers or the kernel isn't critical: * Deployment (immutable servers) * Development environment (develop against same configuration as production) * Test environment (try different distros)
But running multiple containers from untrusted parties on one host is risky. Let's face it, kernel exploits do come out periodically and when that happens, container boundaries can be breached.
At the end of the day, security isn't absolute. You need to consider how valuable your data is and make your own decision.
At the moment i am taking my notes on how to secure containers and attempting to put them in a more digestible form unfortunately depending on what you are trying to do with containers the security model and how you defend those containers changes dramatically
if any one is interested in more info hit up http://doger.io and feel free to ask questions or request specific information be posted