Question Authors' Forum

Java security

Picture of Vladimir Ilyin
Re: Java security
by Vladimir Ilyin - Tuesday, 8 November 2016, 4:12 AM

CodeRunner has parameter Sandbox-Option
So we can run java programs with But it has not work for me.

But we can use SecurityManager this way 

public class __Test__ {
        System.setSecurityManager(new SecurityManager());
    } //... }
{{ STUDENT_ANSWER | replace({'public class ': 'class '}) }}

I think this code is safe enough.

Аnd it is a very weak protection disallow imports, but we cal filter any using of standart packages by twig replace function.

Hope this information will be useful for somebody.