detect if .Net security is disabled

  • Thread starter Thread starter Joe Abou Jaoude
  • Start date Start date
J

Joe Abou Jaoude

hi,
Is there a way to detect if code access security is disabled (using
caspol -security off for example)
I know that in COM+ you can detect if role-based security is disabled
using the ContextUtil.IsSecurityEnabled Property. I was wondering if
something similar can be done to detect if code access security is off.

thanks
 
Is there a way to detect if code access security is disabled (using
caspol -security off for example)

Check System.Security.SecurityManager.SecurityEnabled


Mattias
 
thanks Mattias,
problem solved (actually the 2 problems, this one and the public key
problem )

And since SecurityEnabled is not readonly, I just discovered that this
could be a security hole, if an assembly was granted the right to turn
the security off.
 
Joe Abou Jaoude said:
And since SecurityEnabled is not readonly, I just discovered that this
could be a security hole, if an assembly was granted the right to turn
the security off.

The application would need 'SecurityPermission' +
'SecurityPermissionFlag.ControlPolicy' to do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top