Live data from Hacker News

Docker containers on the desktop

blog.jessfraz.com

11–20 of 76 posts

Re: Docker containers on the desktop

#11
In a recent article on sandboxing in linux [1] it was mentioned that "X11 is impossible to secure". I'm not sure how deep that goes, or whether it's relevant to what's been done here.

Could someone more knowledgeable comment?

[1]: http://blogs.gnome.org/alexl/2015/02/17/first-fully-sandboxe...

Re: Docker containers on the desktop

#13
post #11

In a recent article on sandboxing in linux [1] it was mentioned that "X11 is impossible to secure". I'm not sure how deep that goes, or whether it's relevant to what's been done here. Could someone more knowledgeable comment? [1]: http://blogs.gnome.org/alexl/2015/02/17/first-fully-sandboxe...

Basically, you shouldn't rely on techniques like this to protect you against a malicious app. You can rely on techniques like this as one more step to protect you against stupid mistakes, and to help you keeping configurations etc. isolated and make upgrades easier.

Re: Docker containers on the desktop

#14

This is not sandboxing. Quite the opposite, this gives the apps root access: First of all, X11 is completely unsecure, the "sandboxed" app has full access to every other X11 client. Thus, its very easy to write a simple X app that looks for say a terminal window and injects key events (say using Xtest extension) in it to type whatever it wants. Here is another example that sniffs the key events, including when you un…

lol Alex I didn't give people commands to remove their root filesystem ;) also thanks for the overlayfs patch its amazing

Re: Docker containers on the desktop

#15
post #2

The need for stuff like Docker is an admission that OS privilege isolation and resource management is woefully inadequate.

Isolation is possible in a multi-user system with text-mode apps (ncurses and such), just xorg presents a privilege hole that can't be easily plugged. One way to do it may be to run a separate instance of X inside the container and access it via VNC from the host system.

Re: Docker containers on the desktop

#16
Aside from the security issues with X11 I've never had a good experience from a usability perspective with X11 on OS X. Basic actions like resizing windows need to offer a native-quality experience before mass adoption can happen. Disclaimer: I'm not sure if this was a limitation of the apps or of X11

Re: Docker containers on the desktop

#17

This is not sandboxing. Quite the opposite, this gives the apps root access: First of all, X11 is completely unsecure, the "sandboxed" app has full access to every other X11 client. Thus, its very easy to write a simple X app that looks for say a terminal window and injects key events (say using Xtest extension) in it to type whatever it wants. Here is another example that sniffs the key events, including when you un…

lol Alex I didn't give people commands to remove their root filesystem ;) also thanks for the overlayfs patch its amazing

Not sure what you mean, any user with access to docker can run processes as root, with any part of the host system mounted into the container. Now, that access was not added by you, but its required to be able to run your images.

Once you have the images running the code in them could easily break out of the container via X11, and do things like sniff all keyboard events and inject events into any app.

Of course, the apps you put in the images probably are not doing that. But people need to be aware that this is not a sandbox they can run untrusted code in.

Re: Docker containers on the desktop

#18
post #4

Are Docker containers actually sensibly secure as sandboxes? I thought there were still some gaps that needed to be closed in the underlying tech for it to be as safe as virtualization?

"Docker does not support user namespaces"[1] so root inside a container == root on the host. Getting security right with user namespaces is hard though[2].

And as another commenter pointed out, you can't give a user permission to actually start a docker container without also giving them root access to the host.

[1] https://docs.docker.com/articles/security/ [2] http://lwn.net/Articles/626665/

Re: Docker containers on the desktop

#19

Earlier quoted context omitted.

lol Alex I didn't give people commands to remove their root filesystem ;) also thanks for the overlayfs patch its amazing

Not sure what you mean, any user with access to docker can run processes as root, with any part of the host system mounted into the container. Now, that access was not added by you, but its required to be able to run your images. Once you have the images running the code in them could easily break out of the container via X11, and do things like sniff all keyboard events and inject events into any app. Of course, the…

yes but you are kinda ruining the point, this is a fun hack with Docker, take it or leave it, that's all.

Re: Docker containers on the desktop

#20
post #11

In a recent article on sandboxing in linux [1] it was mentioned that "X11 is impossible to secure". I'm not sure how deep that goes, or whether it's relevant to what's been done here. Could someone more knowledgeable comment? [1]: http://blogs.gnome.org/alexl/2015/02/17/first-fully-sandboxe...

Basically, all the clients that connect to an Xserver has full trust in each other. You can sniff on any event sent to any client, and send fake events (that are not detectable as fake) to any client, as well as read all the contents of any windows. This essentially means any client can do whatever the user can do.

People have tried to make it more secure in various ways (trusted X, selinux X), but it is impossible because so much of the way X does things like DnD, cut-and-paste, window managers, etc that its just not possible to separate clients from each other without the entire thing breaking.

Post reply on HN