11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

462 Part IV: Securing Your Network, Host, <strong>and</strong> <strong>Application</strong>Step 16. Machine.ConfigThis section covers hardening information about machine level settings that apply toall applications. For application specific hardening settings, see Chapter 19, “SecuringYour ASP.NET <strong>Application</strong>.”The Machine.config file maintains numerous machine wide settings for the .NETFramework, many of which affect security. Machine.config is located in the followingdirectory:%windir%\Microsoft.NET\Framework\{version}\CONFIGNote You can use any text or XML editor (Notepad, for example) to edit XML configuration files.XML tags are case sensitive, so be sure to use the correct case.During this step, you:● Map protected resources to HttpForbiddenH<strong>and</strong>ler.●●●●Verify that tracing.is disabled.Verify that debug compiles are disabled.Verify that ASP.NET errors are not returned to the client.Verify session state settings.Map Protected Resources to HttpForbiddenH<strong>and</strong>lerHTTP h<strong>and</strong>lers are located in Machine.config beneath the element. HTTP h<strong>and</strong>lers are responsible for processing <strong>Web</strong> requests for specificfile extensions. Remoting should not be enabled on front-end <strong>Web</strong> servers; enableremoting only on middle-tier application servers that are isolated from the Internet.● The following file extensions are mapped in Machine.config to HTTP h<strong>and</strong>lers:●●●●.aspx is used for ASP.NET pages.rem <strong>and</strong> .soap are used for Remoting..asmx is used for <strong>Web</strong> Services..asax, .ascx, .config, .cs, .csproj, .vb, .vbproj, .webinfo, .asp, .licx,.resx, <strong>and</strong> .resources are protected resources <strong>and</strong> are mapped toSystem.<strong>Web</strong>.HttpForbiddenH<strong>and</strong>ler.For .NET Framework resources, if you do not use a file extension, then map theextension to System.<strong>Web</strong>.HttpForbiddenH<strong>and</strong>ler in Machine.config, as shown in thefollowing example:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!