4.2. Enabling the Java Security Manager

download PDF
Enabling the Java Security Manager (JSM) with the specified policy ensures JBoss Enterprise Application Platform remains protected from any deployed application accidentally or intentionally interfering with its operation.
The policy limits granting full permissions to those jar files included with the evaluated configuration.


You must configure the policy settings as explained in Section 2.5.5, “Java Security Manager Policy File ”. Operating JBoss Enterprise Application Platform using the JSM with different policy settings is not considered to be a certified configuration.
To enable the JSM, you must edit the run.conf (Linux) or run.conf.bat (Windows) file, located in the JBOSS_HOME/bin/ directory.


Read the Java Security Manager chapter in the JBoss Security Guide for complete instructions regarding JSM activation and configuration. Refer back to the Common Criteria Configuration Guide for certification-specific overrides.
Enabling the Java Security Manager

To enable JSM for JBoss EAP add following lines to run.conf:

  • Add this line to enable JSM and set its policy:
  • Add this line to set Java system properties which are referred by the added security policy:
    JAVA_OPTS="$JAVA_OPTS -Djboss.home.dir=$JBOSS_HOME -Djboss.server.home.dir=$JBOSS_HOME/server/production -Djava.protocol.handler.pkgs=org.jboss.handlers.stub"


    Make sure to add the lines exactly as shown including the double equal sign (this orders JSM to use only this policy without combining it with the system policy).
  • Add this line to ensure the security policy persists when an RPM installation is stopped and restarted :
    export JBOSS_HOME=/var/lib/jbossas

4.2.1. Keystore Setup

Because the security policy uses jar file signatures, you need to enable a keystore, which will hold JBoss public keys for signature validation and permission granting to JBoss provided code.
You can create your keystore with a JBoss public key (refer to Section, “Creating New Keystore with the JBoss Public Key”) or use the Java System keystore (refer to Section, “Using the Java System Keystore”) Creating New Keystore with the JBoss Public Key

Follow this procedure to create a keystore with the JBoss public key:
  1. Run the following command to create keystore that contains the JBoss public key:
    keytool -importcert -alias jboss -keystore JBOSS_HOME/server/production/cc.keystore \
    -storepass jbosseap -file JBOSS_HOME/bin/JBossPublicKey.RSA -noprompt \


    The jboss alias must end up in trustedCertEntry. You can check the result with the following keytool command:
    keytool -list -keystore JBOSS_HOME/server/production/cc.keystore -storepass jbosseap
  2. Run this command to create the password file:
    echo jbosseap > JBOSS_HOME/server/production/cc.password
    Password file is a plain file with the password for key store opening (cc.keystore).
  3. Uncomment lines number 6 and 7 of the JBOSS_HOME/bin/security_cc.policy file to enable the keystore:
    keystore "file:${jboss.server.home.dir}/cc.keystore";
    keystorePasswordURL "file:${jboss.server.home.dir}/cc.password";


    The password jbosseap used in Step 1 during key store creation must be the same as the password in the cc.password file. We highly recommend you use a password different than the example password in this guide. Using the Java System Keystore

Follow this procedure to use the Java System keystore:
Run the following command to modify you Java system keystore:
keytool -importcert -alias jboss -keystore JAVA_HOME/jre/lib/security/cacerts \
-storepass changeit -file JBOSS_HOME/bin/JBossPublicKey.RSA -noprompt \
Make sure you are running the command as a user with write permission for the $JAVA_HOME directory. The default password for the cacerts keystore is changeit.


Every change to the Java runtime JBoss public key must be added to cacerts keystore. IBM JRE 1.6 and the Java Security Manager

IBM JRE 1.6 uses a default policy provider which does not work correctly with the JBoss Enterprise Application Platform security policy. You must change the JRE configuration to use the standard policy provider if you want to use IBM JRE 1.6 to host JBoss Enterprise Application Platform with the Java Security Manager enabled.
You do this by editing the file JAVA_HOME/jre/lib/security/ and setting the value of policy.provider to instead of
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.