Welcome to MSDN Blogs Sign in | Join | Help

Running restricted -- What does the "protect my computer" option mean?

If you’ve been reading my “non-admin” posts, by now I assume you have seen the Windows XP “Run As” dialog.  (If you haven’t, please read this post first:  "RunAs" basic (and intermediate) topics.)

 

The initial settings when the “Run As” dialog opens are to run the program as the current user, with an option selected to “Protect my computer and data from unauthorized program activity”.  It further states that “This option can prevent computer viruses from harming your computer or personal data, but selecting it might cause the program to function improperly.”  What does that mean?  How do you decide whether to use it?  As far as I know, there hasn’t been any accurate public documentation about the “protect my computer” option, let alone any guidance as to when it might or might not work for any particular application.

 

The net effects

 

The bottom line is that the app runs with a “restricted token” that basically has these net effects:

  • Group membership:  If you were logged in as a member of Administrators, Power Users, or certain powerful domain groups, the app runs without the benefit of those group memberships.
  • Registry:  The app has read-only access to the registry, including HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE.  The app has no access to HKCU\Software\Policies.
  • File system (assuming NTFS):  The app cannot access the user’s profile directory at all.  That includes “My Documents”, “Temporary Internet Files”, “Cookies”, etc.
  • Privileges:  The app has no system-wide privileges other than “Bypass traverse checking”.

 

These are very powerful restrictions, particularly those around the registry and profile folders.  It’s probably a safe bet that most apps do not expect “access denied” errors when writing to HKCU or the user’s temp or MyDocs folders, and probably do not handle such errors gracefully.  When I tried to use Outlook Express with “protect my computer”, it failed to start up at all.  This isn’t entirely surprising – all its data is in the user’s profile folder hierarchy.

 

The only thing I ever really use with “protect my computer” is Internet Explorer when I want to really constrain a particular site and not allow it to write to my hard drive at all.  (Note that this is only an additional element of defense in depth, not an entire defense.)  IE works fairly well this way, but with some odd and annoying problems:

  • You can’t use SSL (https) at all.
  • If you right-click on a hyperlink and choose “Open in New Window”, nothing happens.
  • If you enter a URL in the address bar without “http://” in front of it (e.g., “www.msn.com”), you get an error message like “C:\Documents and Settings\aaronmar\Desktop is not accessible.  Access is denied.”, before IE goes ahead and loads the site anyway.
  • On XP SP2 and on Server 2003, toolbars do not appear where you configured them, if they appear at all.  E.g., PrivBar always needs to be re-enabled; “Links” appears (on my machine) in the upper left, to the left of the menu bar.  (This wasn’t a problem with XP SP1.)

 

That’s about all the “guidance” I’ve got as far as what to expect if you use the “protect my computer” option.  If anyone really cares, I could write a lot more about the geeky details around restricted tokens, deny-only SIDs, how access checks are performed against restricted tokens, which groups get marked deny-only with “protect my computer”, etc.  But maybe Larry Osterman will save me the trouble and follow up on some of his recent security posts (e.g., What is this thing called, SID?)

Published Friday, September 10, 2004 12:05 AM by Aaron Margosis

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Running restricted -- What does the "protect my computer" option mean?

Friday, September 10, 2004 1:19 AM by Larry Osterman
Ok, I'll see if I can get some of them written for next week.

# re: Running restricted -- What does the "protect my computer" option mean?

Saturday, September 11, 2004 1:34 PM by KJK::Hyperion
Hi Aaron, I think you may be interested in this...
I've written a sandboxing tool that, IMHO, manages to be at the same time powerful (certainly, much more configurable than Run As) and intuitive. I've called it I Am, it's a non-interactive command-line application and it's open source (MIT license). It's pretty hard to use as it requires a fairly strong technical background, but it currently lacks any documentation (apart from an article about it - in Italian - I wrote for an e-zine). But you sound very informed on the topic and should be able to figure it out easily (try "iam -help").
It also emulates the "Run As" sandbox as closely as possible (iam -wincompat) - but I haven't tested either in a domain, so expect problems (bug reports are welcome! just google for my nickname to know my e-mail address) - the only relevant difference being the requirement of a group without members called "IAM", which the command uses in addition to the standard sandbox SID (S-1-5-12, "RESTRICTIONS"), because the latter can't be specified in the ACL editor (a real pity, since, as you noted, the "Run As" sandbox has the effect of making the user profile directories inaccessible, and not being able to specify that group in ACLs makes this limitation unescapable).
It lacks polish (for example, sandboxed programs inherit the TMP and TEMP variables, which will generally point to an unwritable directory, so you have to redirect them by yourself) and real-world testing, but it works great - from a purely technical standpoint, much better than "Run As" in fact. The only pity is it's a bit too easy to forget running programs in a sandbox, but I'm looking into a suite of shell extensions for that
The URL is http://spacebunny.xepher.net/hack/iam/ and the filenames should be pretty intuitive. Let me know what do you think about it, I value your opinion!

