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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

182 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>s●●Restrict which code can call your codeFor example, you may only want your assembly to be called by other codedeveloped by your organization. One way to do this is to use the public keycomponent of an assembly’s strong name to apply this kind of restriction. Thishelps prevent malicious code from calling your code.Identify codeTo successfully administer code access security policy <strong>and</strong> restrict what code c<strong>and</strong>o, the code must be identifiable. Code access security uses evidence such as anassembly’s strong name or its URL, or its computed hash to identify code(assemblies.)How to Use This ChapterThis chapter takes up where Chapter 7, “Building Secure Assemblies,” left off. Itshows how you can use code access security to further improve the security of yourmanaged code. To get the most out of this chapter:● Read Chapter 6, “.NET <strong>Security</strong> Fundamentals” for an overview <strong>and</strong> comparisonof user (role)-based security versus code access security. Chapter 6 helps set thescene for the current chapter.● Read Chapter 7, “Building Secure Assemblies.” Read Chapter 7 before thischapter if you have not already done so.● Read Chapter 9, “Using Code Access <strong>Security</strong> with ASP.NET.” After you readthis chapter, read Chapter 9 if you are interested specifically in ASP.NET codeaccess security policy <strong>and</strong> ASP.NET trust levels.Code Access <strong>Security</strong> ExplainedTo use code access security effectively, you need to know the basics such as theterminology <strong>and</strong> how policy is evaluated. For further background information aboutcode access security, see the “Additional Resources” section at the end of this chapter.If you are already familiar with code access security, you may want to skip thissection <strong>and</strong> go to the “APTCA” (AllowPartiallyTrustedCallersAttribute) sectionlater in this chapter.Code access security consists of the following elements:● Code● Evidence● Permissions● Policy● Code groups

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

Saved successfully!

Ooh no, something went wrong!