Ask HN: Best Linux sandbox?
After the recent Firefox incident I realized how I lied to myself by believing that I'm secure just by using Linux.
My setup is Ubuntu 14.04 LTS (job requirement) with XFCE. So here's my question:
What is the best Linux sandbox available right now?
Even better if it's something simple to use and battle tested. Main things I would like to sandbox is Firefox, Thunderbird, Wine, Torrent stuff and maybe Chrome (is it necessary? my chrome://sandbox shows YES to everything except "SUID Sandbox")
46 comments
[ 2.5 ms ] story [ 107 ms ] threadHere's an apparmor profile I made to lock down the Skype linux client: https://gist.github.com/AgentME/5640268 . It works as a whitelist listing out exactly what Skype can access. I've got another profile for Steam (and all games that Steam starts up) which just blacklists a few directories (and lets me know if Steam or any games ever tries to access those).
https://news.ycombinator.com/item?id=8652228
Nevermind: https://news.ycombinator.com/item?id=10021376
Also if they gained full control of that environment they could destroy everything without affecting my entire/real system.
Are you using firejail?
http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-d...
https://blog.jessfraz.com/post/docker-containers-on-the-desk...
From what I heard you can escape docker anyway so I would need something like SubUser (suggested by amouat)
Mbox: https://news.ycombinator.com/item?id=7214419
Firejail: https://news.ycombinator.com/item?id=8187534
I imagine you're suggesting something like X over SSH, right? Do you use something similar on a daily basis? I would probably commit sudoku if I had to use the entire VM (not headless).
Even VNC clients sharing clipboard content with the host system poses an attack vector, for example.
Of course this does not mean doing all of the browsing within the same vm, multiple vms for different things (banking, development, internet radio with flash, ...) after all RAM at least on the desktop is still fairly cheaply available, and on laptops one can still run a few browsing vms in 16gb if the need arises.
The sandbox command mitigates that by showing the browser an empty home directory, so that each time you launch it it will create a new profile with no such data in it. Note that a long-running sandboxed Firefox could still have a decent amount of history to expose. Best to start a new one for each site you visit, if you can stomach it.
Security always involves tradeoffs.
In Ubuntu the closest thing to it, I think, is AppArmor, but I've never tried it myself. Or you could run a virtual machine with Fedora and use SELinux there.
[1] http://danwalsh.livejournal.com/31146.html
[2] http://www.bress.net/blog/archives/195-Firefox-in-a-sandbox-...
Docker, LXC, Nspawn and other container oriented managers are more focused on running chroots in namespaces so you would need to install the app in the container. In a way a container, especially an unprivileged one is perhaps a bit 'cleaner' as the app is installed in its own chrooted OS and not on the host.
The only thing is running GUI apps in containers is involved in terms of configuration, so Firejail wins for simplicity. Firejail also supports chroots so you can run proper containers with it.
We have a writeup on running accelerated GUI apps in containers here - https://www.flockport.com/run-gui-apps-in-lxc-containers/
I do have to agree with OP on the statement:
>> After the recent Firefox incident I realized how I lied to myself by believing that I'm secure just by using Linux.
Linux was promoted (partly) on the premise that is was more "secure" than Win, due to being open source. All the attacks since 2011/2012 (at such a large scale) seem to indicate that it isn't as secure as we think.
https://github.com/google/nsjail
Grsec + PaX + gcc plugins will provide maximum security you can get on Linux. That is the holy grail.
If you want one more extra security try to run it on a sparc machine. That combination will make it really hard for an attacker (not impossible :-)).
Oh and try to run as little software as possible.
http://theinvisiblethings.blogspot.com/2011/04/linux-securit...