# re: Running restricted -- What does the "protect my computer" option mean?

Monday, September 13, 2004 1:51 PM by David Candy
cacls can give restricted full control over a file object.


cacls apppath /e /g restricted:f

processed dir: C:\Documents and Settings\David Candy\Desktop\AppPath

And the GUI permissions now list restricted as full control (or read only or whatever you tell it to do).

Remember to use quotes if anything contains a space.

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, September 15, 2004 4:40 PM by Sean McLeod
Would be useful to have all attachments that are launched from email run using this "restricted token".

Currently as of XP SP2 there is an IAttachmentExecute interface to be used by email programs etc. when they want to save and/or execute an attachment. IAttachmentExecute::Execute() may run a virus scan on the attachment before executing the attachment etc.

If it also allowed you to execute the attachment using this "restricted token" then an email attachment virus would have a more difficult time since the registry would be read-only, large parts of the filesystem would be off-limits or read-only etc.

Is there an easy way to set up a SID/ACL to prevent a process from getting any network access? Would help prevent certain virus's from spreading if you could easily add this restriction to untrusted code.

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, September 15, 2004 10:44 PM by Aaron Margosis
Sean, yes, it would seem useful, but since a lot (most?) apps just completely break when run with the "protect my computer" option, it would probably be pretty much unusable. E.g., let's say it's a Word doc. First, Word wouldn't be able to read a copy of the doc cached in your %Temp% folder, since it wouldn't have access. Likewise, Word wouldn't be able to save it (as-is or edited) to your "My Documents" folder. Word wouldn't have access to your user-specific normal.dot or other config info stored in the file system in your profile. And on and on.

AFAIK, there is no ACL that prevents an app from creating a TCP/IP network connection.

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, September 16, 2004 1:39 AM by Aaron Margosis
BUT - that reminds me of something else I meant to mention. A "protect my computer" restricted token cannot authenticate on the network using your Windows identity. So while you can still connect to remote resources that allow anonymous connections, the restricted app cannot act "as you" on the network.

# re: Running restricted -- What does the "protect my computer" option mean?

Monday, September 20, 2004 3:46 AM by Ayman AlRashed
IMO, while an ambitious option, it's still not usable in it's current form due to app compat issues.

# re: Running restricted -- What does the "protect my computer" option mean?

Monday, September 20, 2004 7:35 AM by Sean McLeod
Network wise I was thinking more of worms that propogate by searching the network for vulnerable hosts and/or email themselves out. If you could limit the process to having no network access then the worm wouldn't be able to propogate itself in this fashion.

While XP SP2 has some network changes to limit the rate of outbound connections when it detects lots of incomplete network connections it doesn't completely prevent the propogation, rather just slows the rate.

What sorts of apps/code did MS have in mind in terms of running under this restricted token?

As mentioned if there are too many compatability issues then it won't be able to be used for running 'suspect' code in such a way that it is not able to do any damage but at the same time is able to do enough to be useful, especially for non dangerous code.

The other option I thought of was to have suspect code/attachments run in a virtual machine session, e.g. using some lightweight flavour of VirtualPC. In this environment the app would get a snapshot of the current host environment and have read and write access to all the necessary files. But network access would be blocked so suspect code couldn't read your data and forward it out via the network.

Any writes in the this virtual environment would be visible to the app running in the VM but wouldn't make it through to the host's file system and would be discarded when the app exited.

When the app exited the VM would also pop-up a report listing any portions of the registry and file system that were written to and any attempted network access as a way for users (although probably only for advanced users, there would also be heuristics used to determine a suggested pass/fail for regular users) to determine whether the screen saver attachment that some mate had sent is really just a regular screen saver or whether it's really a virus/worm.

The heavyweight implementation would be to use a full virtual machine in which to run the suspect code. A more lighter weight approach may be possble using some combination of a restricted token, network filter to block network access and a file system filter driver interacting with the volume snapshot service to provide a temporary writable volume for the suspect code that then gets discarded when the process quits.



# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, September 30, 2004 3:30 PM by Puri
Hi,
I couldn't agree more about running with Limited/Restricted user account. Thats how I always run at home. I don't run a virus checker on my PC. But at work, I found that it doesn't work. The problem is most corporate ITs run Sematic AntiVirus as part of login startup tasks. I think they have something in the domain startup script that checks whether anti virus dat files are up-to-date or not. It failed to run with limited user account. So they forced me to add admin privileges to my login.

But ur blogs are full of information. Good to hear from an MS guy.

puri

# Running Windows as limited user

