at a minimum the IUSR_[machine] user needs read access to php.ini and the docroot and write access to session and temp directories
For an intranet server that has some exposure to the ineternet and is not a hosting server then your suggestion is fine I think. Noone can upload a root jumping script and browse your sessions directory.
With that stated, IMHO using IUSR perms is a shortcut and not real security. It is no opinion that it is one of the least secure methods of going about getting yourself a working installation of PHP5 in ISAPI mode. IUSR should *not* have access to these directories/files -- not in 2003 on IIS6 and especially if you are providing shared hosting services. It should have
Users Group Special Permissions and
Network Service Special Permissions defined -- identcal to the ones set on Windows\Temp.
I stumbled on this ACL configuration accidentaly to be honest. Well sort of...I noticed that in the php.ini if I did not set the Upload directory directive that by default PHP uses %systemroot%\TEMP ( Windows\Temp ). Uploads were working fine for me but when I looked in the sessions directory all I saw were zero KB session files. Session files were being created but there was no data in them and this is with IUSR Read/Write, and I'll be darned ( is that a word? ) if I give IUSR Modify/Full Control perms in a sensitive directory such as my php installation directory.
So, as a test I used the Windows\Temp ACL as a template to set the permissions on php5\sessions and Voila! All of a sudden everything was working beatifully. To complete the test I created two directories on a completely different drive -- sessions and uploads. I again used the ACL for %systemroot%\temp as a Template, defined these directories in the php.ini, restarted IIS, and again Voila! Works like a charm!
I have not seen this configuration suggested anywhere. This is just a product of paranoia and research as I can imagine a few ways to access directories that I should not have access to as IUSR. Imagine if a root jumping script kiddie accessed the sessions directory....maybe now you see my point.
An Administrator's best friend in defeating hack attempts is good security, but a little obfuscation goes a long way to. I say this as most Admins of windows servers are predicatable....IUSR perms on C:\PHP. Treat the PHP directory like you would C:\Windows, and move your upload and sessions directory *out* of C:\PHP. An additional technique would be to also name the PHP install directory to something other than 'PHP'. If you use the batch script I provided you can name the directory anything you want and install it on Drive K: and it will work fine -- that is if you configure your php.ini to match the custom settings.
Not trying to come down on you jpadie. I am just trying to make sure that anyone that reads this will be provided with the most secure method possible for installing PHP5 in ISAPI mode in Windows 2003 Server...at least the most secure I can get it without comprising PHP functionality.
Best Regards
-a6m1n0
Curiosity only kills cats.