4.6.  Apply appropriate application and resource security settings (e.g., Java 2 security, SIBus security).


Using Policy Tool to edit policy files for Java 2 security

Java 2 security uses several policy files to determine the granted permission for each Java program. The Java Development Kit provides the Policy Tool tool to edit these policy files. This tool is recommended for editing any policy file to verify the syntax of its contents. Syntax errors in the policy file cause an AccessControlException exception when the application runs, including the server start. Identifying the cause of this exception is not easy because the user might not be familiar with the resource that has an access violation. Be careful when you edit these policy files.

List of available Java 2 security policy files:

  1. Start the Policy Tool.

    For example, you can enter the following command at a Linux command prompt:

    test317:~ # cd /opt/IBM/WebSphere/AppServer/java/jre/bin
    test317:/opt/IBM/WebSphere/AppServer/java/jre/bin # ./policytool

    Figure 4.29. 

    The Policy Tool window opens. The tool looks for the java.policy file in your home directory.

  2. Click File > Open.

  3. Navigate the directory tree in the Open window to pick up the policy file that you need to update. After selecting the policy file, click Open. The code base entries are listed in the window.

    Figure 4.30. 

  4. Create or modify the code base entry.

    Figure 4.31. 

  5. Modify or add the permission specification.

    1. Modify the permission specification by double-clicking the entry that you want to modify, or by selecting the permission and clicking Edit Permission. The Permissions window opens with the selected permission information.

    2. Add a new permission by clicking Add Permission. The Permissions window opens. In the Permissions window are four rows for Permission, Target Name, Actions, and Signed By.

    Figure 4.32. 

  6. Select the permission from the Permission list. The selected permission displays. After a permission is selected, the Target Name, Actions, and Signed By fields automatically show the valid choices or they enable text input in the right text input area.

    Figure 4.33. 

  7. Click OK to close the Permissions window. Modified permission entries of the specified code base display.

  8. Click Done to close the window. Modified code base entries are listed. Repeat the previous steps until you complete editing.

  9. Click File > Save after you finish editing the file.

A policy file is updated. If any policy files need editing, use the Policy Tool utility. Do not edit the policy file manually. Syntax errors in the policy files can potentially cause application servers or enterprise applications to not start or function incorrectly. For the changes in the updated policy file to take effect, restart the Java processes.

Professional hosting         Free 'Oracle Certified Expert Web Services Developer 6' Guide     Free SCDJWS 5.0 Guide