configurepolicy - Configure a security policy file for the perfagent

SYNOPSIS

configurepolicy [ options ] template_file policy_file
options
Command-line options.
template_file
This file contains a policy file with special property-like expansion variables that are converted by the program. Any symbols recognized by the configuration tool are replaced with their substitution strings. Any symbols not recognized by the tool are passed through unmodified.
policy_file
This file contains a translated version of the template file with the various variables replaced by their substitution strings. The resulting file is generally ready for use with the perfagent RMI server.

DESCRIPTION

The configurepolicy converts a template file into a working policy file for use with the perfagent RMI server. The tool will recognize certain property-like symbols in the template file and substitute their expansion strings. Any unrecognized symbols are passed through unmodified.

The configurepolicy tool recognizes the following symbols:

${jvmstat.home.url}
The jvmstat.home.url property will be expanded to a file: URL that locates the directory containing the jvmstat installation.
${jvmstat.tmpdir}
The jvmstat.tmpdir property will be expanded to the native, escaped path to the temporary directory for the Java Virtual Machine as indicated in the java.io.tmpdir system property. The path that is substituted for this property will be expressed in terms of path expressions for the native operating system. Any backslash characters found in the path are converted to a sequence of two backslash characters in the output file, allowing proper parsing by default policy file parser.

The jvmstat distribution ships with three template files:

PerfAgentAll.tmpl
A template file that assigns All Permissions to the code bases used by the perfagent RMI server. This file does not need to be edited to generate a working policy file.

PerfAgentMinimal.tmpl
A template file that assigns a minimal set of permissions to the code bases used by the perfagent RMI server. The connect, accept, and resolve java.net.SocketPermission permissions are setup to allow connections from any host. This file does not require editing to generate a working policy file.

PerfAgentTrustedHost.tmpl
A template file that assigns a minimal set of permissions to the code bases used by the perfagent RMI server. The connect, accept, and resolve java.net.SocketPermission permissions are setup to allow connections only from the localhost. If access is to be limited to the localhost, then this file does not need to be edited to generate a working policy file. However, to grant access to other trusted hosts, additional edits are required.

The configuration of the policy file is dependent upon the jvmstat installation directory. If the jvmstat installation directory is changed without reconfiguring a new policy file based on the new installation directory, the perfagent server process will terminate by throwing a Security exception.

The configuration of the policy file for the Windows platform is dependent upon the value of the TMP and TEMP environment variables. If these variables are not set, the configuration of the policy file may also be dependent upon the version of the Windows operating system, as different versions use different default temporary directories. If these variables are changed, a new policy file must be configured or the perfagent server process will throw a Security exception on startup.

OPTIONS

There are no options to this command.

EXAMPLES

This section gives examples on how to use the configurepolicy command.

Configuring a policy file

This example uses the PerfAgentAll.tmpl file to configure a policy file for the perfagent server. This example assumes that the J2SE bin directory and the jvmstat distribution's bin directory (bat directory on Windows) are included in the PATH environment variable. It also assumes that a copy of the PerfAgentAll.tmpl file is in the current directory.

% configurepolicy PerfAgentAll.tmpl PerfAgent.policy

SEE ALSO


Copyright © 2003 Sun Microsystems, Inc. All Rights Reserved.

Sun
Java Software