[
https://issues.apache.org/jira/browse/KAFKA-10615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152303#comment-18152303
]
Qingjun Wu edited comment on KAFKA-10615 at 11/28/26, 3:55 AM:
---------------------------------------------------------------
I'd like to pick this up. PR #9445 took the same direction but was auto-closed
as stale without review. I've prepared
a small patch that includes the client-supplied username in the PLAIN
`SaslAuthenticationException` messages
(e.g. `Authentication failed for user <name>: Invalid username or password`),
with tests. The username is the
client's own value and already flows back to that client, and bad-username vs
bad-password still return identical
text, so this doesn't enable username enumeration; the password is never
included. I'll open a PR against trunk
shortly. Credit to the earlier attempt in #9445.
New PR#24429 is built on top of PR#9445.
was (Author: JIRAUSER315724):
I'd like to pick this up. PR #9445 took the same direction but was auto-closed
as stale without review. I've prepared
a small patch that includes the client-supplied username in the PLAIN
`SaslAuthenticationException` messages
(e.g. `Authentication failed for user <name>: Invalid username or password`),
with tests. The username is the
client's own value and already flows back to that client, and bad-username vs
bad-password still return identical
text, so this doesn't enable username enumeration; the password is never
included. I'll open a PR against trunk
shortly. Credit to the earlier attempt in #9445.
> Plain authentication failure log detail
> ---------------------------------------
>
> Key: KAFKA-10615
> URL: https://issues.apache.org/jira/browse/KAFKA-10615
> Project: Kafka
> Issue Type: Improvement
> Components: security
> Affects Versions: 2.4.1
> Reporter: Gérald Quintana
> Priority: Major
>
> When using the PlainLoginModule and a client application is providing a wrong
> password, you get endless error logs telling:
> {code:java}
> [2020-10-15 07:00:05,263] INFO [SocketServer brokerId=4] Failed
> authentication with myhost.mycompany.fr/192.168.35.194 (Authentication
> failed: Invalid username or password)
> (org.apache.kafka.common.network.Selector)
> [2020-10-15 07:00:06,400] INFO [SocketServer brokerId=4] Failed
> authentication with myhost.mycompany.fr/192.168.35.194 (Authentication
> failed: Invalid username or password)
> (org.apache.kafka.common.network.Selector){code}
>
> When this client is running in Kubernetes the hostname and IP have no meaning
> because they represent the Kubernetes host. So it's very hard for us to find
> the misconfigured application.
> I'd like to have the username in the error message so as to make it easier to
> find the source of the error.
> From a security a point view it may be interesting to know that a given user
> is used to brute force a password or may have been pawned.
> I seems easy to do it in
> [https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/plain/internals/PlainSaslServer.java#L107]
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)