+

Search Tips | Advanced Search

Java Security Manager

The Java Security Manager can be used with any MQIPT feature to provide a further level of security.

MQIPT uses the default Java Security Manager as defined in the java.lang.SecurityManager class. The Java Security Manager feature in MQIPT can be enabled or disabled using the global property SecurityManager. See Global properties for more information.

The Java Security Manager uses two default policy files:

An additional MQIPT policy file can also be used. You should use the MQIPT policy file instead of the default policy files described earlier. See SecurityManagerPolicy in Global properties for more information.

The syntax of the policy file is quite complex and although it can be changed using a text editor, it is usually easier to use the Policy Tool utility provided with Java for making any changes. The Policy Tool utility can be found in the $MQIPT_PATH/java/jre/bin directory and is fully documented within the Java documentation.

A sample policy file (mqiptSample.policy) has been provided with MQIPT to show you what permissions must be set for running MQIPT.

You must edit the sample policy file to match your configuration. In particular, note that the MQIPT home directory (the location of mqipt.conf) might not be the same as the MQIPT installation directory, so take care to specify the correct directories when configuring FilePermission entries in the security policy.

You must change the following entries:

Depending on your configuration, you might also need to add the following entries:

Note: Windows java.io.FilePermission entries must use two backslash characters (\\) for every backslash in the path. This is because a single backslash is used as an escape character.

The sample file assumes that MQIPT has been installed on a Windows system in C:\Program Files\IBM\MQ Internet Pass-Thru. It also assumes that the MQIPT home directory (the location of the mqipt.conf file) is the same as the MQIPT installation directory.

If we have installed MQIPT in another location, you must change the directory in the codeBase definition to refer to your MQIPT installation directory. Take care to include the correct prefix (file:/) and the correct file suffix (/lib/com.ibm.mq.ipt.jar). On UNIX and Linux systems, a typical codeBase URL might be file:/opt/mqipt/lib/com.ibm.mq.ipt.jar, assuming that MQIPT is installed in /opt/mqipt.

Permissions are usually defined with three attributes. To control socket connections, their values are:

Control of the Java Security Manager can also be made through the java.security.manager and java.security.policy Java system properties, but it is recommended we use the SecurityManager and SecurityManagerPolicy properties for controlling MQIPT. To include diagnostic information in trace and FFST records, MQIPT must access certain MQIPT system properties and environment variables. You must always include the following properties in the Java security policy:

permission java.util.PropertyPermission "java.home", "read";
permission java.util.PropertyPermission "java.version", "read";
permission java.util.PropertyPermission "java.runtime.version", "read";
permission java.util.PropertyPermission "java.vm.info", "read";
permission java.util.PropertyPermission "java.vm.vendor", "read";
permission java.util.PropertyPermission "os.arch", "read";
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "os.version", "read";
permission java.lang.RuntimePermission "getenv.MQIPT_PATH";
If we do not include all of these properties, MQIPT will not operate correctly, and problem diagnosis will be impaired.