custom encryption or decryption algorithm for DBCPConnectionPool processor in NIFI

旧巷老猫 提交于 2019-12-13 23:57:12

问题


We are trying to provide custom encryption and decryption algorithm for the password in DBCPConnectionPool controller (build-in processor) in NIFI, instead of build-in algorithms. do we have any approach for that ?


回答1:


If a processor, controller service, or reporting task has a PropertyDescriptor that is marked as sensitive [1] then NiFi automatically encrypts this value when writing it to the flow.xml.gz, and automatically decrypts it when reading the flow.xml.gz.

The key and algorithm for encryption/decryption are controlled via the properties in nifi.properties:

nifi.sensitive.props.key=
nifi.sensitive.props.key.protected=
nifi.sensitive.props.algorithm=PBEWITHMD5AND256BITAES-CBC-OPENSSL
nifi.sensitive.props.provider=BC

If you used context.getProperty(DB_PASSWORD).getValue() it would already return the decrypted value. So I'm not sure why you would need to decrypt it yourself.

[1] https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java#L99



来源:https://stackoverflow.com/questions/50579705/custom-encryption-or-decryption-algorithm-for-dbcpconnectionpool-processor-in-ni

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!