Encrypt your confidential information in properties file
generate your private key etl.key
- open the test
ETLConfigSpec
. - replace the path where you want to save the key.
- replace the content which is the encryter password key.
- if you want to use the offset, you can replace to 10 to the number that you want.
- run the test.
Set up it in your env
- upload the key file to hdfs path. eg,
hdfs:///etl/conf/etl.key
- update the properties file in hdfs. eg,
encrpy.keyPath=hdfs:///etl/conf/etl.key
- if you have set a new offset instead of 10, you need to update the properties file in hdfs. eg,
encrypt.offset=11xx
using encrypt command
- prepare
application.properties
:
encrypt.algorithm=PBEWithMD5AndDES
encrypt.keyPath=/path/to/etl.key
- run encrypt command
./gradlew :spark:run --args="encrypt -p file:///path/to/application.properties 'content_to_be_encrypted'"