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.

xvi<strong>Improving</strong> <strong>Web</strong> <strong>Application</strong> <strong>Security</strong>: <strong>Threats</strong> <strong>and</strong> CountermeasuresEnvironment Variables ............................................................................................. 211Constraining Environment Variable Access ............................................................ 211Requesting EnvironmentPermission...................................................................... 211<strong>Web</strong> Services ......................................................................................................... 212Constraining <strong>Web</strong> Service Connections ................................................................. 212Sockets <strong>and</strong> DNS.................................................................................................... 213Constraining Socket Access................................................................................. 213Requesting SocketPermission <strong>and</strong> DnsPermission................................................. 214Unmanaged Code ................................................................................................... 214Use Naming Conventions to Indicate Risk ............................................................. 214Request the Unmanaged Code Permission............................................................ 215S<strong>and</strong>box Unmanaged API Calls............................................................................. 215Use SuppressUnmanagedCode<strong>Security</strong> with Caution ............................................. 216Delegates............................................................................................................... 217Serialization ........................................................................................................... 218Restricting Serialization....................................................................................... 218Summary ............................................................................................................... 219Additional Resources .............................................................................................. 219Chapter 9Using Code Access <strong>Security</strong> with ASP.NET 221In This Chapter ....................................................................................................... 221Overview ................................................................................................................ 221How to Use This Chapter ......................................................................................... 223Resource Access .................................................................................................... 223Full Trust <strong>and</strong> Partial Trust ....................................................................................... 224Configuring Code Access <strong>Security</strong> in ASP.NET ........................................................... 225Configuring Trust Levels....................................................................................... 225Locking the Trust Level ........................................................................................ 226ASP.NET Policy Files................................................................................................ 227ASP.NET Policy ....................................................................................................... 227Inside an ASP.NET Policy File ............................................................................... 228Permission State <strong>and</strong> Unrestricted Permissions .................................................... 229The ASP.NET Named Permission Set .................................................................... 229Substitution Parameters...................................................................................... 230Developing Partial Trust <strong>Web</strong> <strong>Application</strong>s ................................................................. 231Why Partial Trust? ............................................................................................... 231Problems You Might Encounter............................................................................. 231Trust Levels............................................................................................................ 232Approaches for Partial Trust <strong>Web</strong> <strong>Application</strong>s ........................................................... 234Customize Policy..................................................................................................... 235S<strong>and</strong>box Privileged Code ......................................................................................... 236A S<strong>and</strong>boxing Pattern .......................................................................................... 236

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

Saved successfully!

Ooh no, something went wrong!