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.security.SecurityPermission "*";
permission java.util.logging.LoggingPermission "control";
permission java.lang.RuntimePermission "*";
// Oxygen requires these permissions in order to connect to an URL.
permission java.net.URLPermission "http:*", "*";
permission java.net.URLPermission "https:*", "*";
permission java.net.URLPermission "file:*", "*";
// Oxygen should be allowed to read JVM jars
permission java.io.FilePermission "${java.home}/-", "read";
// Oxygen uses the JVM's java.io.tempdir for various file handling tasks.
permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete";
permission java.io.FilePermission "${java.io.tmpdir}", "read,write,delete";
// Folder used by oXygen to deploy the plugins to.
permission java.io.FilePermission "${oxygen.data.dir}/-", "read,write,delete";
permission java.io.FilePermission "${oxygen.data.dir}", "read,write,delete";
};
// The jar that contains sandboxing code.
grant codeBase "jar:file:${catalina.base}/webapps/oxygen-webapp/WEB-INF/lib/oxygen-sandbox.jar!/-" {
permission java.security.AllPermission;
};
// Give all permissions to the plugins code unless otherwise instructed by the plugin vendor.
grant codeBase "file:${oxygen.data.dir}/plugins/-" {
permission java.security.AllPermission;
};
// Give all permissions to the frameworks code unless otherwise instructed by the plugin vendor.
grant codeBase "file:${oxygen.data.dir}/frameworks/-" {
permission java.security.AllPermission;
};
There are cases when the Oxygen XML WebApp needs to access files system resources, but due to security reasons, you want to prevent your users from opening them directly in the Oxygen XML WebApp editing page using the file:// protocol.
permission java.io.FilePermission "path/to/yourSecretDir/-", "read,write,delete"; permission java.io.FilePermission "path/to/yourSecretDir", "read,write,delete";
-Dfile.protocol.blacklist=/path/to/yourSecretDir