Re: Checking for SecurityAttributes

From: Ivan Medvedev [MS] (ivanmed_at_online.microsoft.com)
Date: 07/08/03


Date: Mon, 7 Jul 2003 15:07:23 -0700


Sekhmet -
that is right - currently there is no managed classes in the .NET Framework
that you can use to inspect declarative security attributes. There are some
unmanaged interfaces that can do that, or you can use the permview tool
supplied in the SDK.
Looking at your problem though it sounds like the best way to solve it would
be something other than inspecting the attributes. If you need to "sandbox"
an assembly (i.e. restrict its security permissions), the right way to do it
would be creating an AppDomain, dynamically setting its security policy so
that the assembly gets only so much permissions, and loading the assembly
into that AppDomain. That way the assembly will not get more permissions
than you give, no matter what attributes or Asserts it uses.
Hope this helps.
--Ivan
This posting is provided "AS IS" with no warranties, and confers no rights.

"Sekhmet den skammelige" <s@lunarscape.dk> wrote in message
news:%23FmVhikQDHA.4024@tk2msftngp13.phx.gbl...
> If I have an 3. party assembly I load at runtime and would like to make
sure
> it can't assert fx. FileIOPermissions and the way I like to do that is by
> checking if the assembly sets the following attribute:
> [assembly:SecurityPermissionAttribute(SecurityAction.RequestRefuse,
> Assertion = true].
>
>
> Now, I can use the reflection API to see what custom attributes the
assembly
> has, but I can't seem to find a way to make certain that the assembly has
> said SecurityAttribute.
>
> Is it just me that can't seem to find such functionality or is it just not
> possible?
>
>
> -------------------------------------
>
> /kim/sekhmet/birkelund
>
> s@lunarscape.dk
>
>
>
>



Relevant Pages

  • RE: What server hardening are you doing these days?
    ... permissions on their data, and Microsoft encourages ISVs to minimize ... I've been able to discuss ACLs and other security issues in Windows with ... Control or DAC (which is what you're referring to by the "stupid ...
    (Focus-Microsoft)
  • Re: get rid of security center?
    ... I have come up with a solution that does not disable Security Center, ... By changing the Permissions of that key, ... settings from being changed again. ... the firewall alert settings in Security Center get ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Password Protect IExplore
    ... You can protect the files and folders you store on your computer to make ... To set, view, change, or remove special permissions for files and folders ... clear the Inherit from parent the permission entries that apply ... To configure security so that the subfolders and files will not ...
    (microsoft.public.internet.explorer.ieak)
  • Re: Removing the Internet Security in SP2
    ... I have come up with a solution that does not disable Security Center, ... By changing the Permissions of that key, ... settings from being changed again. ... the firewall alert settings in Security Center get ...
    (microsoft.public.windowsxp.security_admin)
  • RE: Any way to remove ADMIN$ only?
    ... partition to allow you to set local permissions. ... Network Security Specialist ... Any way to remove ADMIN$ only? ... default security of Windows drives. ...
    (Focus-Microsoft)