TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Raru: Run as random user

65 pointsby subbzover 9 years ago

11 comments

jbangertover 9 years ago
Clever idea, however keep in mind that you are trusting both your file system permissions to be sane and your kernel to enforce them correctly (I.e. Not have bugs). a lot of projects have tried to do this (i.e. SeLINUx, trusted bsd) and it turns out to be surprisingly hard to build isolation policies that are useable and practical. I think one very cool solution recently has been qubes-- it runs each application in its own, temporary VM and provides secure UI magic for file opening, clipboard, etc
评论 #10914064 未加载
评论 #10914875 未加载
评论 #10913937 未加载
aexaeyover 9 years ago
Reusing unix user ids as application ids is an excellent idea, and it has worked reasonably well in android so far. Good to see this being applied to X/desktop.
danielvfover 9 years ago
This is clever. It&#x27;s not running code as a random user on your system, but rather as a random non existent user id.<p>This has the effect of denying lots of privileges to whatever is being software is being run.
nickodellover 9 years ago
I liked this idea so much that I made an improvement: Instead of running a user-specified command, it runs a randomly chosen command as a randomly chosen[0] user!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nickodell&#x2F;rarucmd&#x2F;tree&#x2F;master" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nickodell&#x2F;rarucmd&#x2F;tree&#x2F;master</a><p>(Don&#x27;t run this on a system you care about.)<p>[0] Randomness may vary.
评论 #10914578 未加载
dcrawover 9 years ago
Alternatively: rudo?
评论 #10914579 未加载
评论 #10914244 未加载
thmsover 9 years ago
From looking around an Android device via ssh a long time ago (still in the &quot;wow, linux on my phone&quot; phase), I remember that all apps that are installed also have their own user installed. Access to various resources was then done via the groups that user is in. But of course then there is no real &quot;main&quot; user and multi-user wise it is back to Win95 level. I assume that has not changed much.<p>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.<p>This of course requires root access, automatic &#x2F;home&#x2F;me&#x2F;home2 (or &#x2F;home&#x2F;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.<p>But what I <i>still miss</i> (and never really looked at) is an ACL or so system to make the game or webuser completely transparent&#x2F;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.
philsnowover 9 years ago
Check out Http:&#x2F;&#x2F;ccl.cse.nd.edu&#x2F;research&#x2F;subid&#x2F; Ctrl+f for sub-identities<p>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 &quot;parent&quot; idebtities behave as &quot;effectively root&quot; to their child identities.
lindxover 9 years ago
Will this work on OSX? I have been looking for a lightweight way to sandbox apps on OSX.
评论 #10914083 未加载
eridiusover 9 years ago
Won&#x27;t this cause any files&#x2F;folders created by the process to be owned by said random uid? Seems like a great way to litter your filesystem with unreadable files&#x2F;folders.
评论 #10914505 未加载
pcwaltonover 9 years ago
Doesn&#x27;t the Chromium sandbox already effectively do this without the suid bit by using CLONE_NEWUSER to enable use of setuid and then calling it?
评论 #10914074 未加载
评论 #10914072 未加载
amlutoover 9 years ago
How does it decide which files are permitted to be accessed by the app?
评论 #10913946 未加载