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 10: Building Secure ASP.NET Pages <strong>and</strong> Controls 261Partition Your <strong>Web</strong> SiteYour <strong>Web</strong> site design should clearly differentiate between publicly accessible areas<strong>and</strong> restricted areas that require authenticated access. Use separate subdirectoriesbeneath your application’s virtual root directory to maintain restricted pages, such ascheckout functionality in a classic e-commerce <strong>Web</strong> site that requires authenticatedaccess <strong>and</strong> transmits sensitive data such as credit card numbers. Separatesubdirectories allow you to apply additional security (for example, by requiring SSL)without incurring SSL performance overhead across the entire site. It also allows youto mitigate the risk of session hijacking by restricting the transmission ofauthentication cookies to HTTPS connections. Figure 10.2 shows a typicalpartitioning.URLAuthorizationallows anonymousaccess<strong>Application</strong> v-dirpublic pagesweb.config<strong>Web</strong>.configRestricted Subfolderrestricted pageslogin.aspxAll pages require SSLIIS Metabase propertyAccessSSL=trueURLAuthorizationdenies unauthenticatedusers <strong>and</strong> forces a loginFigure 10.2A <strong>Web</strong> site partitioned into public <strong>and</strong> secure areasNote that in Figure 10.2, the restricted subfolder is configured in Internet InformationServices (IIS) to require SSL access. The first element in <strong>Web</strong>.configallows all users to access the public area, while the second element preventsunauthenticated users from accessing the contents of the secured subfolder <strong>and</strong>forces a login.For more information about restricting authentication cookies so that they arepassed only over HTTPS connections <strong>and</strong> about how to navigate betweenrestricted <strong>and</strong> non-restricted pages, see “Use Absolute URLs for Navigation” inthe “Authentication” section of this chapter.

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

Saved successfully!

Ooh no, something went wrong!