Posit the following situation:
You can put the code in a funny classloader, and use a customised security policy like the applet runner does. But there are still problems:
The system as a whole should be protected from malicious code - eg spawning loads of threads, eating all the cpu up, allocating too much memory.
The mooted idea at the beginning of the millenium was JSR-121. Isolates were meant to bring most of the benefits of process isolation - limits on cpu usage, thread spawning, heap usage : resource allocation in general.
Given that this effort was seemingly abandoned by Sun, what is the closest we can currently get?
So far, my ideas are:
Are there any better or existing ways to do this?
This is a complex question. My first thought was to create a domain-specific language that does what the 'mobile' users need. The DSL would have no capability to perform a dangerous operation.
Who are the people that would be uploading untrusted code? This sounds like a dubious idea to begin with. We spend a lot of effort making sure people can't run untrusted code ;-)
The problem is that the only real way to isolate a process is to have a dedicated machine/hardware. Anything else you do, you will have to make compromises. Depending on what those compromises are acceptable, depends on whether it is practice to share a JVM with that code.
This is not a problem you can solve for the general case in a trivial manner because you want to protect against things you haven't thought (which others might think of one day)
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