Version: 17.07
Encryption and obfuscation can be used in IMonitor-X configurations to prevent specifying sensitive parameter values such as passwords in plain text. The following sections illustrates about the utilities provided with IMonitor-X for these operations and their usage.
In IMonitor-X, the application configuration properties (i.e. properties defined in resources/application.properties
file) can be specified as encrypted values instead of plain text. This can be useful for sensitive properties such as
database user password, LDAP password, etc.
IMonitor-X distribution contains a shell script utility that can be used to encrypt these property values easily by following the below steps.
Navigate to IMonitor-X directory and run the encryption utility
sh bin/encrypt.sh
First provide the value to be encrypted and then followed by the master password to be used for encryption.
----------------- Adroitlogic Property Encryption Utility -----------------
Value to be encrypted: myDBPassword (1)
Master password: APP_PASSWORD (2)
1 | This is the sensitive property value to be encrypted (e.g. Database password) |
2 | This is the master password to be used for encryption. Please note that the same master password must be used for all
encryption operations and the same should be specified as MASTER_PASSWORD in the jetty.sh startup script. |
MASTER_PASSWORD=APP_PASSWORD
usage()
{
...
This will generate an output similar to below.
----ENVIRONMENT-----------------
Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.112-b16
----ARGUMENTS-------------------
input: myDBPassword
password: APP_PASSWORD
----OUTPUT----------------------
Wv1LCmNsJ2ERxaEFJKFoPofFW+QLUGbx
Copy the output value, enclose it inside ENC()
and specify the resulting value in application.properties
file.
spring.datasource.password = ENC(Wv1LCmNsJ2ERxaEFJKFoPofFW+QLUGbx)
In IMonitor-X, the Jetty server configuration properties (i.e. properties defined in etc/jetty.conf
file) can be
specified as obfuscated values instead of plain text. This can be useful for sensitive properties such as
keystore password, truststore password, etc.
IMonitor-X distribution contains a shell script utility that can be used to obfuscate these property values easily by following the below steps.
Navigate to IMonitor-X directory and run the obfuscation utility
sh bin/obfuscate.sh
First provide the value to be obfuscated and then followed by the name of the OS user account under which the application will be executed.
----------------- Adroitlogic Property Obfuscator Utility -----------------
Value to be obfuscated: myKeyStorePassword (1)
Username: adrt (2)
1 | This is the sensitive property value to be obfuscated (e.g. Database password) |
2 | This is the name of the OS user account under which the application will be executed |
This will generate an output similar to below.
OBF:1v8s1vg11vgt1v9u
MD5:2b1f399b9c4f7e15dfe4532f65c945be
CRYPT:myhCBEXB/bj9.
Copy the obfuscated value (the line starting with OBF) and specify it as the property value in configuration file.
jetty.sslContext.keyStorePassword=OBF:1v8s1vg11vgt1v9u