ASP.NET Process Identity

 <  Day Day Up  >  

ASP.NET uses a special worker process implemented in aspnet_wp.exe. You can enhance the overall security of your portal by carefully choosing an identity ( essentially a Windows user account) under which this ASP.NET worker process executes.

If your other security measures fail and an intruding hacker gains control of your site, he or she will probably receive the access privileges of the ASP.NET worker process. You can diminish this risk by reducing the privileges associated with this account to a minimum. Running under the identity of a Local System account or an account from the Administrators group will significantly compromise your overall security. Initial releases of the .NET Framework defaulted this account to a Local System account, though later releases changed this default setting to a special local account named ASPNET, which has significantly fewer privileges.

To set the ASP.NET process identity, you have to modify the values in the processModel element in the machine.config file. This file sits at the top of the XML-based application configuration tree and can be found in the CONFIG subfolder of the Framework folder tree. On Windows XP the path is C:\WINDOWS\Microsoft.NET\Framework\v[FrameworkVersion]\CONFIG.

Figure 6.9 shows a portion of the .NET system configuration file machine.config dealing with default process attributes.

Figure 6.9. Setting ASP.NET Process Identity
 <configuration>     ...     <system.web>        ...        <processModel           userName="machine" password="AutoGenerate"           comAuthenticationLevel="Connect" comImpersonationLevel="Impersonate"           enable="true" timeout="Infinite" idleTimeout="Infinite"           shutdownTimeout="0:00:05" requestLimit="Infinite"           requestQueueLimit="5000" restartQueueLimit="10"           memoryLimit="60" webGarden="false"           cpuMask="0xffffffff"           logLevel="Errors" clientConnectedCheck="0:00:05"           responseRestartDeadlockInterval="00:09:00" responseDeadlockInterval="00:03:00"           maxWorkerThreads="25" maxIoThreads="25"/> 

The userName element of processModel recognizes two predefined values. If userName="machine" (the default in recent releases), the worker process will run under the ASPNET account. If userName="system" , the default identity will be the Local System account. The latter option is sometimes employed by developers to facilitate debugging. Don't forget to change it when your product goes live! And note that if you are using machine or system values, you must set the value of the password attribute to AutoGenerate.

You can also create a special account solely for the worker process. This account might have more restrictions on your network than the default ASPNET account. To specify this account, set the userName attribute to the account name in [Domain Name]\[Windows Account Name ] format (for example, ACCOUNTING\BSMITH) and the value of password elements to this account's password. If you use a custom account, give it the following access rights:

  • Read for the .NET Framework install folder and its subfolders and for the application folder

  • Read/write for the Windows Temp folder and for the Temporary ASP.NET Files subfolder located under the .NET Framework install folder

ASP.NET achieves additional levels of security because its worker process by default runs in a separate process. If, however, you change this default setting by specifying enable="false" in the processModel element, it will run in-process with IIS. In this case, all settings in processModel will be ignored.

 <  Day Day Up  >  


Building Portals, Intranets, and Corporate Web Sites Using Microsoft Servers
Building Portals, Intranets, and Corporate Web Sites Using Microsoft Servers
ISBN: 0321159632
EAN: 2147483647
Year: 2004
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net