Java security: Sandboxing plugins loaded via URLClassLoader

后端 未结 3 850
遥遥无期
遥遥无期 2020-12-02 13:36

Question summary: How do I modify the code below so that untrusted, dynamically-loaded code runs in a security sandbox while the rest of the application remains unrestricte

3条回答
  •  执笔经年
    2020-12-02 13:53

    Implementing a SecurityManager is probably the best way to go. You would have to override checkPermission. That method would look at the Permission object passed to it, and determine if a certain action is dangerous. This way you can allow some permissions and disallow other permissions.

    Can you describe the custom SecurityManager you used?

提交回复
热议问题