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.

252 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sSummaryCode access security is a resource constraint security model that can be used to helpprovide application isolation. <strong>Application</strong>s can be configured to run at variouspartial-trust levels. The trust level determines the permissions that are granted to theASP.NET <strong>Web</strong> application or <strong>Web</strong> service. This determines the resource types that canbe accessed, <strong>and</strong> the other types of privileged operation that can be performed. Notethat all resource access is ultimately subject to operating system security.The recommended isolation model uses IIS 6.0 application pools on WindowsServer 2003 <strong>and</strong> provides process level isolation in addition to code access security.On Windows 2000, isolation can only be achieved using code access security <strong>and</strong>separate thread identities.Migrating an application to run with partial trust usually requires a certain amount ofreengineering. You might need to reengineer if the application accesses resources thatare not permitted by the partial trust level or if it calls strong named assemblies thatdo not contain APTCA. In these cases, you can s<strong>and</strong>box privileged resource access inseparate wrapper assemblies. In some scenarios, you might be able to create <strong>and</strong> usecustom policy files, although this depends on your <strong>Web</strong> server’s security policy.It is a good design practice to place resource access code in separate assemblies <strong>and</strong>avoid placing this code in .aspx files <strong>and</strong> code behind files. The use of separateassemblies allows code access security policy to be applied to the assemblyindependently from the <strong>Web</strong> application <strong>and</strong> it allows you to develop s<strong>and</strong>boxedtrusted code to perform resource access.Additional ResourcesFor more information, see the following resources:●●●●“<strong>Security</strong> in .NET: The <strong>Security</strong> Infrastructure of the CLR Provides Evidence,Policy, Permissions, <strong>and</strong> Enforcement Services” in MSDN Magazine athttp://msdn.microsoft.com/msdnmag/issues/02/09/<strong>Security</strong>inNET/default.aspx.“<strong>Security</strong> in .NET: Enforce Code Access Rights with the Common LanguageRuntime” in MSDN Magazine at http://msdn.microsoft.com/msdnmag/issues/01/02/CAS/default.aspx.LaMacchia, Lange, Lyons, Martin, <strong>and</strong> Price. .NET Framework <strong>Security</strong>. AddisonWesley Professional, 2002.“How To: Create a Custom Encryption Permission” in the “How To” section ofthis guide.

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

Saved successfully!

Ooh no, something went wrong!