4 ms·
They are a security boundary. The fact that you need a vulnerability to escape them is proof of that. They just don't have a particularly high cost of escape be
by insanitybit 3mo ago
They are a security boundary. The fact that you need a vulnerability to escape them is proof of that. They just don't have a particularly high cost of escape because reachable kernel vulnerabilities are so common.
- worthless-trash 3mo agoSome people clearly do use containers as deployment mechanism, with security not in mind.
- zbentley 3mo agos/some/most/ That's not meant to be snide, just true, I think.
- CodesInChaos 3mo agoI never understood why kubernetes doesn't use a VM-per-pod model by default.
- dijit 3mo agoEscape from docker containers is trivially easy, if you are able to run as the root user in the container itself. Many (maybe most) containers actually default to running programs as root. Kernel exploit not required.
- maple3142 3mo agoIf you are given a shell with `docker run -it --rm alpine:3 sh`, can you read the /etc/shadow on the host without kernel exploit? Assuming the docker and kernel are sufficiently update-to-date (e.g. latest Docker on Debian Stable).
- chlorion 3mo agoNo. The "root" you get in docker is not actually root outside of the namespace the container in running in. Assuming no bugs in the kernel, it should not be able to do anything more than the UID that it's mapped from.
- ptx 3mo agoDoes Docker use user namespaces by default? Otherwise root in the container is actually root on the host, from what I read. Correct me if I'm wrong. (Privileges are still limited by seccomp filters blocking some syscalls, and there's SELinux to block some other stuff, but it's still the actual root user without user namespaces, I think?)
- insanitybit 3mo agoThat's right. Docker still runs without user namespaces by default, which means that root is the same user inside and outside of the container. This does open up attack surface and configuration footguns. Confinement still leverages dropping some root caps, seccomp, various other namespaces, etc.
- inigyou 3mo agoI don't think this is true, otherwise you could just load a kernel module into the host kernel from a container.
- physicalecon 3mo agoIt is very possible to load a kernel module into the host from a container. https://stackoverflow.com/questions/33013539/docker-loading-kernel-modules https://stackoverflow.com/questions/33013539/docker-loading-...
- tjoff 3mo agoFYI, looks like you are shadowbanned.
- insanitybit 3mo agoI don't think this would change anything even if it were true, which it is not. Running as root in a container opens up tons of footguns but it is not a path out of the container on its own.
- deleted 3mo ago[deleted]
- password4321 3mo ago> They are a security boundary My mistake, leaving out some adjective one could interpret as a misunderstanding of containers as an effective (etc.) security boundary. Fool me 100+ times and all that. There must be at least a triple-digit number of CVEs by now demonstratimg that in practice containers are a thinner layer of security (perhaps not quite as thin as the classic recommendation of running SSH on a nonstandard port, but that might be leaning toward the safer side of analogies vs. malicious code!) rather than a boundary like virtualization (not perfect but a best practice for isolation).