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 HARDWARE

PC that meets .NET SDK minimum requirements

SKILLS REQUIRED

C# and .NET familiarity


CODE ACCESS SECURITY AT A GLANCE

Introduction to CAS

695

  
 

Using Code Access Security Permissions

696

Identity Permissions

697

 

Role-Based Security Permissions

698

 

Code Access Permissions

696

  

CAS Administration

698

  
 

Modifying CAS Policy

698

Adjust Zone Security

701

 

Policy Administration Tools

699

Evaluate Assembly

701

 

Increasing Assembly Trust Levels

700

Creating a Deployment Package

703

 

Writing CAS-Aware Code

704

  
 

Using Imperative Security Syntax

704

Blocking Unwanted Clients

706

 

Using Declarative Security Syntax

705

  

Summary

708

  

Further Reading

709

  




    Visual C#. NET 2003 Unleashed
    Visual C#. NET 2003 Unleashed
    ISBN: 672326760
    EAN: N/A
    Year: 2003
    Pages: 316

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net