Chapter 34. Code Access Security

IN BRIEF

Code access security (CAS) is one of those necessary technologies that is always there, but never noticed. We write code, compile it, run it, and know that the code works. If the code works properly, we don't often stop and think about the fact that code access security is being used in the background to ensure that managed code is never allowed to do more than it is allowed to do within the current enterprise, network, or computer.

Code access security defines a set of permissions that can be associated with managed code, as well as various ways of creating and querying those associations. It is the plumbing that prevents code downloaded from the Internet from making network requests to any location other than the host from which it was downloaded, and much, much more.

This chapter will introduce you to the key concepts surrounding CAS and give you the information you need so that you will be aware of the limitations imposed on your code by security, and how to write your code so that it takes security into account. You'll see the permissions and permission sets within which your code executes, and you'll see samples of how to create code that is security-aware and code that protects itself from being executed by unauthorized clients.

WHAT YOU NEED

REQUIRED SOFTWARE.NET Framework SDK v1.1 Visual Studio .NET 2003 with C# installed
RECOMMENDED HARDWAREPC that meets .NET SDK minimum requirements
SKILLS REQUIREDC# and .NET familiarity

CODE ACCESS SECURITY AT A GLANCE

Introduction to CAS695  
 Using Code Access Security Permissions696Identity Permissions697
 Role-Based Security Permissions698
 Code Access Permissions696  
CAS Administration698  
 Modifying CAS Policy698Adjust Zone Security701
 Policy Administration Tools699Evaluate Assembly701
 Increasing Assembly Trust Levels700Creating a Deployment Package703
 Writing CAS-Aware Code704  
 Using Imperative Security Syntax704Blocking Unwanted Clients706
 Using Declarative Security Syntax705  
Summary708  
Further Reading709  

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.83.106