Thursday, January 20, 2005 7:31 PM by Dot Wind
A very interesting serie of postings over at Aaron Margosis' WebLog showing the advantages of running as a limited user. A special interesting entry is the "Protect my computer" option, and the priviliges toolbar....

# Table of contents, Aaron Margosis' non-admin blog

Monday, April 18, 2005 8:22 PM by Aaron Margosis' WebLog
Complete list of Aaron Margosis' non-admin / least privilege posts, for easy lookup.

# Spread the LUA joy

Friday, June 10, 2005 12:12 PM by tonyso
Get your friends and family, all those folks that come to you for computer help once their machines have...

# Run as and Protect My Computer

Monday, June 27, 2005 11:49 PM by Dan Crevier's Blog
Today I got a bug report that the app I'm working on doesn't work with work when launched with Run As......

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, May 31, 2006 9:00 PM by James Gerber
I tried this with IE and Firefox and neither launched at all (XP Home).

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, May 31, 2006 9:07 PM by Aaron Margosis
James Gerber:  If IE didn't launch, my guess is that you have an IE add-in installed that failed with the restricted token and caused the process to exit.  No idea about Firefox.

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, June 01, 2006 2:02 PM by Doug Woodall
Sadly, I thought I would ask all my coworkers if they knew how to do this.
Guess the outcome.
I wish I wish I could educate with a lasting effect. It seems people just dont care until they lose their Identity or are scammed out of money. Then they come around. Too late.
Great Post !

Take care,

# Windows Tips: Run Suspicious Programs Safely

Friday, June 02, 2006 4:18 PM by The SpywareBiz Blog,,,to Combat Spyware!

# re: Running restricted -- What does the "protect my computer" option mean?

Tuesday, June 06, 2006 4:13 PM by Ajay
Seems like the "Protect My Computer" option should be implemented as a virtual machine that isolates any changes the application makes and can discard them on exit. Microsoft already has the Virtual PC product/technology and the App Compatibility Toolkit so it might be able to integrate limited versions of these into Windows.  I got Virtual PC initially to test my software on a clean install of various Windows configurations and I also thought it would be good to try out other people's software and keep it isolated from my "real" installation.

# Windows Tips: Run Suspicious Programs Safely

Wednesday, June 07, 2006 6:40 PM by The SpywareBiz Blog,,,to Combat Spyware!

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, August 10, 2006 8:36 AM by Russell Tucker

When the IE icon on my computer is right clicked, I do not see a "Run as" option at all. Is there some other way to get to this option?

Thanks,

Russ

It's not on the context menu if you click on the IE icon at the top of the Start menu, but it is if you right-click on an IE icon somewhere else, such as in the Quick Launch area, on the desktop, or in the All Programs part of the Start menu.

HTH

-- Aaron

# re: Running restricted -- What does the "protect my computer" option mean?

Saturday, August 12, 2006 10:15 AM by Russell Tucker
Thanks, Aaron. Found it!

And thanks for pointing this out to us. Such is becoming more important each day.

Regards,

Russ Tucker

# re: Running restricted -- How to restrict the user in timely manner

Saturday, August 12, 2006 5:42 PM by Nash Sapardi
Hi Aaron,
Need to know how to restrict the user to use the system after 12.00 midnight? Or the system force the user to logout after 12 midnight

Best regards/

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, August 23, 2006 5:17 AM by Fox Purtill

Help!  Somehow my machine ended up running the ENTIRE OS in restricted.  I can right-click anything and uncheck the 'Protect my computer and data..." etc and it opens, but how do I GET RID of that?  I want to just be able to run my programs.  I am the administrator of the machine and the only user.  I have no clue why this suddenly started happening.  

At the moment if I double-click any application it the icon is busy for a second and no application starts. If I right-click (run as..) and remove the checkbox it starts.  This was NOT the case yesterday.

I can only guess, but my guess would be that some kind of registry modification was made that shouldn't have been made -- possibly by malware, possibly just by accident.  IIRC the Windows Setup disks will help you repair an existing Windows installation - you might try doing that.

-- Aaron

# re: Running restricted -- What does the "protect my computer" option mean?

Monday, August 28, 2006 6:43 PM by Nick Heim

Hi Aaron,
is there a way to unset or set the option “Protect my computer ..." programmatically in the linkfile?
I would like to do this with a MSI custom action DLL i already use to set the option in a link, which let it pop up the "Run as" dialog.
Thanks a lot for the very good info on your blog.
Regards, Nick

Look for SDLF_RUNAS_USER on this page and this page.  Note that setting the flag will only cause the "Run As..." dialog to appear -- it still requires user interaction to make the target program run restricted.

HTH

-- Aaron

# re: Running restricted -- What does the "protect my computer" option mean?

Tuesday, October 10, 2006 5:38 PM by john

this guy   sent software to my computer--and he got every name and dialogue from yahoo that i had used in months--how can i prevent this from happening again

