I am installing the latest version of PHP onto IIS 7.5 via FastCGI, and all of the instructions say that FastCGI should impersonate the calling client by setting
fastcgi.impersonate = 1
If my website will have this configuration
- dedicated application pool
- application pool identity of ApplicationPoolIdentity
- anonymous authentication only (as IUSR)
why do I want to impersonate?
I come from an ASP.NET background, where the IUSR gets read-only permissions and the application pool identity gets any write permissions. Giving write access to the IUSR usually opens the door for WebDAV vulnerabilities. So I hesitate to let PHP run as the IUSR.
I can't find many people asking this question (1 | 2) so I think I must be missing something. Can someone clarify this for me?
13 months later, I wanted to revisit my own question. In that time I have transferred a half dozen websites from IIS 6 to IIS 7.5 and configured them with my preferred method. All I can say is that the websites work, they haven't had any security issues (not that these are popular sites), and in my opinion the setup is more secure than what learn.iis.net recommends.
For posterity, here are the relevant settings. In the PHP INI:
In IIS:
The NTFS permissions and where to apply them:
move_uploaded_file
will preserve the permissions of the upload directory. This is the biggest drawback of this permissions setup that I've found.IIS AppPool\<<YourApplicationPoolName>>
) - Grant Read & Listupload_tmp_dir
,session.save_path
, anderror_log
.I hope this helps anyone else who decides that the learn.iis.net instructions are not ideal.
See: http://www.php.net/manual/en/install.windows.iis6.php
Per documentation, it simply permits fastcgi to act on behalf of the client using all same permissions (in your case to be what looks like the IUSR account). In other words, to perform all actions normally allowed to the client's (or anon's) own credentials. No more, no less. Without this set, I imagine poor fastcgi would be left crippled.