Clojure: light weight jail -


context:

in lua, it's trivial , cheap (4kb of memory) create new lua vm. thus, it's trivial create cheap lua "jails". then, if untrusted code misbehaves, kill lua vm.

i'm aware of https://github.com/licenser/clj-sandbox appears wrap around java ... make untrusted code thread native java threads, powerless kill.

question:

is there anyway create cheap / light weight clojure jails?

i'm (co)author of little library called clojail kind of rethinking of clj-sandbox. makes use of java sandbox, provides features sandboxing clojure-specific things. tryclj , 4clojure make use of it.

i don't understand mean rest of that. jvm sandbox great in can prevent i/o. clojail goes rest of way allowing timeouts prevent long running code. if you're saying "people create threads , wouldn't able kill them", clojail kills threads created inside of sandbox , best prevent stray threads running away. jvm sandbox (and clojail specific stuff) still prevents dangerous code running on threads well.

in summary, check out clojail. might need. sufficient purposes, , game in town (save clj-sandbox isn't maintained) jails. isn't best solution easiest.

the next step if clojail doesn't need roll own jailing mechanism involves using jvm sandbox , spinning off jvms. has massive overhead, i'd avoid if anyway possible. not in 4kb luatown anymore. ;)


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -