Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a Java sandbox?

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!

like image 635
corgrath Avatar asked Nov 11 '09 12:11

corgrath


People also ask

What is a Java sandbox?

The Java sandbox is used to provide security for downloading Java applets from the Web. Full-blown Java programs can also be restricted and perform only certain tasks depending on user, company policy and Java Virtual Machine version. See Java, Java applet and sandbox.

What are the elements of Java sandbox?

In a Java programming language, the sandbox is the program area and it has some set of rules that programmers need to follow when creating Java code (like an applet) that is sent as part of a page. The sandbox restrictions provide strict limitations on which system resources the applet can request or access.

What is a Java security manager?

The security manager is a class that allows applications to implement a security policy. It allows an application to determine, before performing a possibly unsafe or sensitive operation, what the operation is and whether it is being attempted in a security context that allows the operation to be performed.


1 Answers

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

like image 126
tangens Avatar answered Sep 30 '22 19:09

tangens