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.

158 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>s3. The delay signing process <strong>and</strong> the absence of an assembly signature means thatthe assembly will fail verification at load time. To work around this, use thefollowing comm<strong>and</strong>s on development <strong>and</strong> test computers.● To disable verification for a specific assembly, use the following comm<strong>and</strong>.sn -Vr assembly.dll●To disable verification for all assemblies with a particular public key, use thefollowing comm<strong>and</strong>.sn -Vr *,publickeytoken●To extract the public key <strong>and</strong> key token (a truncated hash of the public key),use the following comm<strong>and</strong>.sn -Tp assembly.dllNote Use a capital –T switch.4. To fully complete the signing process <strong>and</strong> create a digital signature to make theassembly tamper proof, execute the following comm<strong>and</strong>. This requires the privatekey <strong>and</strong> as a result the operation is normally performed as part of the formalbuild/release process.sn -r assembly.dll keypair.snkASP.NET <strong>and</strong> Strong NamesAt the time of this writing, it is not possible to use a strong name for an ASP.NET <strong>Web</strong>page assembly because of the way it is dynamically compiled. Even if you use a codebehindfile to create a precompiled assembly that contains your page classimplementation code, ASP.NET dynamically creates <strong>and</strong> compiles a class thatcontains your page’s visual elements. This class derives from your page class, whichagain means that you cannot use strong names.Note You can strong name any other assembly that is called by your <strong>Web</strong> page code, for examplean assembly that contains resource access, data access or business logic code, although theassembly must be placed in the global assembly cache.

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

Saved successfully!

Ooh no, something went wrong!