Raru: Run as random user
github.com
github.com
Qubes looks really interesting. I'd love to give it a try some time. I've just grown rather attached to my FreeBSD setup and this seemed like one of the ways I might be able to improve security on it.
Everything has bugs once you look hard enough. But this would still require more work to bypass than some random "malwaretisement" is likely to put in.
This has the effect of denying lots of privileges to whatever is being software is being run.
https://github.com/nickodell/rarucmd/tree/master
(Don't run this on a system you care about.)
[0] Randomness may vary.
Reminds me of that game that would delete your files if you couldn't shoot things fast enough.
And back when the first commercial games for linux came out, I did not want to trust binary-only executables and added a user plus a script so I could run anything via passwordless sudo and then did and still do the same for my web-browsing. Since these have their own ~, the data is persistent, but for something you totally do not trust raru looks nice.
This of course requires root access, automatic /home/me/home2 (or /home/me_home2) generation with optional persistence and isolation might be a next step. But I have no idea what the current state of more fine-grained control via cgroups etc. is. It is probably more complex than the true and trusted method of just adding another user.
But what I still miss (and never really looked at) is an ACL or so system to make the game or webuser completely transparent/subordinate to my main user, meaning I can read, write and take ownership of any files of these sub-users but they have to obey standard permissions wrt. my files.
Disclaimer: roughly what this project does was the topic of my (somewhat silly) masters thesis. I even did roughly the same x11 nesting, and I took it a little farther and made a kernel module that lets "parent" idebtities behave as "effectively root" to their child identities.
I'm not sure about xraru working or not. If vncviewer runs on OS X, maybe? It might actually be a convenient way to run X programs in general.
Although if I add in any logic for auto-scaling, it'll likely break on OS X. But it'd be even more important because of the crazy retina resolutions.
xhyve, by the way, is an awesome hypervisor for OS X. It's pretty light. Not raru-light, but as light as you can get for proper hardware virtualization.
My concern is that you can clearly browse and save files, so there is something that has access. Maybe it's much more secure than I thought, but I tend to be really skeptical towards programs of such length being perfectly secure.
I believe the Chromium sandbox mostly applies to things like renderers, where you can just hand it a buffer and a bunch of inputs and it'll effectively contain things like HTML parser bugs or libpng buffer overflows. I'm not totally sure if browsing itself is sandboxed.
The original implementation of CLONE_NEWUSER did actually convert users to vectors, or at least namespace-user tuples, which would have allowed unprivileged users to use the kernel UID mechanism for actual privilege separation. But that was dropped, I believe mostly because it was too much churn to the rest of the kernel and thus too risky. The current approach means that code that just thinks about root-namespace users continues to do the right thing.
The primary thing Chromium's sandbox seems to gets out of CLONE_NEWUSER is the ability to call chroot without shipping a setuid binary.
I stand (embarrassingly) corrected.