Error when accessing Topic using principal.builder.class #6460
-
I am using my own user principle class using principal.builder.class (logic as discussed on other thread is to CN=[email protected],O= Test Bank ,DC=test,DC=com use only [email protected] The kafka cluster is up and running and looking at error logic of custom principal is working: 2022-03-03 08:43:25,857 INFO Principal = User: uklonvd907100.uk.db.com is Denied Operation = Describe from host = 127.0.0.6 on resource = Topic:LITERAL:kafka-cert-topic for request = Metadata with resourceRefCount = 1 (kafka.authorizer.logger) [data-plane-kafka-request-handler-3] Topic yaml: apiVersion: kafka.strimzi.io/v1beta2 user Yaml: apiVersion: kafka.strimzi.io/v1beta1 what is going wrong any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 21 replies
-
Sorry for formatting of yaml. no clue why its all crumble up when i submit. let me see if I can upload the file directly |
Beta Was this translation helpful? Give feedback.
-
Sorry for the formatting earlier. Trying to upload from my personal laptop, As suggested I removed the authentication section from the KafkaUser resource: my manifest look like but still getting same error: 2022-03-03 08:43:25,857 INFO Principal = User: uklonvd907100.uk.db.com is Denied Operation = Describe from host = 127.0.0.6 on resource = Topic:LITERAL:kafka-cert-topic for request = Metadata with resourceRefCount = 1 (kafka.authorizer.logger) [data-plane-kafka-request-handler-3] |
Beta Was this translation helpful? Give feedback.
-
Hi @scholzj sorry should have pasted the correct log on my first post. I am indeed trying to access my-topic Apologies. Now I have updated the principal builder to give the user the right name with the CN= prefix ... the yaml used are as attached but still seeing same error: 2022-03-03 13:48:50,633 INFO Principal = User:CN=uklonvd907100.uk.db.com is Denied Operation = Describe from host = 127.0.0.6 on resource = Topic:LITERAL:my-topic for request = Metadata with resourceRefCount = 1 (kafka.authorizer.logger) [data-plane-kafka-request-handler-7] |
Beta Was this translation helpful? Give feedback.
-
sorry, not done this in past, any help or any documentation as what need to be done ? ACL is one bit which is holding us from going Live, so any help would be much appreciated |
Beta Was this translation helpful? Give feedback.
-
@scholzj when I use below configs for broker , type: custom for authentication ... I am assuming this is how the setup need to be while we set custom class,
will the KafkaBrokerConfigurationBuilder.java be using the below code? Just looking I may need to set few listener config to make the broker authentication to work? |
Beta Was this translation helpful? Give feedback.
-
@scholzj I am trying to run the ACL as you suggested since I dont have full access, I am trying to run kubectl exec as below kubectl exec -it my-cluster-kafka-2 -- /opt/kafka/bin/kafka-acls.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --list --topic my-topic here my-cluster-kafka-bootstrap:9092 is running a Plain listener. Not sure what I am missing on the command? is there any alternative way to run commands on a pod?. Getting below error: Error while executing ACL command: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: describeAcls |
Beta Was this translation helpful? Give feedback.
-
Just noticed - this error on LOG of kafka. does this mean anything more :-) I have not created user - User:my-cluster-kafka 2022-03-08T11:03:32.757351651Z2022-03-08 11:03:32,757 INFO Principal = User:my-cluster-kafka is Denied Operation = ClusterAction from host = 240.0.26.97 on resource = Cluster:LITERAL:kafka-cluster for request = UpdateMetadata with resourceRefCount = 1 (kafka.authorizer.logger) [control-plane-kafka-request-handler-0] |
Beta Was this translation helpful? Give feedback.
-
Well, that suggests that your Principal Builder class does not work properly. This is one of the users used internally by Strimzi -> these need to have the original user names. Otherwise the cluster will not sync and the operators will not work. |
Beta Was this translation helpful? Give feedback.
-
@scholzj CN=my-cluster-kafka,O=io.strimzi is this principal instance of X500Principal? do you know at all? |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the support @scholzj Made it to work. if any one is interested : code which worked for ssl make sure this is added to so that strimzi internal acl and functions are not affected. if (!(principal instanceof X500Principal) || principal == KafkaPrincipal.ANONYMOUS) { |
Beta Was this translation helpful? Give feedback.
Thanks for all the support @scholzj Made it to work.
if any one is interested : code which worked for ssl make sure this is added to so that strimzi internal acl and functions are not affected.
if (!(principal instanceof X500Principal) || principal == KafkaPrincipal.ANONYMOUS) {
return new KafkaPrincipal(KafkaPrincipal.USER_TYPE, principal.getName());
}