filter.policy file permissions

 

+

Search Tips   |   Advanced Search

 

 

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.

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 Secure administration, applications, and infrastructure 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/filter.policy c:/temp/test/filter.policy]

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

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

An updated filter.policy file is applied to all of the WAS 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 that is supplied by WAS resides at...

app_server_root/profiles/profile/config/cells/cell/filter.policy

This fill contains these permissions as defaults:

 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. 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, JavaServer Pages file, enterprise bean, or other library that is 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.

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 set a security manager in an application for RMI purposes, you also must select the Use Java 2 security to restrict application access to local resources option on the Secure administration, applications, and infrastructure panel within the console. WAS then registers a security manager, which the application code can verify is registered by using the System.getSecurityManager API.

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


 

Related tasks

Migrating, coexisting, and interoperating – Security considerations
Configure the was.policy file
Use PolicyTool to edit policy files
Configure Java 2 security policy files

 

Related Reference


app.policy file permissions
Java 2 security policy files
Secure administration, applications, and infrastructure settings