.net - Looking for a locked down script interpreter -


i'm looking .net library specific task.

say app has been sent program (in script language) , want app run script. script come openly hostile individual, want run anyway. (like javascript in browser.)

var sc = new securescript("somefilefromanunknownpossiblyhostilesource.xyz"); /* set event handlers. */ sc.run(); 

during run call, script construct it's own data, mess around simple data types, whatever wants long effects contained within it's own world.

if script attempts openfile("c:/windows/something.exe"), fail, because haven't registered openfile function. way script interact outside world using function i've registered use script. doing that, i'm taking responsibility script can't bad it. sure, neglect validate parameters, that's not interpreter's job.

if script allocated memory, or take many cpu cycles, interpreter class invoke event handler once threshold has been passed , give me power stop script dead.

i'm more interested in interpreter being secure rather fast. javascript jit compilers nice, hear of browsers being updated due vulnerability bit liking.

so, there's plea. maybe exists or need build myself. i'd prefer .net/mono library open other platforms.

many thanks.

in other words, need sandbox execution of script.

there native .net mechanism allows that: appdomain permissions.

have @ how to: run partially trusted code in sandbox

however, not enough if want implement machine resource-specific restrictions (memory , cpu). arguably simple way run code in restricted appdomain , limit machine resources consumption use managed addin framework, , particularly addinproccess class (see managing add-ins: advanced versioning , reliable hosting, machine resource exhaustions section).


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -