problems when using kerberos with invalid keytab and principal #4373
Replies: 3 comments 2 replies
-
If your broker cluster accepts a connection without requiring valid Kerberos credentials, that is an issue with the broker configuration, not with the client. (You cannot prevent a bad actor from, for example, using librdkafka in the configuration you regard as "failing", so it is the responsibility of the server to enforce valid credentials.) Steps you should take
|
Beta Was this translation helpful? Give feedback.
-
OK, so you have confirmed that the records are actually being written. So this means that your issue is not a problem with the client (librdkafka), but with the server. This is not the right place for such a question! It is can be very hard to configure Kerberos authentication, so you are not alone in this, although usually the problem is that clients fail to authenticate and cannot connect. Your problem - broker fails to require authentication - is more unusual. I would strongly recommend that you first try to test authentication using the Java command line clients. You need to get your broker configuration so that a Java client cannot write or read records if it does not authenticate using Kerberos and can read and write if it does authenticate. If you cannot do this, seek help in the support forums for server-side Kafka. When you have got the Java clients working as expected, then test using kafkacat, so that you find out what librdkafka config is required. Finally, you can apply that config to the application you are developing using librdkafka. |
Beta Was this translation helpful? Give feedback.
-
I also get similar kinit errors blatted to the console, despite me having callback for the generic event, which includes a log event. Sometimes my callback gets the text as well and sometimes it doesn't. This means that when there kerberos problem I cannot always find it in the application log. This seems like a tricky area - I mean, do I chase the kerberos people or the librdkafka people? |
Beta Was this translation helpful? Give feedback.
-
I am working for duplicating kudu records to kafka. I use librdkafka.
When I support kerberos in librdkafka according to this page:https://github.com/edenhill/librdkafka/wiki/Using-SASL-with-librdkafka.
I am adding some unit tests for this. Serveral tests:
1, 2 test case is passed. But 3, 4, 5 is failed, although the keytab and principal is invalid, producer write records to kafka success. It's very confused.
Some logs represent 'kinit' commands are failed. But it does not prevent write request to kafka, and kafka receive these records!
I0724 16:41:59.925408 1388917 pending_rounds.cc:171] T 1f39d4455b0a4264acc3d66bd28779f6 P 85e68941416a4322873ddf008ea747b9: Last triggered apply was: 1.4 Starting to apply from log index: 5 kinit: Cannot find KDC for realm "KRBTEST.COMinvalid" while getting initial credentials kinit: Cannot find KDC for realm "KRBTEST.COMinvalid" while getting initial credentials %3|1690188119.931|SASLREFRESH|rdkafka#producer-1| [thrd:main]: Kerberos ticket refresh failed: kinit -R -t "/tmp/kudutest-0/duplication_with_kerberos_kafka-itest.DuplicationWithKerberosKafkaITest.TestInvaildKeytab.1690188107547701-1386211/krb5kdc/[email protected]" -k kafka/[email protected] || kinit -t "/tmp/kudutest-0/duplication_with_kerberos_kafka-itest.DuplicationWithKerberosKafkaITest.TestInvaildKeytab.1690188107547701-1386211/krb5kdc/[email protected]" -k kafka/[email protected]: exited with code 1
I use a simple method to solve this problem. This patch can make 3,4,5 unit tests success.
#4371
I need some help to make sure this problem. If I am correct, I can continue this patch and provide some tests.
If I am not correct, you can help me some usage or other ideas.
Beta Was this translation helpful? Give feedback.
All reactions