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.

232 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>s●●●●●●Accessibility.dllMicrosoft.VisualBasic.dllSystem.XML.dllSystem.<strong>Web</strong>.dllSystem.<strong>Web</strong>.Services.dll● System.Data.dllIf your partial-trust application fails because it calls a strong named assembly thatis not marked with APTCA, a generic <strong>Security</strong>Exception is generated. In thiscircumstance, the exception contains no additional information to indicate that thecall failed because of a failed dem<strong>and</strong> for full trust.Permission dem<strong>and</strong>s might start to fail. The configured trust level might not grantthe necessary permission for your application to access a specific resource type.The following are some common scenarios where this could prove problematic:●●●Your application uses the event log or registry. Partial trust <strong>Web</strong> applications donot have the necessary permissions to access these system resources. If yourcode does so, a <strong>Security</strong>Exception will be generated.Your application uses the ADO.NET OLE DB data provider to access a datasource. The OLE DB data provider requires full-trust callers.Your application calls a <strong>Web</strong> service. Partial-trust <strong>Web</strong> applications have arestricted <strong>Web</strong>Permission, which affects the ability of the application to call<strong>Web</strong> services located on remote sites.Trust LevelsIf you plan to migrate an existing application to a partial-trust level, a good approachis to reduce permissions incrementally so that you can see what parts of yourapplication break. For example, start by setting the trust level attribute to High, thenMedium, <strong>and</strong> so on. Ultimately, the trust level you should target depends on thedegree of restriction you want to place on the application. Use the following asguidance:● <strong>Application</strong>s configured for high, medium, low, or minimal trust will be unable tocall unmanaged code or serviced components, write to the event log, accessMessage Queuing queues, or access OLE DB data sources.●●●●<strong>Application</strong>s configured for high trust have unrestricted access to the file system.<strong>Application</strong>s configured for medium trust have restricted file system access. Theycan only access files in their own application directory hierarchy.<strong>Application</strong>s configured for low or minimal trust cannot access SQL Serverdatabases.Minimal trust applications cannot access any resources.

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

Saved successfully!

Ooh no, something went wrong!