When deploying Edge on a private cloud, the administrators have access to the java security policy files that govern the things a Java callout can and cannot do when run within a Message Processor. The MP is just a Java app, and the security restrictions that apply to the Java callouts are governed in the standard Java way, via the security policy file. This is described in the Java documentation, here.
For Edge 16.01 and beyond, you can find the security policy for the Message Processor here:
/opt/apigee/edge-message-processor/conf/security.policy
In that file, you will find some existing grants, as well as guidance on how to relax permissions. For example, here’s the restriction on java callouts:
// javacallout code has just read permission in the installed dir and everything below it
grant codeBase "file:${javacallout.dir}/-" {
permission com.apigee.securitypolicy.AllExcept "50";
permission java.io.FilePermission "${javacallout.dir}/-" , "read";
}
So it is not quite right that the Java callout cannot access the filesystem at all. It can access its own installation dir and everything below it. But it IS true that the callout cannot access anything outside that directory.
If you would like to grant broader permissions to all Java callouts, or even to specific Java callouts, you can do so by modifying this file. For example, this will grant read permission on a specific directory to a specific Java callout:
grant codeBase "file:${javacallout.dir}/my-Specific-Callout-1.0.0.jar" {
permission java.io.FilePermission "/opt/san-mount-dir/-" , "read";
}
You could also grant such broader read permissions to all Java callouts, by eliminating the specific jar name in the above and replacing it with a dash.
If you decide to change the security policy file, you will want to use the token-based configuration for OPDK, as described here. The relevant file for the Java security.policy is /opt/apigee/edge-message-processor/source/conf/security-policy.properties .
Specify a new policy file there, and insert the right grants for the javacallout.dir. This makes it possible to preserve your changes, even across upgrades to Apigee Edge.
Be sure to:
- ensure your changes are applied uniformly across all message processors in the cluster
- Restart each MP in your cluster after making modifications