How do I create a Java sandbox?

corgrath picture corgrath · Nov 11, 2009 · Viewed 30.6k times · Source

I want to make my application to run other people's code, aka plugins. However, what options do I have to make this secure so they don't write malicious code. How do I control what they can or can not do?

I have stumbled around that JVM has a "built in sandbox" feature - what is it and is this the only way? Are there third-party Java libraries for making a sandbox?

What options do I have? Links to guides and examples is appreciated!

Answer

tangens picture tangens · Nov 11, 2009

You are looking for a security manager. You can restrict the permissions of an application by specifying a policy.