I created two IIS sites which both have Windows Authentication and Directory Browsing enabled.
For the first one, let's call it "admin", I set no special permissions. I navigated to the site and was prompted for credentials. I logged in with an administrator account on the machine and was able to browse the folder. Perfect.
For the second one, let's call it "test", I created a new Windows user and removed it from ALL groups including "Users". I created a new folder on the drive and gave this new user permissions to the folder. When I access this site via a browser and login with the new account, I am able to browse the folder as expected. However, I am also able to browse the "admin" site above with this new account. This is not expected, as the only users that have permissions to the folder on the drive are "CREATOR OWNER", "SYSTEM", "Administrators" and "Users". My new user is not a member of any of those groups.
Why is this happening? What is the proper way, with IIS, to secure a folder with a local account, but ensure that account has no access to other folders?
Just because your second user is not a member of the
Users
group, it doesn't mean it is not a part of theUsers
group during runtime.Take my user Peter:
just a member of Guests, not Users.
But when I ask for my security context during runtime:
We can see that I am in Users as well as in a whole bunch of other special groups.
To limit files to certain users, you have to remove the permissions for the
Users
group.