We will see the options that we have as to How To Mask - Confidential Info in Kafka Connect Logs. While executing Kafka connector it logs the user credentials. This is not ideal and as such we should try to keep such information off from the Logs . We can do that using below options -
curl -X POST http://localhost:8083/Kafka\_connectors -H "Content-Type: application/json" -d \\
'{
"name": <SOURCE\_NAME>,
"config":{
"connector.class": <CONNECTOR\_CLASS\_NAME> ,
"connection.url": <JDBC\_URL>,
"connection.user": <USER\_NAME> , <----- This will not be logged
"connection.password": <PASSWORD>, <------ This will not be logged
"topic.prefix": <TOPIC\_NAME\_PREFIX>,
}
}'
connection.password = null
USER\_NAME="user1"
USER\_PASSWORD="<jdjjdjfjdwuwujdjkfkfkf>"
config.providers='file'
config.providers.file.class='org.apache.kafka.common.config.provider.FileConfigProvider'
"config":{
"connector.class": <CONNECTOR\_CLASS\_NAME> ,
"connection.url": <JDBC\_URL>,
"connection.user": "${file:/customdetails/user\_details.properties:USER\_NAME}" , <----- This will not be logged
"connection.password": "${file:/customdetails/user\_details.properties:USER\_PASSWORD}" , <------ This will not be logged
"topic.prefix": <TOPIC\_NAME\_PREFIX>,
}
Hope this helps you How To Mask - Confidential Info in Kafka Connect Logs. Additional Read -