asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search








Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

Exploring Machine.Config - User Security and More
By Christopher Spann
Rating: 3.3 out of 5
Rate this article


  • email this article to a colleague
  • suggest an article

    If you are like many systems administrators, you are probably scrambling to figure out how to best accommodate the growing number of .NET developers without compromising security and availability. If you are like most developers I know, you are frustrated with system administrators dragging their feet while you sit around missing out on an exciting and powerful technology. I may be biased, but I must say that the infrastructure teams are correct to delay just a bit. The .NET Framework is a new and remarkable accomplishment for Microsoft, but there are many things to consider before you just run the install and start deploying code.

    One of the first things that you should notice after installing the .NET Framework and running some test pages is the ASP.NET worker process. This task runs as aspnet_wp.exe if viewed in the Windows Task Manager. The identity of this process is set in the Machine.Config file found in the "CONFIG" subfolder of your .NET Framework install directory (c:\WINNT\Microsoft.NET\Framework\{Version Number}\CONFIG on Windows 2000 installations). The default account for the ASP.Net worker process is a local account "ASPNET". This may vary for some users as this does not hold true for all OS configurations or versions of the .Net Framework. This account is most similar to the IWAM_MachineName account used by IIS. While this account is typically harmless, there is still an inherent lack of administrative control.

    There are options other than the default installation accounts. If you are in an environment with a Windows NT or Windows 2000 domain, you may use a domain account for your ASP.NET worker process. This would allow more control over what the executing code does and does not have access to. In the environment I manage, this proves valuable because local machine accounts do not have any level of access to network resources, such as DFS shares. In addition to the access controls, there is another positive with Windows 2000 installations.

    In the Web.Config file -- present in each .NET Web application -- the developer has the option to specify an impersonation identity. While this may be a necessary evil for some applications, it only further exposes the system in a majority of situations. Users could then set code to impersonate personal or other user accounts, thus exposing your systems to risks beyond your control. When a domain account is configured in the Machine.Config file, the impersonation user in the Web.Config file is rendered inoperable.

    If this sounds appealing, please follow these steps to configure the ASP.NET worker process identity:

    • Choose an account.
    • Make a backup of your current Machine.Config file.
    • Locate the section titled "processModel" in the tag.
    • Modify the username and Password attributes. Make sure you include the domain\username when appropriate.
    • Save your changes.
    • Read/write access is required to the %installroot%\ASP.NET Temporary Files directory. Subdirectories beneath this root are used for dynamically compiled output.
    • Read/write access is required to the %temp% directory, which is used by the compilers during dynamic compilation.
    • Read access is required to the application directory. (Web site home directory)
    • Read access is required to the %installroot% hierarchy to make it possible to access to system assemblies.
    • Restart IIS

    Here is a sample of the batch file that I use:

    
    cacls "C:\WINNT\Microsoft.NET" /T /E /C /P domain\account:R
    cacls "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files" /T /E /C /P domain\account:C
    cacls "C:\WINNT\temp" /T /E /C /P domain\account:C
    cacls "C:\inetpub\wwwroot" /T /E /C /P domain\account:R
    cacls "d:\websites" /T /E /C /P domain\account:R
    cacls "C:\WINNT\assembly" /T /E /C /P domain\account:R
    
    
    Of course you should run test code after making these changes to verify that ASP.NET is still able to execute. I have seen some instances where using a domain account on a domain controller did not work. It is generally best practice to avoid running production Web applications on a domain controller in most environments. If you are having problems, please check the Event Log for errors specific to insufficient permissions when starting the ASP.NET worker process.

    Finally, there are a few other key attributes to notice when reviewing the processModel attribute of the Machine.Config file. They include timeout, requestLimit, memoryLimit, and ClientConnectedCheck. Although the .NET Framework and ASP.NET worker process are generally stable, limiting the time a process runs without restarting and controlling the maximum memory consumable by the process can go a long way to safeguard against disruptive code. These attributes should be modified to better suit your environments and the needs of your user community. You may even want to write a script utilizing the XML document object model to automatically set these attributes when you deploy the Framework. More information on the processModel attribute of System.Web can be found on Microsoft's Web site. The current link is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfprocessmodelsection.asp.

    About the Author

    Christopher Spann has been supporting Web servers in ISP, Web hosting, and corporate environments since 1994. He's spent the last two years supporting over 200 Web and application servers for a major corporation. He is also profficient in ASP.NET, classic ASP, VB .NET, VB, and COM+.

    Christopher has an MIS degree from the University of Houston and plans on attending law school there this fall. He can be reached at cspann7@yahoo.com.

  • Rate This Article
    Not HelpfulMost Helpful
    1 2 3 4 5
    Supporting Products/Tools
    AspEncrypt
    Built around the Microsoft CryptoAPI, AspEncrypt helps you harness all major encryption and hashing algorithms such as DES, Triple-DES, RC2, RC4, RSA, MD5 and SHA1 in just a few lines of code. The component can be used in tandem with AspEmail to send encrypted and signed mail in the industry-standard S/MIME format, or with AspUpload to encrypt files as they are being uploaded. AspEncrypt can also be used to issue and manage X.509 digital certificates.
    [Top]
    Other Articles
    Feb 3, 2005 - ASP.NET Mixed Mode Authentication
    In many web applications it is desirable for both intranet users and external parties to be able to seamlessly log onto the system. The problem this raises is that it is not easy to allow intranet users to log in via Windows integrated authentication while also allowing external parties to log in to the same application using standard forms authentication. This article will show you one way to achieve the best of both worlds when it comes to authentication.
    [Read This Article]  [Top]
    Dec 8, 2004 - Designing Role-Based Security Models for .NET
    In this article, Michele Leroux Bustamante discusses authentication, authorization and role-based security in .NET. Along the way, he provides some best practices for implementing role-based security in some typical .NET application scenarios including rich clients, Web applications, and Web services.
    [Read This Article]  [Top]
    May 11, 2004 - SharePoint Security and .NET Impersonation
    When implementing custom components that require access to restricted resources, implicit impersonation must be used. Jay Nathan shows how to create a class that makes using .NET Impersonation a snap.
    [Read This Article]  [Top]
    Mar 10, 2004 - Intellectual Property Protection and Code Obfuscation
    Learn about the execution process of CLR-based programs and how to protect your applications from being easily disassembled back into source code.
    [Read This Article]  [Top]
    Feb 24, 2004 - How to Send Secure Mail in ASP-Based E-Commerce Applications - Part II
    Businesses that utilize encrypted e-mail may find Secure Multipurpose Internet Mail Extensions (S/MIME) to be somewhat restrictive. This article shows how to use security features in PDF as an alternative to S/MIME.
    [Read This Article]  [Top]
    Feb 2, 2004 - Fighting Spambots with .NET and AI
    Bill Gates, in a recent interview, predicted the end of spam by 2006. One of the methods he mentioned involved a challenge only a real live person could handle. Adnan Masood shows how to use AI and .NET to create a user verification scheme that incorporates similar concepts Gates alluded to.
    [Read This Article]  [Top]
    Jan 21, 2004 - Configuring .NET Code Access Security
    Code Access Security (CAS) is the .NET Framework security model that grants code permission to resources based on "evidence" pertaining to the encapsulating assembly. In this article, David Myers examines CAS and explains different configuration methods.
    [Read This Article]  [Top]
    Mar 10, 2003 - Platform Neutral and Transparent Encryption of Sensitive Customer Information
    Zhenlei Cai combines an open source C++ encryption library with SQL Server extended stored procedures to create a platform neutral, transparent encryption solution that resides at the database layer.
    [Read This Article]  [Top]
    Dec 10, 2002 - Encrypting Cookie Data with ASP.NET
    You don't have to be a cryptography expert or spend lots of money on third-party components to secure sensitive data in .NET. In this article, Wayne Plourde shows just how easy it is to encrypt cookie data using encryption classes in the .NET System.Security.Cryptography namespace.
    [Read This Article]  [Top]
    Aug 21, 2002 - Web Application Error Handling and Logging For ASP
    One of the most important aspects of an application is how well it responds to the user, and this includes response to errors. In this article, Adam Tuliper shares techniques for catching ASP errors and shows how to create a notification system that is sure to keep customers at bay.
    [Read This Article]  [Top]
    Mailing List
    Want to receive email when the next article is published? Just Click Here to sign up.

    Support the Active Server Industry



    JupiterOnlineMedia

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info


    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers