Re: Securely Calling Unknown Assembly
From: Shel Blauman [MSFT] (sheldonb_at_online.microsoft.com)
Date: 11/21/03
- Next message: Joe Kaplan \(MVP - ADSI\): "Re: Code Acess Security"
- Previous message: Shel Blauman [MSFT]: "Re: mscorcfg / permissions / message queues"
- In reply to: Paul Wheeler: "Securely Calling Unknown Assembly"
- Next in thread: Pent: "Re: Securely Calling Unknown Assembly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 21 Nov 2003 08:21:00 -0800
You can run the assembly in an AppDomain with a restricted grant set, but
done properly it's a bit of a chore. My preference is to run my trusted app
in a folder I've granted all permission to but Assert, then using a
combination of PermitOnly and Deny to restrict permissions for called code.
You need to run in an assert-free environment to prevent luring attacks from
untrusted libraries that assert permissions they want, such as
FileIOPermission. Just create a permission set that has all permissions but
assert, then create a code group using URL membership condition that grants
that permission set to the folder you'll be running in. That technique lets
you use Intellisense to develop your code without the bother of using
reflection.
Shel
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Paul Wheeler" <pmw4328@rit.edu> wrote in message news:elhEcIAsDHA.2444@TK2MSFTNGP12.phx.gbl... > I have a program for which I want to be able to load preset. A preset is > essentially an Assembly which contains a class which inherits from a > provided base class. I load the assembly from the dll file, and instantiate > the class using reflection. Obviously I don't want a preset doing something > like viewing/editing/deleting files, since a preset could come from > anywhere. So, the question is, Is it possible to specify that the Assembly > should be treated as being under a more restricted policy, such as internet, > even though it's stored on the local hardrive. The only solution I've come > up with is to wrap every call to the Assembly in deny or permitonly calls > (which is a real pain). Is there a simpler solution? > > Thanks Much, > -Paul Wheeler > >
- Next message: Joe Kaplan \(MVP - ADSI\): "Re: Code Acess Security"
- Previous message: Shel Blauman [MSFT]: "Re: mscorcfg / permissions / message queues"
- In reply to: Paul Wheeler: "Securely Calling Unknown Assembly"
- Next in thread: Pent: "Re: Securely Calling Unknown Assembly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|