Friday, March 2, 2012

UID Nobody and Mandatory Integrity Control

"Those who don't understand UNIX are condemned to reinvent it, poorly." -- Henry Spencer

The concept of nobody originates from Sun Microsystems and their work developing NFS. The uid was intended to represent an unmapped filesystem user with no special access (referred to as uid -2 in the original NFS RFC, but later explicitly named nobody). The plan was to prevent local privileged users from bypassing uid checks on remote shares, but the idea of a general purpose unprivileged user account appealed to many administrators and it's use expanded.

Sun embraced this idea, and Solaris still documents uid nobody as "Assigned to users or software processes that do not need nor should have any special permissions.".

The Solaris administration guide continues,
"The nobody user account is also assigned to software processes that do not need nor should have any special permissions. Some daemons, such as fingerd, run as nobody. If in.tftpd is enabled, it will run as the user nobody."

While motivated by well-meaning administrators, these organic changes were poorly thought out. The problem with this model is that by making these critical processes all the same unprivileged user, that user has ironically become one of the most privileged on the system. This unfortunate result is simply because nobody now has permission to interfere with the most critical processes on the system (via signals, temporary files, ptrace, and so on). The processes intended to be isolated for security, such as software installation and critical system daemons, are now all as vulnerable as the weakest link.

This is bad news. If your mailer daemon, name daemon and http daemon are running as the same uid, then a trivial cgi mistake means an attacker can read everyone's mail - the exact opposite of the isolation and compartmentalization that was intended. A better solution quickly presented itself: assign a unique UID to each daemon you would like to compartmentalize. With this improvement, a compromise of that daemon can no longer interfere with the operation of any other service.

The unique uid solution is used in most modern UNIX-like systems. Your sshd, sendmail, postgres, apache, bind, etc. all get their own user, hopefully compartmentalizing any potential compromise. In my opinion, this system is quite elegant.

Mandatory Integrity Control (Integrity Levels and UIPI) in Windows.

It occurs to me that Integrity Levels and UIPI are very similar to these antiquated (discredited?) privilege separation ideas from UNIX. Their growing use among important software (office software, web browsers, etc) is making "Low" integrity level a pretty exciting place to execute code, similar to the old concept of uid nobody.

Malware enthusiasts appear happy that we can prevent persistence across reboots for low integrity processes, which indeed is quite difficult if implemented correctly. However, it only takes one vendor using Integrity Levels incorrectly to break this assumption. Ironically, the first vendor I noticed defeating this property was Sun, the inventor of uid nobody. Their crime is storing Java patch executables in directories writable by Low processes, but I'm sure they won't be the only offender.

Still, I'm not sure I understand the "persistence" obsession. Nobody also had this property of being unable to persist across reboot, but it turns out attackers are quite happy to have ephemeral access to all your data. Frankly, if an attacker had access to all of my data, but I'm told not to worry because he can't persist across a reboot, this would be little consolation.

In conclusion, I'm not a fan of the design of MIC in modern Windows systems, I think a modern-UNIX-like solution, rather than an antiquated-UNIX-like-solution would be preferable.

I like the design of the Chrome sandbox in this regard, which effectively emulates these nice properties. I'm specifically talking about the Windows sandbox, I'm not such a big fan of the Linux or Mac sandboxes, although they do have some redeeming features lacking in Windows. The primary redeeming feature of the Linux sandbox is that it effectively reduces the kernel attack surface exposed to compromised renderers, but at the expense of a very inelegant design.

The good news is that my awesome friend Will Drewry is working on fixing that.


Unknown said...

I guess the thought behind appcontainer is to avoid this problem you point out. Each appcontainer has its own security identity.

Priya Anand said...

Really nice post. Unix is a multiuser and multi tasking operating system at the same time. Unix Training in Chennai offering real time Unix course at reasonable cost.

Arun Devi said...

Really tolerable post.i will be learning about for lot of information..

Informatica Training in Chennai

jackpeppin said...

Windows characterizes four respectability levels: low, medium, high, and framework. Standard clients get medium, hoisted clients get high. Forms you begin and objects you make get your respectability level or low if the executable record's level is low; framework administrations get framework uprightness. selenium Training in Bangalore |
Oracle Training in Bangalore

venkatweetz said...

Very Nice Blog I like the way you explained these things. I’ve been looking for ways to improve my website and overall rankings.I hope your future article will help me further.Take SEO Training in Chennai to mould yourself.

SKARtec Academy said...

Very Nice Blog I like the way you explained these things. I’ve been looking for ways to improve my website and overall rankings.I hope your future article will help me further.Take Digital Marketing Course in Chennai to mould yourself.

Richard Majece said...

Talking about inspiration, I want to give you one advice. Kids are often bored when they do their home work. I've noticed it few years ago. Do you want to change it? will do it for you)

marshal singh said...

I am learn this site to be a great change your password in windows 10 version for the windows 10 site.

Manish Upreti said...

Nice Blog.
If anyone who wants java training in Noida, so i suggest you please join KVCH Java classes.
Best Java Training Course in Noida

Advance Java Certification Training in Noida

Henrik Fosse said...
This comment has been removed by the author.
Henrik Fosse said...
This comment has been removed by the author.
Henrik Fosse said...

Nice blog! looking forward to more posting. If you need advokater or maybe boligalarm you can look at these pages.

suvathi said...

I admire this article for the well-researched content and excellent wording about windows . I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
MS Office Training in chennai

Julie T. Kirwan said...

green farm 3 mod apk bully anniversary edition mod apk mx player pro apk

nilla said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

Selenium with python Training in Electronic City

gowthunan said...

I’ve bookmarked your site, and I’m adding your RSS feeds to my Google account.
safety course in chennai

sathyaramesh said...

I like your article very much. It has many useful ideas and suggestions. I thinks it will be more helpful for my research in an efficient manner. Please try to post some more topics as well as possible.
DevOps Training in Chennai
DevOps certification Chennai
DevOps course in Chennai
Best devOps Training in Chennai
AWS Training in Chennai
R Programming Training in Chennai