[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Caspol to adjust security

LeBouns

10/21/2002 1:35:00 PM

Hi,

I need to adjust .NET security so it trust the trusted
sites.

I can do that, on my machine, by:
- caspol.exe -cg 1.5 FullTrust

Where 1.5 is the Trusted zone label.

But labels are different on other machines (and I need to
use caspol programmaticaly, on several machines)

Do you know a way to change the security of the trusted
zone, or a way to programmaticaly know the Trusted zone
label?

Thanks a lot ;)

LeBouns

P.S. : sorry if my English isn't perfect
1 Answer

Jeff Schwartz [MS]

10/23/2002 1:01:00 AM

0

LeBouns

I inquired with a peer and he gave me the following response.

You can run caspol -lg to get a list of the groups, and do a regex match. I
don't know if there is a commandline switch to caspol to do that. The
Trusted zone should by default be 1.5 though, unless you've removed code
groups from the default security policy. If he wants to have the same
security policy for all machines, he can configure it once in the .NET
Configuration tool (mscorcfg.msc), and then right click on the Runtime
Security Policy folder and you can make an MSI that can be run on all the
other machines to deploy the policy.

If he wants to do it from managed code, you can iterate over the security
policy by using the SecurityManager object. That has a method that's
something to the effect of EnumerateLevels or something. When you go over
each level, you can grab its security policy, and go through the code groups
there until you find the one with the Trusted zone membership condition, and
modify it there. Then use the SecurityManager object to save the policy
again, and that would work as well.

I hope that this helps.

Jeff Schwartz

Please do not send email directly to this alias. This alias is for newsgroup
purposes only

"LeBouns" <malek.aitouaret@laposte.net> wrote in message
news:41e401c278fe$595ba600$39ef2ecf@TKMSFTNGXA08...
> Hi,
>
> I need to adjust .NET security so it trust the trusted
> sites.
>
> I can do that, on my machine, by:
> - caspol.exe -cg 1.5 FullTrust
>
> Where 1.5 is the Trusted zone label.
>
> But labels are different on other machines (and I need to
> use caspol programmaticaly, on several machines)
>
> Do you know a way to change the security of the trusted
> zone, or a way to programmaticaly know the Trusted zone
> label?
>
> Thanks a lot ;)
>
> LeBouns
>
> P.S. : sorry if my English isn't perfect