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.

226 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sTable 9.1 Restrictions Imposed by the ASP.NET Trust LevelsASP.NETTrust Level Main RestrictionsFullUnrestricted permissions. <strong>Application</strong>s can access any resource that is subject tooperating system security. All privileged operations are supported.HighNot able to call unmanaged codeNot able to call serviced componentsNot able to write to the event logNot able to access Microsoft Message Queuing queuesNot able to access OLE DB data sourcesMediumLowMinimalIn addition to the above, file access is restricted to the current application directory<strong>and</strong> registry access is not permitted.In addition to the above, the application is not able to connect to SQL Server <strong>and</strong>code cannot call CodeAccessPermission.Assert (no assertion security permission).Only the execute permission is available.Locking the Trust LevelIf a <strong>Web</strong> server administrator wants to use code access security to ensure applicationisolation <strong>and</strong> restrict access to system level resources, the administrator must be ableto define security policy at the machine level <strong>and</strong> prevent individual applicationsfrom overriding it.<strong>Application</strong> service providers or anyone responsible for running multiple <strong>Web</strong>applications on the same server should lock the trust level for all <strong>Web</strong> applications.To do this, enclose the element in Machine.config within a tag,<strong>and</strong> set the allowOverride attribute to false, as shown in the following example.You can also use a path attribute on the element to apply a configurationto a specific site or <strong>Web</strong> application that cannot be overridden. For more informationabout the element, see Chapter 19, “Securing Your ASP.NET <strong>Application</strong><strong>and</strong> <strong>Web</strong> Services.”

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

Saved successfully!

Ooh no, something went wrong!