Bullet-proof groovy script embedding

后端 未结 3 1388
执笔经年
执笔经年 2020-12-28 20:12

I\'m working on a server app that may be extended by user-supplied Groovy scripts. It\'s evident that I want to make sure these scripts run in a very tight sandbox where the

相关标签:
3条回答
  • 2020-12-28 20:55

    An additional possibility is using Groovy 1.8 compilation customizers on the GroovyShell that runs the embedded scripts. You can pre-import classes and methods, restrict use of the Groovy AST, and pre-apply an AST transformation, such as @ThreadInterrupt, @TimedInterrupt, or @ConditionalInterrupt. Details at:

    http://www.jroller.com/melix/entry/customizing_groovy_compilation_process

    0 讨论(0)
  • 2020-12-28 20:58

    Also have a look at the java-sandbox project and the accompanying blog post http://blog.datenwerke.net/2013/06/sandboxing-groovy-with-java-sandbox.html.

    0 讨论(0)
  • 2020-12-28 21:00

    You should have a look at the project groovy-sandbox from kohsuke. Have also a look to his blog post here on this topic and what is solution is addressing: sandboxing, but performance drawback.

    0 讨论(0)
提交回复
热议问题