Live data from Hacker News

Docker containers on the desktop

blog.jessfraz.com

71–76 of 76 posts

Re: Docker containers on the desktop

#71
post #32
post #13

Earlier quoted context omitted.

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.

I would say it doesn't even do that, given that you're having to give root-level access to an unprivileged user to do it.

This conflates two different things. You effectively get root-level access if you are allowed to execute Docker, that is true. But things running in Docker does not have to be given root-level access - you can just as well run things inside Docker as a regular user.

I'm not an unprivileged user on any machine I operate in any practical sense, nor are most Linux desktop users, so to me that point is largely moot. That is, even if I'm technically not root most of the time, if I run a malicious app it can relatively easily set up plenty of traps in my home directory to get me to run whatever code it want with elevated privileges sooner or later anyway. So from the outside, having the ability to run Docker does not expose me much more - get my user account, and chances are you get root if you're not completely inept.

That doesn't mean it wouldn't be good to get a better/more fine grained privilege model for Docker for other use cases.

Inside Docker containers, nothing stops us from having everything run as a regular user, though admittedly many Docker containers errs and runs everything as root often for no good reason (especially given that Docker's port forwarding/mapping means a lot of daemons that otherwise at least wants to start as root - even if it could be avoided - have even less reason to be started as root)

But even running as root, assuming an app that isn't malicious, barring me stupidly mounting "/" to a volume in the container, it won't e.g. do things like accidentally deleting [major system directory] (as some app did a while back), even if the app in the container is running as root (which is largely unnecessary, though admittedly done too often, in Docker containers).

It also won't barf files all over my filesystem for no good reason. And I won't accidentally expose ports I don't want to expose. Amongst many other things

Re: Docker containers on the desktop

#72
post #56

Earlier quoted context omitted.

AFAIK, breaking out of a Docker container isn't as trivial as the first part of your comment suggests. In particular, a Docker container can't run other Docker commands unless you grant it access with something like "docker run -v /var/run/docker.sock:/var/run/docker.sock". Of course, there have been other vulnerabilities in the past allowing containers to get root. And the X11 weakness alone is enough to not treat t…

If you break the app you have +- the same access.. see if you break irssi you're not root either. This stuff is only sort-of reliable when-containers-dont-have-root-bug-today if you run that as a separate user than yourself in a different X server So basically not cool. The way GNOME is doing ACTUAL sandboxing is much neater. Turns out it doesn't use Docker also. Go figure /sarcasm.

Gnome sandboxing uses exactly the same technologies behind the scenes as Docker uses: cgroups, namespaces, ... They add the additional requirement that they need Wayland to circumvent the security issues that X11 presents them. Other than that, you could do it just the same way.

So your "when-containers-dont-have-root-bug-today" applies to Gnome too...

Also: there is no such thing as 'actual' sandboxing. There are many forms of sandboxing, containers (not docker-exclusive, as Gnome is using it exactly the same way) is one form, but we also know Virtual Machines, the Java VM, Javascript in a browser, ... the list goes on - all meaning the same thing: shield an application from everything else on the computer and try to prevent it from breaking out.

Re: Docker containers on the desktop

#73

Earlier quoted context omitted.

The commands I give are fine. The one Alex gives in his comment mounts root into a container, something I am not saying at all or even close doing at all. No one should ever mount root in a container, its common sense.

You didn't give the root command. But the app can easily send keyboard input events to your terminal window injecting that command.

That's not a Docker issue, that's an X11 issue. Unless you're using Wayland, you don't have much choice here.

Re: Docker containers on the desktop

#74
post #71
post #32

Earlier quoted context omitted.

I would say it doesn't even do that, given that you're having to give root-level access to an unprivileged user to do it.

This conflates two different things. You effectively get root-level access if you are allowed to execute Docker, that is true. But things running in Docker does not have to be given root-level access - you can just as well run things inside Docker as a regular user. I'm not an unprivileged user on any machine I operate in any practical sense, nor are most Linux desktop users, so to me that point is largely moot. That…

> I'm not an unprivileged user on any machine I operate in any practical sense, nor are most Linux desktop users, so to me that point is largely moot. That is, even if I'm technically not root most of the time, if I run a malicious app it can relatively easily set up plenty of traps in my home directory to get me to run whatever code it want with elevated privileges sooner or later anyway.

I don't know how to say this in a way that isn't snarky, but: be better about your operational security, then. I run all of my Unix machines with the exception of the Mac I don't care about with a user not in /etc/sudoers. That you're tripping yourself up is your own fault.

That doesn't excuse this sort of recklessness being advocated by a Docker employee.

Re: Docker containers on the desktop

#75
post #44

I hate that the isolation of containers gets oversold as a security feature because there is real value in what you might call "configuration isolation". Often, I am reluctant to run something not because of a trust issue but a complexity issue. I run a heavily customized environment. I will often be burned by an application---for example---creating a symlink that under "normal" circumstances is perfectly copacetic b…

ha! Though what's more common? Evil or stupid?

I'd say evil, people don't automate stupid.

Re: Docker containers on the desktop

#76

Earlier quoted context omitted.

You didn't give the root command. But the app can easily send keyboard input events to your terminal window injecting that command.

That's not a Docker issue, that's an X11 issue. Unless you're using Wayland, you don't have much choice here.

You have lots of choices. Try making another X server with Xephyr and connecting to that, for example.
Post reply on HN