grepplabs / kafka-proxy

Proxy connections to Kafka cluster. Connect through SOCKS Proxy, HTTP Proxy or to cluster running in Kubernetes.
Apache License 2.0
501 stars 87 forks source link

Kafka-proxy for Auditing #35

Open brunodomenici opened 4 years ago

brunodomenici commented 4 years ago

Hi,

I have an auditing/compliance requirement to generate log for auditing for my Kafka Broker. As my service provider doesn't provide it, I'm evaluate to use Kafka-proxy to achieve it.

In my requirements, if I'm able to add username information from SASL and client IP on debug log, something like that:

logrus.Debugf("[%s] Kafka request key %v, version %v, length %v", ctx.username, requestKeyVersion.ApiKey, requestKeyVersion.ApiVersion, requestKeyVersion.Length)

My broker uses SASL PLAIN.

I'm trying to change the code to extract SASL packages on Kafka's API KEY 17 on handleRequest but I cannot re-read src DeadlineReaderWriter, right?

Any ideia/recommendation? I'd love to contribute to the project, besides I'm not a go developer ;-)