Start the Apache Tomcat server using the -security flag.
grant codeBase "file:${catalina.base}/webapps/oxygen-webapp/-" {
// Oxygen uses System properties for various configuration purposes.
permission java.util.PropertyPermission "*", "read,write";
// Oxygen custom protocols need access to network.
permission java.net.NetPermission "*";
permission java.net.SocketPermission "*", "accept,connect,listen,resolve";
// The web framework used by Oxygen Webapp uses reflection and classloaders.
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.lang.RuntimePermission "*";
// Oxygen uses the JVM's java.io.tempdir for various file handling tasks.
permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete";
};
There are cases when Oxygen XML WebApp needs to access files system resources, but, due to security reasons, you want to prevent your users to open them directly in the WebApp's editing page using the file:// protocol.
permission java.io.FilePermission "path/to/yourSecretDir/-", "read,write,delete";
-Dfile.protocol.blacklist=/path/to/yourSecretDir