What is the best way to execute sandboxed Java code?
Asked Answered
P

2

7

I am trying to reproduce an API for executing Java (like ideone.com has), but so far I'm having a lot of difficulties running Java sandboxed (SELinux sandbox doesn't work).

I've heard about the SecurityManager, but I'm trying to figure out what's the easiest way to run Java code in a sandbox (kind of like a Java applet running in the browser), instead of writing my own jail server using the SecurityManager.

Prorate answered 28/5, 2013 at 8:51 Comment(1)
what about this answer, seems like that's you need?: #9192993Eyed
S
1

You might want to take a look at the java-sandbox project [1] which aims at providing a simple interface to execute untrusted code.

[1] http://blog.datenwerke.net/p/the-java-sandbox.html

Shitty answered 31/5, 2013 at 21:37 Comment(0)
K
1

The SecurityManager is designed for this purpose. You'll need to create a policy file to restrict access, as described here: Policy Files, then enable it at runtime for just the code you're trying to sandbox.

Krucik answered 30/5, 2013 at 17:12 Comment(0)
S
1

You might want to take a look at the java-sandbox project [1] which aims at providing a simple interface to execute untrusted code.

[1] http://blog.datenwerke.net/p/the-java-sandbox.html

Shitty answered 31/5, 2013 at 21:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.