Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Prevent unauthorized changes to ASP.NET configuration files

Total Hit ( 1798)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Some ASP.NET settings are so critical that the system administrator should prevent them from being changed by individual applications. This ability is especially crucial for servers that host multiple applications written by different developers. In this case, the administrator can prevent undesired changes by adding an allowOverride attribute to the tag:

Click here to copy the following block
<location path="Default Web Site/MyApp" allowOverride="false">
 <system.web>
  <authorization>
   <allow roles="MyDomain\Administrator" />
   <deny users="*" />
  </authorization>
 </system.web>
</location>

Another way to prevent a set of values from being redefined is by adding an allowDefinition attribute to a tag in the portion of the configuration file. For example, the following entry in machine.config effectively prevents the key from appearing in application's web.config files:

Click here to copy the following block
<section name="processModel"
  type="System.Web.Configuration.ProcessModelConfigurationHandler,
     System.Web, Version=1.0.3300.0, Culture=neutral,
     PublicKeyToken=b03f5f7f11d50a3a"

  allowDefinition="MachineOnly" />

The allowDefinition attribute can take three values: MachineOnly for settings that can appear only in machine.config; MachineToApplication for settings that can appear in machine.config and the application's main web.config file, but not in secondary web.config files; and Everywhere for settings that can appear in any .config file. (This is the default behavior if this attribute setting is omitted).


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.