The purpose of password encoding is to deter casual observation of passwords in server configuration and property files. By default, passwords are automatically encoded with a simple masking algorithm in various ASCII WebSphere server configuration files. Additionally, passwords can be manually encoded in properties files used by Java clients and by WebSphere administrative commands.
The default encoding algorithm is referred to as XOR. An alternate OS400 encoding algorithm can be used only with WebSphere Application Server for iSeries and exploits native validation list (*VLDL) objects. With the OS400 algorithm, passwords are stored in encrypted form within a validation list, and the configuration files then contain indexes to the the stored passwords instead of the masked passwords themselves as is done with the XOR algorithm.
Properties of the WebSphere Application Server instance control which algorithm to use for encoding the passwords.
Encoded passwords are of this form:
{algorithm}encoded_password
where {algorithm} is a tag that specifies the algorithm used to encode the password (either XOR or OS400), and encoded_password is the encoded value of the password. When a server or client needs to decode a password, it uses the tag to determine what algorithm to use and then uses that algorithm to decode the encoded password.
Java clients use passwords from the sas.client.props file (which is located in the properties subdirectory of the user instance root, for example /QIBM/UserData/WebSphere/AppServer/V6/Base/profiles/default/properties). To use password encoding with Java clients, the passwords must be manually encoded in the sas.client.props file using the PropFilePasswordEncoder tool.
WebSphere administrative commands use passwords from the soap.client.props file (also located in the properties subdirectory) for SOAP connections, and some administrative commands optionally use passwords from the sas.client.props file (in the properties subdirectory) for RMI connections. To use password encoding with WebSphere administrative commands, the passwords must be manually encoded in the soap.client.props and sas.client.props files using the PropFilePasswordEncoder tool.
What password encoding is not
Whether you select to use the OS400 encoding algorithm or the default encoding algorithm, encoding is not sufficient to fully protect passwords. Native security is the primary mechanism for protecting passwords used in WebSphere configuration and property files.
Issues to consider when using the OS400 password encoding algorithm
There are important issues to consider before deciding to use the OS400 password encoding algorithm:
Note: Do not use the OS400 password encoding algorithm if this setting is not consistent with your iSeries system security policy.
Enabling the OS400 password encoding algorithm for a WebSphere instance
To enable the OS400 password encoding algorithm for a WebSphere instance, perform these steps:
IBM recommends that you use the same validation list object for all WebSphere instances on the iSeries system. An exception would be if you do not backup the objects and data for all instances simultaneously. Consider your backup and restore policy when deciding what validation list object to use for each WebSphere instance.
To set the properties, perform one of these steps:
was_install_root/bin/wasprofile -create -profileName prod -startingPort 10150 -templatePath default -os400passwords -validationlist /QSYS.LIB/QUSRSYS.LIB/WAS.VLDL
For example, if the validation list is created in /QSYS.LIB/WSADMIN.LIB, use the Display Authority (DSPAUT) to check for the minimum required authority:
DSPAUT OBJ('/QSYS.LIB/WSADMIN.LIB')
Then use the Change Authority (CHGAUT) command to grant execute authority to QEJB (only if QEJB does not already have execute authority). For example:
CHGAUT OBJ('/QSYS.LIB/WSADMIN.LIB') USER(QEJB) DTAAUT(*X)
Note: When using the OS400 password encoding algorithm, the Java client is not required to reside on the same iSeries system as the WebSphere server instance that the client accesses.
To create a validation list object, perform these steps with an OS/400 user profile with *ALLOBJ special authority:
CRTVLDL VLDL(WSADMIN/WSVLIST)
CHGAUT OBJ('/QSYS.LIB/WSADMIN.LIB/WSVLIST.VLDL') USER(QEJB) DTAAUT(*RWX)
CHGSYSVAL SYSVAL(QRETSVRSEC) VALUE('1')
Manually encoding passwords in properties files
Use the PropFilePasswordEncoder utility to encode the passwords in properties files. This Qshell script is available in WebSphere Application Server and WebSphere Application Server Network Deployment. To run the script, your user profile must have *ALLOBJ authority.
For example, to encode the passwords for properties in the sas.client.props file for the default WebSphere instance:
/QIBM/ProdData/WebSphere/AppServer/V6/Base/bin/PropFilePasswordEncoder -profileName server1 /QIBM/UserData/WebSphere/AppServer/V6/Base/profiles/default/properties/sas.client.props -SAS
To encode passwords for properties in the soap.client.props file for the default Websphere instance:
/QIBM/ProdData/WebSphere/AppServer/V6/Base/bin/PropFilePasswordEncoder -profileName server1 /QIBM/UserData/WebSphere/AppServer/V6/Base/profiles/default/properties/soap.client.props com.ibm.SOAP.loginPassword,com.ibm.ssl.keyStorePassword,com.ibm.ssl.trustStorePassword
For more information, see The PropFilePasswordEncoder script.
Administration of validation list objects
Validation lists may be shared between multiple WebSphere instances. For example, if you have two instances of WebSphere Application Server, default and prod, both instances may use the validation list /QSYS.LIB/QUSRSYS.LIB/EJSADMIN.VLDL.
You should periodically save your validation list objects along with the other configuration data objects used by WebSphere Application Server. See Backup and recovery: Security for additional information.
Restore or replace damaged validation list objects. To replace a validation list object:
To switch the encoding algorithm for a WebSphere instance:
If a password cannot be decoded, for instance if a password encoding has become corrupted, do the following:
The instance specific setupCmdLine QShell script contains a property that allows you to obtain trace information when using the OS400 algorithm with Java clients and WebSphere administrative commands. To obtain the trace, set os400.security.password.debug=true. The trace is printed to standard output.
For more information, see Protecting plain text passwords.