On a *nix system I can use a chroot to isolate two processes from each other and from the rest of the system. Is there any similar security system under windows? Or is there any way to prevent two processes from reading/writing to each others files?
1I'm not sure the security tag is warranted here. kerneltrap.org/Linux/Abusing_chroot– MDMarraJul 18, 2010 at 16:54
1@The Rook - In that kerneltrap discussion, kernel devs discuss the fact that chroot was never intended to be a security device/– MDMarraJul 18, 2010 at 18:12
1@The Rook - Right, I was simply saying that you may want to rephrase the question. There have been extensions to chroot or spins on the concept (like jails) that have been designed with security in mind. In your post, you refer to chroot as a security device, which it was never intended to be.– MDMarraJul 18, 2010 at 19:57
1@Nathan Adams I agree, but "security in layers".– RookJul 18, 2010 at 23:37
1Looks like I've asked something fairly similar here. Did you ever manage to set this up on Windows Server? The answer you accepted neither explains how to do this, nor says that it's not possible...– RomanStMay 13, 2013 at 19:13
I'm not sure you will gain anything on Windows by chrooting - do you have a specfic need?
In case any the top result on google is http://www.winquota.com/wj/.
Perhaps application virtualization might be an option? Microsoft has the following to say about it:
In a physical environment, every application depends on its OS for a range of services, including memory allocation, device drivers, and much more. Incompatibilities between an application and its operating system can be addressed by either server virtualization or presentation virtualization; but for incompatibilities between two applications installed on the same instance of an OS, you need Application Virtualization.
6One of my processes was poorly written and very insecure, management doesn't want to fix it because it would be "too expensive". I expect this process to get owned eventually and i want to limit the impact on my system. If you really believe there is nothing to gain, then you must read more about chroots. Jul 18, 2010 at 17:49
1@Rook Because on Windows you can have access rights divorced from filesystem layout. Your chestbeating in the comments section of this answer aside, that is the approach most people take to insulate portions of the file system from a process that is not authorized to access it; simply give the user the process is started under access to the subset of the filesystem and services that it needs. Feb 28, 2016 at 2:36
1@Asad Saeeduddin Speaking of filesystems, doesn't windows just autorun untrusted executables found on a USB sticks? What year is it? Mar 1, 2016 at 3:06
I have a specific need, not security-related -- this program I'm porting expects to operate on its own root filesystem, and it'd be a massive effort to port it to use current directories correctly. Thankfully, it does work filesystem-independently -- on Windows, it'll just sprawl out across the root of whatever drive it's run on. If I could just "alias" the root dir in Windows to some subdirectory, it'd be much cleaner and easier to keep track of, hence wanting chroot.– NicNov 5, 2019 at 4:11
Not exactly like chroot. It does setup a sandbox for each program you specify. It can easily keep processes isolated.
I wouldn't use anything like this, you are running under Windows mate.
NTFS has the most fine grained access rights you can find. Its not hard to let a prozess start with lower privileged user, and only giving that user access to the files of this single application.
No need to use something like chroot, which is not a security tool, when you can already define what user is allowed to do what in what directory.
Its no different than like giving the Apache under Linux its own user, only allowed to work inside his folders.
2This is the correct answer as to why chroot isn't needed– Jim BJan 5, 2016 at 18:41
@rook, then they failed to follow the BPSAD and PTH whitepapers to eliminate golden ticket attacks. As far as I know that only still works on *nix based kerb.– Jim BJan 5, 2016 at 22:23
@Jim B compartmentalization may sound foreign in a platform that routinely grants administrative rights to the browser, database, and web server. however, sandboxes are a quint essential defense-in-depth measure irregardless of platform. Jan 5, 2016 at 23:26
1@JimB, I don't think (so unless I completely misunderstood your comment). Starting a process in Windows 7 for example gives you no security prompt and afterwards the process can read 90% of your storage drive without ever having to ask any system process about it. Only if it tries to modify, say "C:\Program Files" then the OS can slap its wrists but that's not security, that's fundamental essentials barely being covered. Jan 23, 2016 at 11:30
1@JimB: if you have to set a deny permission before a process is prohibited from accessing another process' files, then it isn't "isolated by default" as you claimed above.– Lie RyanApr 3, 2016 at 9:48
To solve this specific need (program assumes it's running off of a root directory), the SUBST command is probably what you want. It's a holdover from DOS, and still exists in windows 10.
the SUBST command will mount a directory as a new drive letter.
then you can run the software from the newly created drive, and it will think it's on your new drive S if you run it from that path.
There is a chroot.exe included in Gow (Gnu On Windows)
1The one in Git Bash also seems to work but I think you have to be in an Git Bash prompt before calling it. Feb 8, 2021 at 15:43
If you are not uploading files from the website, simply create a read only ISO of your website and make that your root directory, then mount it.
Another solution is to use DISKPART and create a READONLY partition/drive with the webpages.
Hope this was useful.