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.

342 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sSpecifically, examine the element in the .wsdl file <strong>and</strong> verify that itpoints to the expected location. If you use Visual Studio .NET to add a <strong>Web</strong> referenceby using the Add <strong>Web</strong> Reference dialog box, scroll down <strong>and</strong> check the serviceendpoints.Finally, whether you use Visual Studio.NET to add a <strong>Web</strong> reference or manuallygenerate the proxy code using Wsdl.exe, closely inspect the proxy code <strong>and</strong> look forany suspicious code.Note You can set the URL Behavior property of the <strong>Web</strong> service proxy to Dynamic, which allowsyou to specify endpoint addresses in <strong>Web</strong>.config.Code Access <strong>Security</strong> ConsiderationsCode access security can limit the resources that can be accessed <strong>and</strong> the operationsthat can be performed by your <strong>Web</strong> service code. An ASP.NET <strong>Web</strong> service is subjectto ASP.NET code access security policy, configured by the <strong>Web</strong> service’s element..NET Framework consumer code that calls a <strong>Web</strong> service must be granted the<strong>Web</strong>Permission by code access security policy. The precise state of the<strong>Web</strong>Permission determines the range of <strong>Web</strong> services that can be called. Forexample, it can constrain your code so that it can only call local <strong>Web</strong> services orservices on a specified server.If the consumer code has full trust, it is granted the unrestricted <strong>Web</strong>Permissionwhich allows it to call any <strong>Web</strong> service. Partial trust consumer code is subject to thefollowing limitations:● If you call a <strong>Web</strong> service from a Medium trust <strong>Web</strong> application, by default you canonly access local <strong>Web</strong> services.● Consumer code that uses the WSE classes must be granted full trust.For example, if your <strong>Web</strong> service proxy classes derive fromMicrosoft.<strong>Web</strong>.Services.<strong>Web</strong>ServicesClientProtocol, which is provided by theWSE, full trust is required. To use WSE from a partial trust <strong>Web</strong> application, youmust s<strong>and</strong>box calls to the <strong>Web</strong> service.For more information about calling <strong>Web</strong> services from partial trust <strong>Web</strong> applications,see Chapter 9, “Using Code Access <strong>Security</strong> with ASP.NET.” For more informationabout <strong>Web</strong>Permission, see the “<strong>Web</strong> Services” section in Chapter 8, “Code Access<strong>Security</strong> in Practice.”

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

Saved successfully!

Ooh no, something went wrong!