c# - Running a .Net application in a sandbox -


over months, i've developed personal tool i'm using compile c# 3.5 xaml projects online. basically, i'm compiling codedom compiler. i'm thinking making public, problem is -very-very- easy on server tool.

the reason want protect server because there's 'run' button test , debug app (in screenshot mode).

is possible run app in sandbox - in other words, limiting memory access, hard drive access , bios access - without having run in vm? or should analyze every code, or 'disable' run mode?

spin appdomain, load assemblies in it, interface control, activate implementing type, call method. don't let instances cross appdomain barrier (including exceptions!) don't 100% control.

controlling security policies external-code appdomain bit single answer, can check link on msdn or search "code access security msdn" details how secure domain.

edit: there exceptions cannot stop, important watch them , record in manner assemblies caused exception not load them again.

also, better inject second appdomain type use loading , execution. way ensured no type (that won't bring down entire application) cross appdomain boundary. i've found useful define type extends marshalbyrefobject call methods on executes insecure code in second appdomain. should never return unsealed type isn't marked serializable across boundary, either method parameter or return type. long can accomplish 90% of way there.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -