views:

33

answers:

1

Hi guys,

I am studying the Code Access Security of .NET 2.0. My current understanding is as below:

The basic mechanism of the CAS is for the CLR to collect certain evidences from the assembly, and then use the evidence and policy to work out a permission set for the assembly's code. And the assembly's code can do nothing beyond that permission set.

Evidence is used to classify certain assembly into certain code group, and permission set is given on a code group granularity.

There're several types of evidence can be collected by the CLR at runtime.

It is easy to determine evidence such as Application Directory, GAC, Hash, Strong Name.

But how to determine evidence such as Publisher, Site, Zone, URL? Where are these evidence data stored? Are they part of the assembly's metadata? I don't think that evidence like Zone or Site should be part of the metadata.

Many thanks.

+2  A: 

The following page does the best that I can find of explaining how this information is obtained

The summary is that much of this information is not on the assembly itself but provided by the hosting environment of the CLR. Examples of hosts include

  • The Browser
  • ASP.Net
  • Shell Host (normal applications)

These host themselves provide the information about Site, Zone, etc ... to the CLR for a given assembly.

JaredPar
Wasn't CAS kinda removed/obsoleted in .NET 4.0 because almost nobody was using it ?
Petar Repac
@Peter: CAS is still quite alive in .NET 4.0. However, the CLR itself no longer imposes CAS policy. Instead, CAS policy is imposed solely by hosts such as ASP.NET and IE. For details, see http://blogs.msdn.com/b/shawnfa/archive/2010/02/24/so-is-cas-dead-in-net-4-or-what.aspx.
Nicole Calinoiu
@Nicole: +1 for answer. Tnx
Petar Repac