Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assembly Evidence

What is the purpose of the following piece of code?:

object[] hostEvidence = {new Zone(SecurityZone.Internet)}; 
Evidence internetEvidence = new Evidence(hostEvidence, null);
AppDomain myDomain = AppDomain.CreateDomain("MyDomain");
myDomain.ExecuteAssembly("SecondAssembly.exe", internetEvidence);

As far as I know the CLR automatically (It asks Windows for it) assigns the Zone depending on where the assembly is run from (local machine, internet ect...). I am guessing that it was meant to decrease the permissions for the assembly but when we have two evidences we also have two code groups which are summed within a given policy level.

Kind Regards PK

like image 890
pkolodziej Avatar asked Nov 15 '22 16:11

pkolodziej


1 Answers

According to the .NET Framework foundation book (I've not yet quite memorised it for the exam), Evidence is either user specified (.NET Configuration Tool) or Developer specified. So in this way you are explicitly defining the Zone that you need.

I'm not aware of the CLR automatically assigning zones though I might be wrong.

like image 170
Ian Avatar answered Dec 31 '22 19:12

Ian