+

Search Tips   |   Advanced Search

filter.policy file permissions

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.

Before modifying the filter.policy file, start the wsadmin tool.

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 used when restricting the permission instead of granting permission. The permissions listed in the filter policy file are filtered out from the app.policy file and the was.policy file. Permissions 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 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. We can change the value of the Warn if applications are granted custom permissions option on the Global security panel. It is not recommended that we use the AllPermission permission for the enterprise application.

Some default permissions 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.

We 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 using information from the environment:

(Dist)

set obj [$AdminConfig extract cells/cell/filter.policy c:/temp/test/filter.policy]

(iSeries) (ZOS)

set obj [$AdminConfig extract cells/cell/filter.policy /temp/test/filter.policy]

To check in the policy file, enter using information from the environment:

(Dist) $AdminConfig checkin cells/cell/filter.policy c:/temp/test/filter.policy $obj

(iSeries) (ZOS)

$AdminConfig checkin cells/cell/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 WAS resides at: app_server_root/profiles/profile/config/cells/cell/filter.policy.

(iSeries) The filter.policy file supplied by WAS resides at: profile_root/config/cells/cell/filter.policy.

The file contains these permissions as defaults:

The permissions 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, we only need to add permissions to the filterMask stanza.

WAS relies on the filter policy file to restrict or disallow certain permissions that can compromise the integrity of the system. For instance, WAS considers the exitVM and setSecurityManager permissions as those permissions that most applications never have. If these permissions are granted, the following scenarios are possible:

exitVM A servlet, JSP file, enterprise bean, or other library used by the aforementioned might call the System.exit API and cause the entire WAS process to terminate.
setSecurityManager An application might install its own security manager and either grant more permissions or bypass the default policy that the WAS security manager enforces.

Important: In application code, do not use the setSecurityManager permission to set a security manager. When an application uses the setSecurityManager permission, a conflict exists with the internal security manager within WAS. If we must set a security manager in an application for Remote Method Invocation (RMI) purposes, you also must select the Use Java 2 security to restrict application access to local resources option on the Global security panel within the WAS administrative console. WAS then registers a security manager, which the application code can verify is registered using the System.getSecurityManager API.

For the updated filter.policy file to take effect, restart related Java processes.

  • Start the wsadmin scripting client
  • Configure Java 2 security policy files
  • Migrate, coexist, and interoperate - Security considerations
  • Configure the was.policy file for Java 2 security
  • Use PolicyTool to edit policy files for Java 2 security
  • app.policy file permissions
  • Java 2 security policy files
  • Global security settings