PC Review


Reply
Thread Tools Rate Thread

Plug-ins and security?

 
 
Jesper
Guest
Posts: n/a
 
      10th Apr 2005
Im creating a host application (a game) which allows for users to supply a
custom computer AI. This will be in the form of a plugin assembly which
supports a specified interface. So the host will call interface functions in
the plugins like PerformMove(GameState gs). The host application is a
trusted application that runs on a server, and users upload plugins to this
server, but I can't trust the plugins.

PlugIn:
- Must adhere to a specific public interface.
- Is allowed to create and maintain private state information, to be used
between calls.
- Is not allowed access to I/O, Networks, Other processes, etc.
- Will recieve some objects by reference form the host, but has only read
capabilities on these objects. If this is not possible, it will recieve
objects by value only.

Host:
- Can kill any plugin process/thread that takes too long time.
- Can kill any plugin process/thread that takes too much memory (or maybe
limit the allowed memory size at creation of the plugin process?)
- In order to allow the host enough control over the plugin to be able to
kill it, I expect to have to run the plugin functions in a different thread
or process.

I'm pretty new to security, so how would you set up these plugins,
securitywise?


 
Reply With Quote
 
 
 
 
Joshua Flanagan
Guest
Posts: n/a
 
      10th Apr 2005
The Code Access Security model of the .NET Framework allows you to do
this pretty easily. You will want to create a separate AppDomain to
load your plugin assemblies. You can specify limited permissions for
all code executing in the AppDomain. You then communicate with your
plugin code using .NET Remoting.

See the documentation for AppDomain.SetAppDomainPolicy for a hint on how
to get started:

http://msdn.microsoft.com/library/de...olicytopic.asp

Joshua Flanagan
http://flimflan.com/blog


Jesper wrote:
> Im creating a host application (a game) which allows for users to supply a
> custom computer AI. This will be in the form of a plugin assembly which
> supports a specified interface. So the host will call interface functions in
> the plugins like PerformMove(GameState gs). The host application is a
> trusted application that runs on a server, and users upload plugins to this
> server, but I can't trust the plugins.
>
> PlugIn:
> - Must adhere to a specific public interface.
> - Is allowed to create and maintain private state information, to be used
> between calls.
> - Is not allowed access to I/O, Networks, Other processes, etc.
> - Will recieve some objects by reference form the host, but has only read
> capabilities on these objects. If this is not possible, it will recieve
> objects by value only.
>
> Host:
> - Can kill any plugin process/thread that takes too long time.
> - Can kill any plugin process/thread that takes too much memory (or maybe
> limit the allowed memory size at creation of the plugin process?)
> - In order to allow the host enough control over the plugin to be able to
> kill it, I expect to have to run the plugin functions in a different thread
> or process.
>
> I'm pretty new to security, so how would you set up these plugins,
> securitywise?
>
>

 
Reply With Quote
 
 
 
 
Jesper
Guest
Posts: n/a
 
      10th Apr 2005
Thanks. At first glance, it seems like just what I am looking for.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: It goes on and on and on and on and never ends! Alias Windows Vista General Discussion 2 23rd Jul 2008 03:32 AM
ICS and XP and ADSL Router and Wireless and XBox ! Jim Windows XP General 3 31st Aug 2007 10:26 PM
HP2000C and point and print and XP and windows 2000 Steevo@my-deja.com Microsoft Windows 2000 Printing 4 9th Dec 2004 12:34 AM
HP2000C and point and print and XP and windows 2000 Steevo@my-deja.com Microsoft Windows 2000 Printing 0 7th Dec 2004 06:56 PM
Outlook 2002 crashes over and over and over and over and over and over typoo Microsoft Outlook Discussion 5 7th Mar 2004 08:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:01 PM.