Click here to Skip to main content
6,595,444 members and growing! (16,664 online)
Email Password   helpLost your password?
Web Development » Web Security » Security     Advanced

Securely Run the ASP.NET Worker Process as the System Account

By David Coe

Describes the proper way to configure a server to securely run the ASP.NET worker process runs as the system account.
VC7, VC7.1, VC8.0, Windows, .NET 1.0, .NET 1.1, ASP.NET, Visual Studio, MFC, ATL, WTL, STL, Dev
Posted:27 Jan 2004
Views:40,509
Bookmarked:21 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
6 votes for this article.
Popularity: 2.28 Rating: 2.93 out of 5
2 votes, 33.3%
1
1 vote, 16.7%
2

3
1 vote, 16.7%
4
2 votes, 33.3%
5

Introduction

There are several articles in existence about safely running the aspnet_wp.exe as the ASPNET user, or any other custom user that is specified in the <processModel> section of the machine.config file. However, when I attempted to run the ASP.NET worker process as "machine", or any other user that had the necessary permissions, I was unable to do so. After countless hours of creating a user, granting permissions, and following the steps set fourth by Microsoft in their patterns and practices document, what I found was that the effective settings in our Active Directory group policy were overriding the local policy that I set on my machine. While I'm sure that their directions were well and good for traditional settings, they covered nothing about being in Active Directory and what happens to the local user permissions once they are set.

However, there is a workaround for this dilemma. In the <processModel> element of the machine.config file, set the user name to "system" and the password to "AutoGenerate". Create a local user on your machine. The user will need permission to access all the necessary resources (GAC, Temporary ASP.NET Files directory, etc.). The list of necessary permissions can be found at MSDN. Additionally, if you store any username/password information in the registry, or if you need to access any legacy COM objects in a separate place on the server, the user will need to have the necessary rights.

Now, in the machine.config file, locate the <identity> element. The default setting for the <identity> element is:

<identity impersonate="false" userName="" password=""/>

If you set the identity impersonation to true, but do not specify a user name and password, then the worker process attempts to access files as the IUSR_machinename account. Now, specify a user name and password in the <identity> element, such as:

<identity impersonate="true" userName="myLocalUser" password="myUserPassword"/>

In this setup, it is true that the ASP.NET worker process still runs as system, but when the worker process tries to access files on the server (either in the virtual directory, or in the Temporary ASP.NET Files directory for just-in-time compilation), it does so as the user specified in the <identity> element, not as the system user.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

David Coe


Member

Occupation: Web Developer
Location: United States United States

Other popular Web Security articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 1 of 1 (Total in Forum: 1) (Refresh)FirstPrevNext
GeneralAsyncronous PinmemberHugo Hallman15:04 16 Oct '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 27 Jan 2004
Editor: Smitha Vijayan
Copyright 2004 by David Coe
Everything else Copyright © CodeProject, 1999-2009
Web11 | Advertise on the Code Project