# re: Running restricted -- What does the "protect my computer" option mean?

Friday, October 13, 2006 7:59 PM by Dave

You might want to look at http://windowzones.com, which is currently in beta.

It allows you to lock applications down into a "safe zone" which is like a sandbox, but with much better app compat than restricted tokens (doesn't have all of the problems noted for IE, for example).

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, December 07, 2006 2:22 PM by Paul Whitcomb

In Windows 2000, I am attempting to disable the function performed by "protect my computer and data" in Windows XP. Is this possible?

I don't quite understand -- are you trying to disable the UI (dialog) that exposes "protect my computer"?

-- Aaron

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, January 10, 2007 10:54 AM by Gretchen

I am trying to run a program for my business and it won't run.  When I right click on the icon, and go to the run as option, there is a check mark next to the box that says clicking the box might cause the program to not function.  I think this is the problem, but everytime I take the check off, it automatically re-checks it.  How do I keep it from running automatically?

Gretchen - when you right-click and choose "Run As...", the default selection is to run the program with the greatly reduced rights described in this post.  Most apps don't work correctly with that setting.  If you just start the program normally, you shouldn't see that dialog, and the program should run with the same privileges that all your other programs do.

Has this program worked correctly in the past for you?

Are you logged on as a member of the Administrators group, or as a regular User?

-- Aaron

# re: Running restricted -- What does the "protect my computer" option mean?

Wednesday, March 28, 2007 9:29 AM by Tim Cooper

I'm also getting this same problem on a user's XP SP2 machine:

Help!  Somehow my machine ended up running the ENTIRE OS in restricted.  I can right-click anything and uncheck the 'Protect my computer and data..." etc and it opens, but how do I GET RID of that?  I want to just be able to run my programs.  I am the administrator of the machine and the only user.  I have no clue why this suddenly started happening.  

At the moment if I double-click any application it the icon is busy for a second and no application starts. If I right-click (run as..) and remove the checkbox it starts.  This was NOT the case yesterday.

# on my computer, what does msi mean? Thank you!

Friday, March 30, 2007 1:58 PM by Katy

30 March 2007

I have a brand new Mac notebook.  What does msi

mean?  Thank you!

Katy:  It probably doesn't mean the same thing on a Mac as it does on a Windows computer.  On Windows it is a Microsoft Windows Installer package.  No idea what it is on a Mac.

-- Aaron

# What does the "protect my computer" option mean?

Monday, April 23, 2007 4:51 AM by SSQA- Users & SQL tools

Very interesting insight of security topics on Windows operating system by Aaron Margosis.

# re: Running restricted -- What does the "protect my computer" option mean?

Monday, July 23, 2007 1:13 PM by Peter

So far, several people have asked how to turn off the restricted user option. So far there has been no answer to that question. People have replied to the posts but have not provided the answer. So, how do you turn off the option? Yes, I know it is more risky...yes, I know that it has been added by microsoft to make my computing experience more pleasant. The thing is, I just want to be able to click on an icon and have the program run. Simple eh?

So, how do you turn off the run restricted option?

[Aaron Margosis] What you're seeing is most likely due to corrupted registry settings.  It's certainly not due to anything the Windows developers intentionally designed.  I don't know which specific registry settings might be involved, so I don't have an answer to the question.

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, August 02, 2007 1:31 AM by Ahitub

HI KJK::Hyperion

The link you have mentioned not work properly ...whats the prob with ...

Thanks

________________

Ahitub

http://computersnext.com

# re: Running restricted -- What does the "protect my computer" option mean?

Friday, September 28, 2007 7:52 PM by James

So, how do you turn off the run restricted option?

# re: Running restricted -- What does the "protect my computer" option mean?

Tuesday, November 06, 2007 6:31 AM by mani

pls.. help me out...

m also getting this same problem on a user's XP SP2 machine

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, November 15, 2007 5:21 PM by Armando

I am another simple user that wants to double click an icon and get the program start. The only way I can do this is to "run as" and uncheck the protection.  Can this protection remain unchecked? This is a VERY unconfortable situation.

# re: Running restricted -- What does the "protect my computer" option mean?

Thursday, January 17, 2008 6:04 AM by Ditto to the two previous entries.

I think its MS trying to strong arm individuals into purchasing VISTA. Ugh. It seems to be progressive. Phase one OS in phase one out. How else will they continue their empire. Gone are the days you purchase it you own it. Security update!! Security updates!! Security updates MY ask me no questions....  

# re: Running restricted -- What does the "protect my computer" option mean?

Friday, April 11, 2008 11:00 AM by Adam Saunders

Same problem here. I uncheck "protect my data from unauthorized program activity" the option, but when I close the dialog box and go back the option is rechecked. WTF?

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker