showuon opened a new pull request, #15280:
URL: https://github.com/apache/kafka/pull/15280

   When client authenticate failed, the server will log with: the client IP 
address only. The the IP address sometimes cannot represent a specific user, 
especially if there is proxy between client and server. Ex:
   
   ```
   INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication 
with /127.0.0.1 (channelId=127.0.0.1:9093-127.0.0.1:53223-5) (Authentication 
failed: Invalid username or password) (org.apache.kafka.common.network.Selector)
   ```
   
   If there are many failed authentication log appeared in the server, it'd be 
better to identify who is triggering it. Adding the client info to the log is a 
good start. This PR adds the user info in the log if any. After this PR, the 
log will be like this:
   ```
   INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication 
with /127.0.0.1 (channelId=127.0.0.1:9093-127.0.0.1:54700-0) (Authentication 
failed: Invalid username or password for user {abc}) 
(org.apache.kafka.common.network.Selector)
   ```
   
   No tests added because only log info added.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to