instaclustr / cassandra-ldap

LDAP Authenticator for Apache Cassandra
Apache License 2.0
24 stars 16 forks source link

not informative logs in fail scenarios #28

Open victron opened 1 year ago

victron commented 1 year ago

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

3.11

What version of Cassandra LDAP are you using?

v3.11.11-1.0.0

What LDAP server you are using? Any specifics?

osixia/docker-openldap

What did you do?

simple authentication for user test:

getlogginglevels during tests:

[root@cOs ~]# nodetool getlogginglevels

Logger Name                                        Log Level
ROOT                                                    INFO
com.instaclustr.cassandra.ldap                           ALL
com.thinkaurelius.thrift                               ERROR
org.apache.cassandra                                   DEBUG
org.apache.cassandra.auth                                ALL
org.apache.cassandra.exceptions                          ALL
org.apache.cassandra.exceptions.ConfigurationException       ALL
org.apache.cassandra.transport.ServerConnection          ALL

What did you expect to see?

I expecting to see more information in logs about error received from LDAP. Currently it's not clear that problem with password.

What did you see instead?

just:

TRACE [Native-Transport-Requests-1] 2022-09-14 06:36:53,308 PlainTextSaslAuthenticator.java:83 - Decoding credentials from client token
TRACE [Native-Transport-Requests-1] 2022-09-14 06:36:53,309 AbstractCassandraUserRetriever.java:73 - User test does not exist in the Cassandra database.
TRACE [Native-Transport-Requests-1] 2022-09-14 06:36:53,309 Cassandra3CacheDelegate.java:45 - User[username='test', password=redacted, ldapDN='null'] not found in Cassandra
DEBUG [Native-Transport-Requests-1] 2022-09-14 06:36:53,317 DefaultLDAPServer.java:107 - User name is test, going to use filter: (cn=test)
DEBUG [Native-Transport-Requests-1] 2022-09-14 06:36:53,321 DefaultLDAPServer.java:136 - Returning DN: cn=test,dc=example,dc=org
DEBUG [Native-Transport-Requests-1] 2022-09-14 06:36:53,321 DefaultLDAPServer.java:189 - Resolved LDAP DN: cn=test,dc=example,dc=org

During success logging or wrong username on LDAP logs very informative. But during scenario with wrong password or when LDAP server is down logs not informative. Please advice - did I miss any package to enable in logger? In my understanding logs for issues with wrong password and ldap connection should comet from plugin? Please point me if I'm wrong.