Live data from Hacker News

New Linux vulnerability affecting cgroups: can containers escape?

unit42.paloaltonetworks.com

61–70 of 86 posts

Re: New Linux vulnerability affecting cgroups: can containers escape?

#61

Earlier quoted context omitted.

I'll quote Theo deRaadt here, he was talking about virtualization but I would guess the same could be said of containers: You are absolutely deluded, if not stupid, if you think that a worldwide collection of software engineers who can't write operating systems or applications without security holes, can then turn around and suddenly write virtualization layers without security holes

Who was he referring to?

No one in particular. He's saying there are no perfect developers so no hypervisors will ever be perfectly secure.

Re: New Linux vulnerability affecting cgroups: can containers escape?

#62

Earlier quoted context omitted.

Things may have changed, but the last few times I looked, it was breathtakingly hard to a) identify if /when selinux is what's screwing you, then b) get selinux to stop it. I really wanted an audit mode that could also say "this command will unlock the specific thing I just blocked". That was a few years ago. Since then, I've turned off selinux whenever I'm getting screwed by some opaque process, stuff starts working…

Is audit2allow the thing you want?

On server environment that command is most of the time not installed by default.

Quick! tell me which package I need to install to get audit2allow on a system; without using Google, dnf whatprovides, or repoquery --whatprovides.

I'm still baffled why such an essential tool for quickly assessing violations and potential selinux booleans quick fixes is part of a obsfucated package name. I think some setroubleshoot family of tools might be installed by default on some systems, even if most answers will guide people to just use audit2allow.

Re: New Linux vulnerability affecting cgroups: can containers escape?

#63
post #19

Earlier quoted context omitted.

I disagree. The advice to disable SELinux, like your assertion that it's too complicated for ordinary users, belongs to an older time. It's time to lay that myth to bed. Sure, if you're messing around with k8s and doing fun eBPF stuff you are going to need to be careful. But for just installing an OS, running it to do some web-browsing, gaming, image editing, wordprocessing? I would be highly surprised if the default…

> The advice to disable SELinux... time to lay that myth to bed. I think we agree, and Fedora / Red Hat have done great work setting up great defaults. But when a user encounters an issue with SELinux, the lack of feedback mechanisms to help them onto a better path results in them finding that advice.

Fedora literally gives you a notification and you can take action

(Me a as novice Linux user)

Re: New Linux vulnerability affecting cgroups: can containers escape?

#64

Earlier quoted context omitted.

> The advice to disable SELinux... time to lay that myth to bed. I think we agree, and Fedora / Red Hat have done great work setting up great defaults. But when a user encounters an issue with SELinux, the lack of feedback mechanisms to help them onto a better path results in them finding that advice.

Fedora literally gives you a notification and you can take action (Me a as novice Linux user)

That's fantastic for Fedora desktop users. I don't expect you'd know, but is there a way to get the same quality of information via a CLI command?

Re: New Linux vulnerability affecting cgroups: can containers escape?

#65
post #40

Podman and other container tools are now using user namespaces by default. I think it is clear there are some extra precautions needed, but ultimately the goal with running rootless containers is to improve security.

Podman also works fine rootless and with cgroups2, double win.

Does it support docker-compose?

Re: New Linux vulnerability affecting cgroups: can containers escape?

#66

Earlier quoted context omitted.

Is audit2allow the thing you want?

I recall taking a stab at audit2allow a few years ago, and finding that it was incredibly opaque and felt like practising dark arts. At this point, it's probably true that I should get onboard the SELinux train and learn it properly, but it's just... ain't nobody got time for that.

I believe this is considered one of the best videos: https://www.youtube.com/watch?v=_WOKRaM-HI4

Re: New Linux vulnerability affecting cgroups: can containers escape?

#67

Earlier quoted context omitted.

I am not accusing linux of having a real capability system, so nope I'm not confusing them at all. I'm honestly not sure where you got me saying that it does, my tweet is a criticism of linux (or really POSIX) and its lack of true capabilities. Also, I used plan9 as an example for a reason. The kernel is quite hands off about capabilities in general in plan9, and is definitely not the primary source of trust in the s…

OK, I apologize - that was my misunderstanding, and I should have worded it as "I think you're confusing" rather than accusatory. I wouldn't hold it against anyone to do so - the naming collision is unfortunate and has been a source of confusion for as long as it has existed.

Oh yeah it is absolutely confusing, and I think it's done real harm to the concept to have it misused in linux so badly.

Re: New Linux vulnerability affecting cgroups: can containers escape?

#68

Earlier quoted context omitted.

Slightly pedantic: ec2 doesn't actually support nested virtualization on any instance type I know of, but does have baremetal instance types that support virtualization. The reason I mention this is because, sadly, baremetal instance types are only ever the largest size of a given family which is cost prohibitive for most users. And even if cost isn't an issue, they take much much longer to start (like 10-20+ minutes…

You can run https://gvisor.dev/ without any virtualization requirement. We use this to host user-submitted configurations (not arbitrary code, but arbitrary input to ~mostly trusted code). Does this not meet your requirements?

gvisor is awesome and works for particularly untrusted applications, but it's not a performance hit we'd be willing to take across the board and effectively only protects you from security bugs rather than other kernel issues. We run thousands of production database workloads, hundreds of load balancers, thousands web apps, ML jobs, batch processing, etc in kubernetes, most of which require as much performance as possible.

When an EBS volume for a pod goes impaired, if it's using xfs you can basically count the whole server as dead no matter how many xfs + block io timeouts you set. xfs will stop being able to mount/unmount any other filesystems once hung in an unmount call for one. With a proper VM, you'd passthrough the nvme device with pcie passthrough and the host would be totally unimpacted.

Also, gvisor's better mode requires kvm, but it's cool that it effectively functions with ptrace when you can't use kvm.

Re: New Linux vulnerability affecting cgroups: can containers escape?

#69
post #6

Back in the day, people insisted that containers were not security boundaries and should not be treated as such. They're meant to contain things from going off the rails unintentionally, but an actual threat was another story. However, realistically, given the env that a container gives you, it certainly looks and feels like a security boundary. So are we just going to be stuck in this retroactive security cleanup mo…

> Back in the day, people insisted that containers were not security boundaries and should not be treated as such. They're meant to contain things from going off the rails unintentionally, but an actual threat was another story.

> However, realistically, given the env that a container gives you, it certainly looks and feels like a security boundary.

It has to be secure. Browsers are using pretty much the same technologies (seccomp-bpf, cgroups, namespaces, etc) to tightly sandbox Javascript from websites. Browsers run wildly untrusted code from all over the web, and are expected to pass through many forms of malware, not letting them escape the sandbox.

If containers can't be made secure, we have bigger problems.

> So are we just going to be stuck in this retroactive security cleanup mode forever? My point is that if it were designed from the ground up with the hard security boundary in mind, would we have ended up with containers in the first place?

No! Linux and Unix APIs are a mess of patchworks. They are pretty much insecure by default, with rare exceptions.

We could make a new platform with a saner API and make it run on top of Linux, and write new backend services targeting it. I think WASI may just be that. The only problem is that wasm have some overhead / doesn't have access to all CPU features.

Re: New Linux vulnerability affecting cgroups: can containers escape?

#70
post #6

Back in the day, people insisted that containers were not security boundaries and should not be treated as such. They're meant to contain things from going off the rails unintentionally, but an actual threat was another story. However, realistically, given the env that a container gives you, it certainly looks and feels like a security boundary. So are we just going to be stuck in this retroactive security cleanup mo…

GCP allows nested virtualization:

https://cloud.google.com/compute/docs/instances/nested-virtu...

Post reply on HN