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.

Chapter 19: Securing Your ASP.NET <strong>Application</strong> <strong>and</strong> <strong>Web</strong> Services 575To disable the Documentation protocol, comment it out in Machine.config as follows:Forbidden ResourcesTo prevent protected resources <strong>and</strong> files from being downloaded over HTTP, mapthem to the ASP.NET HttpForbiddenH<strong>and</strong>ler.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 specific fileextensions. 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:In this case, the .vbproj file extension is mapped toSystem.<strong>Web</strong>.HttpForbiddenH<strong>and</strong>ler. If a client requests a path that ends with.vbproj, then ASP.NET returns a message that states “This type of page is not served.”The following guidelines apply to h<strong>and</strong>ling .NET Framework file extensions:●●Map extensions you do not use to HttpForbiddenH<strong>and</strong>ler. If you do not serveASP.NET pages, then map .aspx to HttpForbiddenH<strong>and</strong>ler. If you do not use <strong>Web</strong>Services, then map .asmx to HttpForbiddenH<strong>and</strong>ler.Disable Remoting on Internet-facing <strong>Web</strong> servers. Map remoting extensions(.soap <strong>and</strong> .rem) on Internet-facing <strong>Web</strong> servers to HttpForbiddenH<strong>and</strong>ler.

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

Saved successfully!

Ooh no, something went wrong!