Java™ 2 security uses several policy files to determine the granted permission for each Java program. Java 2 security policy filtering is only in effect when Java 2 security is enabled.
Refer to Protecting system resources and APIs (Java 2 security) for developing applications. The filtering policy defined in the filter.policy file is cell wide. The filter.policy file is the only policy file that is used when restricting the permission instead of granting permission. The permissions that are listed in the filter policy file are filtered out from the app.policy file and the was.policy file. Permissions that are defined in the other policy files are not affected by the filter.policy file.
When a permission is filtered out, an audit message is logged. However, if the permissions that are defined in the app.policy file and the was.policy file are compound permissions like the java.security.AllPermission permission, for example, the permission is not removed. A warning message is logged. If the Issue Permission Warning flag is enabled (default) and if the app.policy file and the was.policy file contain custom permissions (non-Java API permission, the permission package name begins with characters other than java or javax), a warning message is logged and the permission is not removed. You can change the value of the Warn if applications are granted custom permissions option on the Global security panel. It is not recommended that you use the AllPermission permission for the enterprise application.
Some default permissions that are defined in the filter.policy file. These permissions are the minimal ones that are recommended by the product. If more permissions are added to the filter.policy file, certain operations can fail for enterprise applications. Add permissions to the filter.policy file carefully.
You cannot use the Policy Tool to edit the filter.policy file. Editing must be completed in a text editor. Be careful and verify that no syntax errors exist in the filter.policy file. If any syntax errors exist in the filter.policy file, the file is not loaded by the product security runtime, which implies that filtering is disabled.
To extract the filter.policy file, enter the following command using information from your environment:
set obj [$AdminConfig extract cells/cell_name/filter.policy /temp/test/filter.policy]
To check in the policy file, enter the following command using information from your environment:
$AdminConfig checkin cells/cell_name/filter.policy /temp/test/filter.policy $obj
An updated filter.policy file is applied to all of the WebSphere® Application Server enterprise applications after the servers are restarted. The filter.policy file is managed by configuration and file replication services.
Changes made in the file are replicated to other nodes in the cell.
The filter.policy file supplied by WebSphere Application Server resides at: profile_root/config/cells/cell_name/filter.policy.
filterMask {
permission java.lang.RuntimePermission "exitVM";
permission java.lang.RuntimePermission "setSecurityManager";
permission java.security.SecurityPermission "setPolicy";
permission javax.security.auth.AuthPermission "setLoginConfiguration"; };
runtimeFilterMask {
permission java.lang.RuntimePermission "exitVM";
permission java.lang.RuntimePermission "setSecurityManager";
permission java.security.SecurityPermission "setPolicy";
permission javax.security.auth.AuthPermission "setLoginConfiguration"; };
The permissions that are defined in filterMask filter are for static policy filtering. The security runtime tries to remove the permissions from applications during application startup. Compound permissions are not removed, but are issued with a warning, and application deployment is stopped if applications contain permissions that are defined in the filterMask filter, and if scripting is used. The runtimeFilterMask filter defines permissions that are used by the security runtime to deny access to those permissions to application thread. Do not add more permissions to the runtimeFilterMask filter. Application start failure or incorrect functioning might result. Be careful when adding more permissions to the runtimeFilterMask filter. Usually, you only need to add permissions to the filterMask stanza.
For the updated filter.policy file to take effect, restart related Java processes.