Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use kafka acls?

My version of kafka is 0.9.0.1 and I have two brokers: 192.168.1.100, 192.168.1.101 which are using ssl to authenticate and encrypt.

I had a topic named test09 and client ip is 192.168.1.102

When i add an acl with the command line interface like this:

bin/kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --deny-principal User:* --deny-host 192.168.1.102 --operation Read --topic test09

the consumer from 192.168.1.102 can still get data.

Can someone tell me how to use ACLs in kafka?

like image 917
LiGa Avatar asked Mar 03 '16 10:03

LiGa


People also ask

Where does Kafka store ACLs?

Currently, ACLs are stored on ZK under path /kafka-acl/<resource-type>/<resource-name>. For example: ACLs for topic 'topicName' will be stored under '/kafka-acl/Topic/topicName'. ACLs for consumer group 'group:Id' will be stored under '/kafka-acl/Group/group:Id'.

What does Kafka ACL stand for?

Access Control Lists (ACLs) provide important authorization controls for your enterprise's Apache Kafka® cluster data.

How do you remove ACLs in Kafka?

You can use the --remove flag of kafka-acl tool, which removes all the acls applied to the topic. Simply loop the command through all the topics. Show activity on this post. You can use kafka-acls --bootstrap-server kafka:9092 --remove --topic * .

How does Kafka authentication work?

Kafka uses SASL to perform authentication. It currently supports many mechanisms including PLAIN , SCRAM , OAUTH and GSSAPI and it allows administrator to plug custom implementations. Authentication can be enabled between brokers, between clients and brokers and between brokers and ZooKeeper.


1 Answers

I believe you have missed to add the below property in Server.properties

authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer

-- Adding this line would enable the ACL to work via SimpleAclAuthorizer. -- Kafka by default comes with the kafka.security.auth.SimpleAclAuthorizer defined by the parameter authorizer.class.name.

You can try the below setup which might give complete idea.

https://github.com/Symantec/kafka-security-0.9

like image 66
supermonk Avatar answered Sep 19 '22 07:09

supermonk