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 9: Using Code Access <strong>Security</strong> with ASP.NET 249 To call multiple <strong>Web</strong> services from a medium-trust application1. Copy the <strong>Web</strong>_mediumtrust.config file, which is in the following directory, to afile called <strong>Web</strong>_mediumtrust_<strong>Web</strong>Service.config, which is located in the samedirectory.%windir%\Microsoft.NET\Framework\{version}\CONFIG2. Locate <strong>Web</strong>Permission <strong>and</strong> add a element for each server you will beaccessing, as follows:If you call the <strong>Web</strong> service using its NetBIOS) name, DNS name, <strong>and</strong>/or IPaddress, you must have a separate element for each URI as shown in thefollowing example.3. Save the file.4. Update your application’s <strong>Web</strong>.config file to point to the newly created policy file.This requires that you create a new trust level <strong>and</strong> map it to the new policy file.Next, configure the element of your application to use the new level.The following fragment shows the necessary additions to <strong>Web</strong>.config:

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

Saved successfully!

Ooh no, something went wrong!