224 points · by bpierre · 10y ago · 72 comments
My favorite part of reading the docs for subuser is how completely direct and honest they are about security of various features. E.g., if you enable some features of X bridging, you're accepting security risks, because that's how X works. (And if you don't need those features, don't enable them; it looks like subuser has it down to a one-word config flag, which is amazing.) By comparison, if you start out on your own... there's lots of brief tutorials on the internet about using xephyr, or xpra, or doing something really wildly unsafe like just plain mounting the X sockets in. But not only are all these things rough to get started on by yourself, the brief explanations thrown around are often not clear on the security implications. Subuser seems like a great way to do the right things... out of the box. And with excellent truth in packaging.
I've accumulated a lot of scripts in my personal `~/bin` over the last couple years that do stuff like "mount cwd and interesting dir $x, make sure image with $prog is here or fetch it, now pass args and invoke $prog with $HOME=..." -- and while these have been really useful to me, they've been ad-hoc and almost impossible to usefully share with others. Subuser's format for making valuable configuration like this sharable is extremely interesting.
So, good to see a project look at that aspect. I would quite like to be able to run all my apps which access untrusted services (e.g. all browsers) in a container which I can easily wipe/reset.
I wonder how it compares with zeroinstall or nix
I don't like that.
As this is opensource and I get the source, I will download a full OS image or containerized binaries from third parties. Mmmm so spectacular.
Apps running on chroots? We've that since the 90's, the relaxed security model of Xorg and it's client/server architecture was there already, and it was the reason to left windows 3.11/95 behind.
But marketing campaigns are spectacular in effect in current money surrounded culture. Yes. Their network effect is spectacular. I would say so.
Edited: missing question mark
In the future, I would like to expand on the vision, to include the ability to do deduplication, so that all those zip files with bundled dependencies take up less space. And deduplication done right, will save bandwidth too. Indeed, when you have these "deduplicated zip files", with deduplication done algorithmically, you'll save even MORE space and MORE bandwidth than with a traditional dependency resolving file manager. Take for example debian. Debian uses packages. These packages have dependencies. The dependencies are shared. This saves space over a case where you have a bunch of zip files with unshared dependencies. But when you update a dependency, even if only one line of one file has changed, that dependency must be downloaded completely anew. But with algorithmic de-duplication, updating one line of one file means you only have to download one line of one file anew.
Space savings are there for a similar reason.
I would really recommend you look at nix, zeroinstall, click packages and http://0pointer.net/blog/revisiting-how-we-put-together-linu...
But... Won't it be an ugly kludge?
From what I understood, Subuser does introduce the duplication problem just because of the way it works. It didn't exist with traditional package management when done right (because shared components are packaged separately), and it didn't exist with Docker (because it uses layers). If software (any software) essentially adds some issue and then tries to fight it off, it's very likely that things will be ugly in architectural sense.
> But when you update a dependency, even if only one line of one file has changed, that dependency must be downloaded completely anew
Are you aware about debdelta?
People is calling "containers" to operative system images pulled from third party repositories under certain laws.
If we left all that behind, yes, it's better if your firefox cannot read you ssh private key for example. But I don't need docker for that, sorry.
I need a third party blob, when I don't want to embrace the postgresql source code for free and it's manual, and make myself more free tomorrow.
But the... how many millions was it? dollars campaign behind certain technologies (and providers), has more power than any thinking, regarding network effects.
I can understand.
Money surrounded culture does not exclude those that don't have the money, they are simply part of the game.
This doesn't solve any problem I have currently or I cannot solve using tools I've already tested on my usage, but I hope you had fun writing the software and sharing it.
Will the golden age of a single package manager across distro be finally possible through Docker?
What I would like to have in the future, that Docker does not provide, is deduplication. If I have two images with the same file in both, then I should be able to have that take up no more space than if there was one file in one place. See https://www.youtube.com/watch?v=2Sc6_XgNXyk
docker pull postgres
and get a postgres service which runs in a container.
the commands needed are right there on the docker hub page
https://www.cl.cam.ac.uk/research/security/capsicum/
Docker docker docker docker
Your approach has the problem of needing the inherent insecurities of docker. Because everything within docker has to be managed either by root or someone within the docker group, you have a greater surface area exposed where if an malicious app is able to get hold of the docker socket file, it now owns your system. A capability-based security system, on the other hand, wouldn't be able to touch the docker socket, even if it was run as root.
But context changes and needs have become more sophisticated, particularly needs in isolation, consistency, elasticity. I think that the capabilities of traditional Unix kernel mechanisms, packaging systems, and userland tools, have lagged behind demand.
There's still opportunity for these needs to be met with refinements to standard 'nix mechanisms. I'd contribute to such a project, if it became the explicit design direction of a major distro.
The answer to your question is that it all depends on your definition of "easier".
docker/docker hub hide a lot of complexity in linux namespacing/cgroups/seccomp filtering. You can absolutely achieve the same goal with native linux tools, as long as you have the time and inclination to learn those tools.
http://adamierymenko.com/docker-not-even-a-linker/
If everything (mysql, pgsql, etc.) were a library you could achieve much of what it does with -static and privilege dropping on launch.
Zeroinstall is distribution centered. It allows you to easilly distribute software across distros.
Subuser is like zeroinstall + firejail.
The daemon runs as root, so your containers are only as secure as the daemon itself.
> The daemon runs as root, so your containers are only as secure as the daemon itself.
This is not correct. The daemon only starts and monitors processes in this case. You can start a process as a different user. You can also use user namespaces to make "root in the container" not root on the host.
This did not automatically lead to allow a contained user to breakout, but made it easier.
In 1.10 user namespacing reduces this risk as the root user in a container can be remapped to another user account outside the container.
I understand this is solely for Linux programs?
It seems like it would make sense to combine this with subuser to make sure you keep a known-good version of wine and its configuration. I've known wine compatibility to drift unpleasantly from time to time, or accidentally lost obscure config changes I made once...
(I have fond memories of a time when I could play Supreme Commander on linux in wine... but I've since lost that machine, and I haven't been able to reproduce the dang setup again since :( If subuser had existed back then, I'd probably have a snapshot and I'd be happily playing right now...)
Probably not. Technically, wine was able to run various versions of Photoshop for years. But it was never stable nor complete enough to use it professionally, with wacom tablets and such.
Warning: Being a member of the docker group is equivalent to having root access.
Not a great way to limit privileges.
For a single-user machine, it may be okay. But I don't trust Docker's security very much.
I suppose most of them will be needed in this case, and it's still a concern.
Just did want to remember to people about linux capabilities after read your comment:
man -k cap | grep capabilities