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!
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.
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.
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.
You are looking for a security manager. You can restrict the permissions of an application by specifying a policy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With