Connect Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 5 June 2012

New in IIS 7 - App Pool Isolation

Posted on 07:39 by Unknown

In previous versions of IIS, it has sometimes been difficult to isolate web application pools from each other. If multiple web application pools are configured to run as the same identity (e.g. Network Service) then code running inside one web application pool would be able to use File System objects to access configuration files, web pages and similar resources belonging to another web application pool. This was because it was impossible to allow one process running as Network Services access to a file, but prevent another process also running as Network Service access to the same file.
In IIS 7.0 it is possible, with some work, to prevent this from occurring. As part of IIS 7.0 inbuilt functionality, each web application pool has an application pool configuration file generated on-the-fly when that application pool is started. These are stored, by default, in the %systemdrive%\inetpub\temp\appPools folder. Each web application pool has an additional SID (Security Identifier) generated for it, and this in injected into the relevant w3wp.exe process. The application pool's configuration file is ACLed to allow only that SID access. Since each w3wp.exe process has it's own SID, each application pool's configuration file is ACLed to a different SID:
Using the icacls.exe tool it is possible to determine the SID applied to any given application pool's configuration file. This can be done by using the command:
icacls.exe %systemdrive%\inetpub\temp\appPools\appPool.config /save output.txt
The actual SID always starts with the well-known identity prefix: S-1-5-8-82 followed by a hash of the Application Pool's name.
The retrieved SID can now be used to secure web site content in the same way. To do this:
Edit: Thomas Deml (from the IIS Product Group) has shown me an easier way to perform Step 4 below
  1. Configure each website (or web application) to run in its own web application pool
  2. Configure anonymous authentication to use the application pool identity rather than the IUSR account (this can be done by editing the Anonymous Authentication properties for the website in question)
  3. Remove NTFS permissions for the IUSRS group and the IUSR account from the website's files and folders.
  4. Use the icacls.exe tool to permit the App Pool's individual SID Read (and optionally Execute and Write) access to the web site's files and folders. You don't need to initially retrieve the SID using iCacls. Instead simply use: IIS APPPOOL\ApplicationPoolName as the user to grant read permissions to (see screenshot below for an example for the Default App Pool)
After configuring these NTFS permissions, only the SID that has been injected into a particular w3wp.exe process will be able to read the contents of the website in question. All code running in other w3wp.exe processes, even though the process identity may also be Network Service, will be unable to read this particular website's content. This technique may be most useful to web hosters or similar administrators, that need to accept content from various external or untrusted parties.
Edit #2: Here's a screenshot of the dynamic SID injection in action for the Default App Pool (using the excellent Process Explorer tool). The username highlighted can be used with icacls.exe to ACL your web content.


Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • How to schedule a PHP script in task scheduler
    Quiet often there is a need to execute/run  php  script on some time interval at server side. And that php scripts should run automatically ...
  • HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to run CGI applications.
    If you get the error “HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to...
  • Roles and Features showing an error HRESULT: 0x800F0818 in Server Manager of windows server 2008 R2
    When you open Server Manager both Roles and Features display Error and you are unable to add any role or features. When you select the det...
  • How to configure IIS 7 to redirect non-www domain to www domain?
    One of few legacy leftovers that was never dropped over the years is the common use of www domain prefix. It is not a problem per se for us...
  • Error - "Failed to retrieve data for this request (Microsoft.SqlServer.Management.sdk.sfc)"
    ErrError    - In Microsoft SQL Management Studio 2008, you receive the following error message when you try to expand the Databases:      ...
  • Reset Mysql root Password using my.ini
    Follow the below given steps to reset the Mysql root password : 1.Browse to your MySQL installation directory. 2. In there, go to "Data...
  • Disallowed Parent Path
    If you are unable to access the website and facing the below error: Active Server Pages error 'ASP 0131' Disallowed Parent Path /adm...
  • How to resolve Windows Login Error: "An unauthorized change was made to Windows"
    After connecting to windows server via RDC, you receive error “ An unauthorized change was made to Windows ” Resolution: 1) Click the opt...
  • How to upgrade Zen Cart 1.3.9 to Zen Cart 1.5
    To upgrade your Zen Cart 1.3.9 to Zen Cart 1.5, follow the following steps. (For this tutorial, I assume you are using cpanel web hosting) 1...
  • Block IP from accessing website using .htaccess
    Block IP from accessing website using .htaccess To block certain ip address from accessing your website, just create a file with name .hta...

Categories

  • booting Process
  • linux
  • redhat

Blog Archive

  • ►  2013 (68)
    • ►  July (1)
    • ►  May (2)
    • ►  April (11)
    • ►  March (54)
  • ▼  2012 (44)
    • ►  September (20)
    • ►  August (1)
    • ►  July (4)
    • ▼  June (12)
      • Enable Canonical URL in IIS7 for SEO
      • How to disable web.config Inheritance for Child Ap...
      • New in IIS 7 - App Pool Isolation
      • Application Pool Identities
      • Ensure Security Isolation for Web Sites
      • Getting Started with AppCmd.exe
      • Introduction to ApplicationHost.config
      • How to Capture ASP.NET Page Trace Events in IIS 7....
      • Installing and Configuring Web Deploy
      • Classic ASP parent paths are disabled by default
      • Classic ASP Script Error Messages No Longer Shown ...
      • Classic ASP Not Installed by Default on IIS 7.0 an...
    • ►  May (2)
    • ►  March (4)
    • ►  February (1)
  • ►  2011 (1)
    • ►  February (1)
  • ►  2009 (9)
    • ►  September (3)
    • ►  August (2)
    • ►  June (1)
    • ►  May (2)
    • ►  March (1)
Powered by Blogger.

About Me

Unknown
View my complete profile