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 6: .NET <strong>Security</strong> Overview 139●●When you have , you authorize againstthe Passport User ID (PUID) or roles retrieved from a store. For example, youcan map a PUID to a particular account <strong>and</strong> set of roles stored in a MicrosoftSQL Server database or Active Directory.When you have , you may not beperforming authorization. “None” specifies that you do not want to performany authentication or that you do not want to use any of the ASP.NETauthentication modules, but you do want to use your own custom mechanism.However, if you use custom authentication, you should create an IPrincipalobject with roles <strong>and</strong> store it in the HttpContext.Current.User property Whenyou subsequently perform URL authorization, it is performed against the user<strong>and</strong> roles (no matter how they were retrieved) maintained in the IPrincipalobject.Configuring Access to a Specific FileTo configure access to a specific file, place the element inside a element as shown below.You can also point the path attribute at a specific folder to apply access control to allthe files in that particular folder. For more information about the element,see Chapter 19, “Securing Your ASP.NET <strong>Application</strong>.”.NET Framework <strong>Security</strong> NamespacesTo program .NET Framework security, you use the types in the .NET Frameworksecurity namespaces. This section introduces these namespaces <strong>and</strong> the types thatyou are likely to use when you develop secure <strong>Web</strong> applications. For a full list oftypes, see the .NET Framework documentation. The security namespaces are listedbelow <strong>and</strong> are shown in Figure 6.3.● System.<strong>Security</strong>● System.<strong>Web</strong>.<strong>Security</strong>● System.<strong>Security</strong>.Cryptography● System.<strong>Security</strong>.Principal● System.<strong>Security</strong>.Policy● System.<strong>Security</strong>.Permissions

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

Saved successfully!

Ooh no, something went wrong!