WAS v8.5 > Tune performance > Tune security > Tune, hardening, and maintaining security configurations > Secure passwords in files

Enable custom password encryption

You need to protect passwords that are contained in your WebSphere Application Server configuration. After creating your server profile, we can added protection by creating a custom class for encrypting the passwords.

Create your custom class for encrypting passwords. For more information, see Plug point for custom password encryption.

To enable custom password encryption.

  1. Add the following system properties for every server and client process. For server processes, update server.xml for each process. Add these properties as a genericJvmArgument argument preceded by a -D prefix.
    com.ibm.wsspi.security.crypto.customPasswordEncryptionClass=
           com.acme.myPasswordEncryptionClass
    com.ibm.wsspi.security.crypto.customPasswordEncryptionEnabled=true

    Regarding the wsadmin client, if we use wsadmin in connected mode, this property needs to be set in the deployment manager or server connected using AdminTask.setJVMSystemProperties command or through the console. If we use wsadmin in local mode (conntype=NONE), we can set the property with a javaoption command option, as shown below:

    wsadmin -conntype none -lang jython -javaoption
    -Dcom.ibm.wsspi.security.crypto.customPasswordEncryptionClass=<encryptionClassToUse>

    If the custom encryption class name is com.ibm.wsspi.security.crypto.CustomPasswordEncryptionImpl, it is automatically enabled when this class is present in the classpath. Do not define the system properties listed previously when the custom implementation has this package and class name. To disable encryption for this class, specify com.ibm.wsspi.security.crypto.customPasswordEncryptionEnabled=false as a system property.

  2. Choose one of the following methods to configure the WAS runtime to load the custom encryption implementation class:

    • Place the custom encryption class in a JAR file that resides in the ${WAS_INSTALL_ROOT}/classes directory, which we have created.

      WAS does not create the ${WAS_INSTALL_ROOT}/classes directory. For more information on the classes directory, see the topic, "Creating a classes subdirectory in your profile for custom classes".

    • Place the custom encryption class in a JAR file that resides in the ${WAS_HOME}/lib/ext directory.

  3. Restart all server processes.
  4. Edit each configuration document containing a password and save the configuration. All password fields are then run through the WSEncoderDecoder utility, which calls the plug point when it is enabled. The {custom:alias} tags are displayed in the configuration documents. The passwords, even though they are encrypted, are still Base64-encoded. They seem similar to encoded passwords, except for the tags difference.
  5. Encrypt any passwords that are in client-side property files using the PropsFilePasswordEncoder (.bat or .sh) utility. This utility requires the properties listed previously are defined as system properties in the script to encrypt new passwords instead of encoding them.
  6. To decrypt passwords from client JVMs, add the properties listed previously as system properties for each client utility.
  7. Ensure that all nodes have the custom encryption classes in their class paths prior to enabling this function.


Results

Custom password encryption is enabled.

If custom password encryption fails or is no longer required, see Disable custom password encryption.


Subtopics


Related concepts:

Plug point for custom password encryption


Related


Secure passwords in files


+

Search Tips   |   Advanced Search