I'm running a sandboxed application as a local user. I now want to deny almost all file system permissions for this user to secure the system, except for a few working folders and some system DLLs (I'll call this set of files & directories X below).

The sandbox user is not in any group. So it shouldn't have any permissions, right? Wrong, because all "Authenticated Users" are a member of the local "Users" group, and that group has access to almost everything.

  • I thought about recursively adding deny ACL-entries to all files and directories and remove them manually from X. But this seems excessive.

  • I also thought about removing "Authenticated Users" from the "Users" group. But I'm afraid of unintended side-effects. It's likely that other things rely on this. Is this correct?

Are there better ways to do this? How would you limit the filesystem permissions of a (very) non-trustworthy account?


A couple things to keep in mind:

Disable bypass traverse checking for that user.

Explicit allows take precedence over inherited denies.

I would not recommend altering the Authenticated Users or Users security groups.

| improve this answer | |
  • Haven't thought about Bypass Traverse Checking. I just read KB823659 which states that "Therefore, removing the Everyone group from the list of security principals who have this user right by default could lead to operating system instability or to program failure. It is better that you leave this setting at its default.". How can I only deny a single account this right? Secpol.msc -> User Rights Assignment only allows me to add other users/groups, not to deny. – Simon Sep 14 '12 at 23:29

Give a deny to that user at the root of the drive for exerything except "Traverse Folder" and then grant an explicit allow where you want them to be able to read. Generally speaking, removing Authenticated Users from Users isn't a good idea.

| improve this answer | |
  • I like your answer better than mine because it's more of a direct answer to his question and less vague design considerations. – Ryan Ries Sep 14 '12 at 23:52
  • I tried it, but it didn't work. The user still has access to almost all files. To make sure that I did the right thing: Right clicked C:, Security, Advanced, Change Permissions, Add..., enter username, check "Full control/Deny", uncheck "Traverse folder/Deny". I set the combobox at the top of the dialog to "This folder, subfolders and files" and (2nd attempt) to "This folder only". Both things didn't work. Probably related to the "Bypass traverse checking" right? – Simon Sep 15 '12 at 0:01
  • Did you put a tick in the box to apply it to all subfolders and child items, and are you doing this with an account that actually has permission to change the permissions on every file on C:? – MDMarra Sep 15 '12 at 0:04
  • I'm doing it as a local admin. Are you sure I should tick the "[ ] Replace all child object permissions with inheritable permissions from this object"? Wouldn't this mess up all special permissions in C:\Windows for example? – Simon Sep 15 '12 at 0:09
  • Actually, yes. That's a good point. It's so rare to try and do something like this that I forgot about that. – MDMarra Sep 15 '12 at 0:12

I don't think this is the right way to approach this.

What you should really do is set ACLs on confidential data you have (eg. if users have home folders on this computer, you should change its ACL so that only that user and administrators are granted any access at all on it).

| improve this answer | |

In the end I went with the "excessive" solution:

icacls c:\* /T /C /deny MyComputer\SandboxUser:(OI)(CI)F

This adds deny entries to all files and directories. Then I used Process Monitor to see what permissions I have to change manually to let the application run.

| improve this answer | |
  • Thanks for all the great answers and the effort. I upvoted all of them. Fair? What's the right thing to do here? – Simon Sep 16 '12 at 11:56

Remember that even a very non-trustworthy user that you want to be able to log in to your system will need read access to certain system files. What's your concern here? If you're worried about a user being able to delete system files and the like, then a standard user account will probably give the security you need. Make them a member of the Guests group if you're really concerned.

If you're really, really concerned then perhaps consider applying a more restrictive security template to the system (or use the Security Configuration Wizard if you're talking Windows 7/2008 or later), but be aware that this can break things for other users.

| improve this answer | |
  • I'm not concerned about general server security. This user account is just used to sandbox one specific type of application, which is secured by other means too (restricted tokens, job objects and integrity levels). NTFS file permissions is just defense in depth. I'm mostly worried about the user reading confidential data - not deleting system files. – Simon Sep 14 '12 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.