By default, Orchestrator restricts JavaScript access to a limited set of Java classes. If you require JavaScript access to a wider range of Java classes, you must set an Orchestrator system property to allow this access.

About this task

Allowing the JavaScript engine full access to the Java virtual machine (JVM) presents potential security issues. Malformed or malicious scripts might have access to all of the system components to which the user who runs the Orchestrator server has access. Consequently, by default the Orchestrator JavaScript engine can access only the classes in the java.util.* package.

If you require JavaScript access to classes outside of the java.util.* package, you can list in a configuration file the Java packages to which to allow JavaScript access. You then set the com.vmware.scripting.rhino-class-shutter-file system property to point to this file.

Procedure

  1. Create a text configuration file to store the list of Java packages to which to allow JavaScript access.

    For example, to allow JavaScript access to all the classes in the java.net package and to the java.lang.Object class, you add the following content to the file.

    java.net.*
    java.lang.Object
  2. Save the configuration file with an appropriate name and in an appropriate place.
  3. Navigate to the following folder on the Orchestrator server system.

    Option

    Action

    If you installed the standalone version of Orchestrator

    Go to install_directory\VMware\Orchestrator\app-server\conf.

    If you downloaded and deployed the virtual appliance

    Go to /etc/vco/app-server/.

  4. Open the vmo.properties configuration file in a text editor.
  5. Set the com.vmware.scripting.rhino-class-shutter-file system property by adding the following line to the vmo.properties file.
    com.vmware.scripting.rhino-class-shutter-file=path_to_your_configuration_file
  6. Save the vmo.properties file.
  7. Restart the Orchestrator server.

Results

The JavaScript engine has access to the Java classes that you specified.