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 21: Code Review 637Check that you set the most restricted level necessary for the remote server. Forexample, if the server needs to identify you for authentication purposes, but does notneed to impersonate you, use the identify level as shown above. Use delegation-levelimpersonation with caution on Windows 2000 because there is no limit to the numberof times that your security context can be passed from computer to computer.Windows Server 2003 introduces constrained delegation.Note In Windows Server 2003 <strong>and</strong> Windows 2000 Service Pack 4 <strong>and</strong> later, the impersonationprivilege is not granted to all users.If your components are in a server application, the assembly level attribute shownabove controls the initial configuration for the component when it is registered withEnterprise Services.If your components are in a library application, the client process determines theimpersonation level. If the client is an ASP.NET <strong>Web</strong> application, check thecomImpersonationLevel setting on the element in theMachine.config file.Do You Use Role-Based <strong>Security</strong>?Check that your code uses role-based security correctly to prevent unauthorizedaccess by reviewing the following questions:● Is role-based security enabled?Check that role-based security is enabled. It is disabled by default onWindows 2000. Check that your code includes the following attribute:[assembly: <strong>Application</strong>AccessControl(true)]●Do you use component level access checks?COM+ roles are most effective if they are used at the interface, component, ormethod levels <strong>and</strong> are not just used to restrict access to the application. Check thatyour code includes the following attribute:[assembly: <strong>Application</strong>AccessControl(AccessChecksLevel=AccessChecksLevelOption.<strong>Application</strong>Component)]Also check that each class is annotated with ComponentAccessControl attributeas follows:[ComponentAccessControl(true)]public class YourServicedComponent : ServicedComponent{}

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

Saved successfully!

Ooh no, something went wrong!