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.

Chapter 6: .NET <strong>Security</strong> Overview 141●SupressUnmanaged<strong>Security</strong>Attribute. Used to optimize performance <strong>and</strong>eliminate the dem<strong>and</strong> for the unmanaged code permission issued by the PlatformInvocation Services (P/Invoke) <strong>and</strong> Component Object Model (COM)interoperability layers. This attribute must be used with caution because it exposesa potential security risk. If an attacker gains control of unmanaged code, he is nolonger restricted by code access security. For more information about using thisattribute safely, see “Unmanaged Code” in Chapter 8, “Code Access <strong>Security</strong> inPractice.”System.<strong>Web</strong>.<strong>Security</strong>This namespace contains the classes used to manage <strong>Web</strong> application authentication<strong>and</strong> authorization. This includes Windows, Forms, <strong>and</strong> Passport authentication <strong>and</strong>URL <strong>and</strong> File authorization, which are controlled by the UrlAuthorizationModule<strong>and</strong> FileAuthorizationModule classes, respectively. The types you are most likely touse when you build secure <strong>Web</strong> applications are:● FormsAuthentication. Provides static methods to help with Forms authentication<strong>and</strong> authentication ticket manipulation.● FormsIdentity. Used to encapsulate the user identity that is authenticated byForms authentication.● PassportIdentity. Used to encapsulate the user identity that is authenticated byPassport authentication.System.<strong>Security</strong>.CryptographyThis namespace contains types that are used to perform encryption <strong>and</strong> decryption,hashing, <strong>and</strong> r<strong>and</strong>om number generation. This is a large namespace that containsmany types. Many encryption algorithms are implemented in managed code,while others are exposed by types in this namespace that wrap the underlyingcryptographic functionality provided by the Microsoft Win32 ® -based CryptoAPI.System.<strong>Security</strong>.PrincipalThis namespace contains types that are used to support role-based security. They areused to restrict which users can access classes <strong>and</strong> class members. The namespaceincludes the IPrincipal <strong>and</strong> IIdentity interfaces. The types you are most likely to usewhen building secure <strong>Web</strong> applications are:● GenericPrincipal <strong>and</strong> GenericIdentity. Allow you to define your own roles <strong>and</strong>user identities. These are typically used with custom authentication mechanisms.● WindowsPrincipal <strong>and</strong> WindowsIdentity. Represents a user who is authenticatedwith Windows authentication together with the user’s associated Windows group(role) list.

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

Saved successfully!

Ooh no, something went wrong!