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.

638 Part V: Assessing Your <strong>Security</strong>●Do you perform role checks in code?If your method code calls ContextUtil.IsCallerInRole, check that these calls arepreceded with calls to ContextUtil.Is<strong>Security</strong>Enabled. If security is not enabled,IsCallerInRole always returns true. Check that your code returns a securityexception if security is not enabled.Do You Use Object Constructor Strings?Search your code for “ConstructionEnabled” to locate classes that use objectconstruction strings.[ConstructionEnabled(Default="")]public class YourServicedComponent : ServicedComponent, ISomeInterfaceIf you use object constructor strings, review the following questions:● Do you store sensitive data in constructor strings?If you store data such as connection strings, check that the data is encrypted priorto storage in the COM+ catalog. Your code should then decrypt the data when it ispassed to your component through the Construct method.●Do you provide default construction strings?Do not do this if the data is in any way sensitive.Do You Audit in the Middle TierYou should audit across the tiers of your distributed application. Check that yourservice components log operations <strong>and</strong> transactions. The original caller identity isavailable through the <strong>Security</strong>CallContext object. This is only available if the securitylevel for your application is configured for process <strong>and</strong> component-level checks byusing the following attribute:[assembly: <strong>Application</strong>AccessControl(AccessChecksLevel=AccessChecksLevelOption.<strong>Application</strong>Component)]RemotingThis section identifies the key review points that you should consider when youreview code that uses .NET Remoting. For more information about the issues raisedin this section, see Chapter 13, “Building Secure Remoted Components.”● Do you pass objects as parameters?● Do you use custom authentication <strong>and</strong> principal objects?● How do you configure proxy credentials?

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

Saved successfully!

Ooh no, something went wrong!