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 8: Code Access <strong>Security</strong> in Practice 183CodeAll managed code is subject to code access security. When an assembly is loaded, it isgranted a set of code access permissions that determines what resource types it canaccess <strong>and</strong> what types of privileged operations it can perform. TheMicrosoft .NET Framework security system uses evidence to authenticate (identify)code to grant permissions.Note An assembly is the unit of configuration <strong>and</strong> trust for code access security. All code in thesame assembly receives the same permission grant <strong>and</strong> is therefore equally trusted.EvidenceEvidence is used by the .NET Framework security system to identify assemblies.Code access security policy uses evidence to help grant the right permissions to theright assembly. Location-related evidence includes:● URL. The URL that the assembly was obtained from. This is the codebase URL inits raw form, for example, http://webserver/vdir/bin/assembly.dll orfile://C:/directory1/directory2/assembly.dll.● Site. The site the assembly was obtained from, for example, http://webserver. Thesite is derived from the codebase URL.● <strong>Application</strong> directory. The base directory for the running application.●Zone. The zone the assembly was obtained from, for example, LocalIntranet orInternet. The zone is also derived from the codebase URL.Author-related evidence includes:●●Strong name. This applies to assemblies with a strong name. Strong names are oneway to digitally sign an assembly using a private key.Publisher. The Authenticode signature; based on the X.509 certificate used to signcode, representing the development organization.Important Publisher evidence (the Authenticode signature) is ignored by the ASP.NET host <strong>and</strong>therefore cannot be used to configure code access security policy for server-side <strong>Web</strong>applications. This evidence is primarily used by the Internet Explorer host.●Hash. The assembly hash is based on the overall content of the assembly <strong>and</strong>allows you to detect a particular compilation of a piece of code, independent ofversion number. This is useful for detecting when third party assemblies change(without an updated version number) <strong>and</strong> you have not tested <strong>and</strong> authorizedtheir use for your build.

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

Saved successfully!

Ooh no, something went wrong!