Encrypting configuration files in Payment Feature Services
To help protect sensitive configuration information, several Payment Feature Services components support the use of properties and configuration files that are encrypted. Payment Feature Services provides an encryption utility to help the user create these encrypted files.
Overview
- .ena
- The file is encoded with AES.
- .enp
- The file is encoded with PBEWithMD5AndDES.
- .enc
- The file is encoded with DES.
- .en3
- The file is encoded with triple DES (DES3).
In addition, almost all of the components support partial encoding of their configuration properties. For partial encoding, use the newConfigurationFile property of a plain text configuration file to specify the name of an encrypted properties file. The configuration values from the encrypted file are added to, or override, the values from the plain text properties file. Users can use this property to keep their secure information, such as user IDs and passwords, separate from the rest of their basic configuration properties. For example, the user can use the encryption utility to create a file that is called mysecure.properties.en3 that contains only the user ID and password properties that are needed to access the database. To use this secure properties file for a component that supports partial encoding, update the plain text properties file for that component to set the value of newConfigurationFile to mysecure.properties.en3.
The Business Rules, Gateway Server, and Transaction Server configuration files have placeholders that are replaced with real values when the
associated container is started. These placeholders cannot be replaced when the configuration file is
encrypted. If you need to encrypt your configuration file, replace the placeholders with the actual values for
the properties before you encrypt the file. For example, replace the placeholder for the database password
with the actual password in the dbConnectPwd = %DBPASS% line of the configuration file. If
the database password is mydbpass, the database password line in the configuration file needs to be
dbConnectPwd = mydbpass.
| Component name | Files supported | Algorithms supported |
|---|---|---|
| Business Rules Server |
|
|
| Data Setup Utility |
|
|
| Business Rules Manager |
|
|
| Gateway Server |
|
|
| Transaction Server |
|
|
Installing and configuring the utility to use with Red Hat OpenShift
- dsu.zip
- j2se-config.zip
- For the Business Rules Server, get the j2se-brs-jars.zip compressed file.
- For the Business Rules Manager, get the j2se-brm-jars.zip compressed file.
- For the Gateway Server, get the j2se-gateway-jars.zip compressed file.
- For the Transaction Server, get the j2se-its-jars.zip compressed file.
Connect to the Red Hat® OpenShift® environment and get the compressed files that you need from the artifacts container. Use a user ID with the permissions that are needed for the project where your FTM offering is deployed. For more information about getting the compressed files, see Getting the files from the artifacts container for your FTM offering.
- The path for Linux® is extract_directory/dsu/Base/utilities/Encryption/unix/encode.sh.
- Set FTM_JRE_HOME to extract_directory/dsu/_jvm64/jre.
- Set FTM_LIB_DIR to the path to the library files that you extracted for the Payment Feature Services component. For example, if you extracted the compressed file for Gateway Server, set FTM_LIB_DIR to extract_directory/j2se-gateway-jars/shared/v405/pfs/Gateway/lib.
Running the utility
Encode propertiesFile [-OUT=outputFilename -ALG=encryptionAlgorithm]| Parameter | Values | Description |
|---|---|---|
| ? | Displays the help text for the utility. | |
| propertiesFile | A user-specified file name | The name of the properties or configuration file to be encrypted. The file name can be specified with a full or relative path. |
| -OUT=outputFilename | For this parameter, outputFilename is a user-specified file name. | The name of the encrypted properties or configuration file that is created by the utility. By default,
the utility appends the file extension for the encryption algorithm to the end of the file name that is
provided in the propertiesFile parameter. Use this parameter to specify a different name
for the encrypted file. This parameter is optional. Notes:
|
| -ALG=encryptionAlgorithm | For this parameter, encryptionAlgorithm is one of the values that are shown in the
following list:
|
By default, the utility uses the DES algorithm. To use triple DES instead, specify this parameter as
either DES3 or DESede. Triple DES (DES3) encryption is considered more secure than the default single DES
encryption. This parameter is optional. Notes:
|
| -klen=keylength | For this parameter, keylength is a user-specified length. | The length of the key to use for the encryption. This parameter is required only when the encryption algorithm is AES or PBE (PBEWithMD5AndDES). |
| -pass=passphrase | For this parameter, passphrase is a user-specified password. | The passphrase to use when the properties or configuration file is encrypted. If this parameter is specified without its passphrase, the user is prompted for a passphrase. |
| -MODE=mode | Any mode that is supported by the algorithms that are listed in Table 1 are valid. | The mode that is used by the algorithm during encryption and decryption. The mode is usually the value
in the middle of the transformation string for the cipher: DES/ECB/PKCS5Padding.This parameter is optional, but it is required when the padding type is specified. ECB is the default mode for DES, DES3, and AES. CBC is the default mode for PBE. |
| -PAD=padding | Any padding type that is supported by the algorithms that are listed in Table 1 are valid. | The padding type that is used by the algorithm during encryption and decryption. The padding type is
usually the value at the end of the transformation string for the cipher:
DES/ECB/PKCS5Padding.This parameter is optional, but it is required when the mode is specified. PKCS5Padding is the default padding type. |
Update the Red Hat OpenShift application secret with the encryption parameters
If you use the passphrase, mode, or padding parameters to encrypt your configuration file, you also need to
update the application secret for your FTM installation. Set the value of the
J2SE_PROPERTIES_ENCR_PARAMS key to the encryption utility parameter string that you used to encrypt the
Business Rules, Gateway Server, and Transaction Server properties files.
For example, if you used all of these parameters when the file was encrypted, the parameter string has the
following format: -pass=passphrase -mode=mode
-pad=padding
For more information about the application secret that has the J2SE_PROPERTIES_ENCR_PARAMS key, see Create an application secret for your FTM installation on Red Hat OpenShift.
Example of encrypting properties for Red Hat OpenShift containers
- Ensure that the encryption utility is installed and configured. For more information, see Installing and configuring the utility to use with Red Hat OpenShift. For this example, /tmp/artifacts is used as the directory where you extracted the compressed files to.
- In this example, some sensitive values in the Gateway Server properties file are being encrypted, so extract the j2se-gateway-jars.zip file to the /tmp/artifacts directory.
- Go to j2se-config/gw directory, which is where the Gateway Server
configuration file template is located.
cd /tmp/artifacts/j2se-config/gw - Create a file for the properties that are to be encrypted. The following table shows the default names
that are used for the encrypted properties files for each Payment Feature Services component.
Table 3. Default source file names for the encrypted properties Payment Feature Services component Encrypted properties source file name Business Rules Server configBR_secret.properties Business Rules Manager pdmconfig_secret.properties Gateway Server izxconfig_secret.properties Transaction Server configITS_secret.properties - Identify which properties that you want to encrypt and add the name and value pairs for those properties
to the new izxconfig_secret.properties file that you created. In this example, only the
dbConnectPwd database password property is to be encrypted, so add the following line
with your database password to the
file.
dbConnectPwd = yourdb2pass - Encrypt the file by running the utility. The encrypted file for Gateway Server is created in
the /tmp/artifacts/j2se-config/gw/
directory.
The following table shows the default DES encrypted properties file names for the Payment Feature Services components./tmp/artifacts/dsu/Base/utilities/Encryption/unix/encode.sh /tmp/artifacts/j2se-config/gw/izxconfig_secret.propertiesTable 4. Default DES-encrypted properties file names Payment Feature Services component Encrypted properties file name Business Rules Server configBR_secret.properties.enc Business Rules Manager pdmconfig_secret.properties.enc Gateway Server izxconfig_secret.properties.enc Transaction Server configITS_secret.properties.enc - In the /tmp/artifacts/j2se-config/gw directory, update the Gateway Server sample configuration property file that you want to use.
- Remove the properties that you moved to the encrypted properties file. In this example, you can remove the database password property, dbConnectPwd.
- Remove the comment from the following line with the newConfigurationFile
property.
Verify that the path to the encrypted file is correct by checking where the file is on the# newConfigurationFile = /opt/ibm/ftm/j2se-gw-config/izxconfig_secret.properties.encpv-ftm-applicationpersistent volume.
- Copy your updated sample configuration file from the /tmp/artifacts/j2se-config/gw directory to the configmap for the Gateway Server. The Gateway Server uses this configuration file, which has no database password property, and uses the encrypted properties file that was specified in the newConfigurationFile property. For more information about providing configuration files in a configmap, see Customizing the configuration files in a ConfigMap.
- Copy the /tmp/artifacts/j2se-config/gw/izxconfig_secret.properties.enc encrypted configuration file to the same configmap that you copied your updated sample configuration file to.
- Use the Red Hat OpenShift Container Platform to restart the Gateway Server pods so that they all use the updated configuration file.
- Verify that the configuration file was updated correctly. In the Gateway Server pods, display the Gateway Server configuration file to make sure that it does not contain the dbConnectPwd property. The properties files are located in the /opt/ibm/ftm/shared/v405/pfs/Gateway/properties directory.