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.

310 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sAssembly ImplementationThe following code fragment from assemblyinfo.cs shows the assembly levelmetadata used to configure the COM+ catalog when the serviced componentassembly is registered with Enterprise Services using regsvcs.exe.// (1) Assembly has a strong name.[assembly: AssemblyKeyFile(@"..\..\Customer.snk")]// Enterprise Services configuration[assembly: <strong>Application</strong>Name("CustomerService")][assembly: Description("Customer Services <strong>Application</strong>")]// (2) Server application - runs in dllhost.exe process instance.[assembly: <strong>Application</strong>Activation(ActivationOption.Server)]// (3) Enable component level access checks.// (4) Specify call level authentication.// (5) Specify Identify impersonation level for downstream calls.[assembly: <strong>Application</strong>AccessControl(AccessChecksLevel=AccessChecksLevelOption.<strong>Application</strong>Component,Authentication=AuthenticationOption.Call,ImpersonationLevel=ImpersonationLevelOption.Identify)]The code shown above exhibits the following security characteristics (identified bythe numbers in the comment lines).1. The assembly is strong named. This is a m<strong>and</strong>atory requirement for servicedcomponents. The added benefit from a security perspective is that the assembly isdigitally signed. This means that any modification by an attacker will be detected<strong>and</strong> the assembly will fail to load.2. The application is configured to run as a server application in a dedicated instanceof dllhost.exe. This allows you to specify the least privileged run-as identity atdeployment time.3. The application is configured to support component level access checks. Thisallows you to authorize callers based on role membership at the class, interface,<strong>and</strong> method levels.4. Call level authentication is specified. This means that each method call from aclient is authenticated.5. The impersonation level for outgoing calls from this serviced component to othercomponents on remote servers is set to Identify. This means that the downstreamcomponent can identify the caller but cannot perform impersonation.Note The impersonation level for a calling ASP.NET <strong>Web</strong> application or <strong>Web</strong> service client isspecified on the element in Machine.config on the client <strong>Web</strong> server.

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

Saved successfully!

Ooh no, something went wrong!