I am collecting the data from different resources, each resource has one specific topic for each client. I want to give the access for each user only to the corresponding topic, so they can't have access to all the topics. I am working with Kafka 0.10 and I am using Kafka tools. there is solution?
Asked
Active
Viewed 1,250 times
1

Giorgos Myrianthous
- 36,235
- 20
- 134
- 156

Aymen Rahal
- 53
- 1
- 7
-
https://www.openpolicyagent.org/docs/latest/kafka-authorization/ – OneCricketeer Jan 24 '20 at 14:52
1 Answers
2
You need to configure Authorisation using ACL.
How to enable ACL:
In your server.properties
file, you need to create an Authorizer
by adding the following line:
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
Now you need to follow the docs in order to properly configure ACL based on your use cases.
Adding ACLs
Now once everything is in place, let's assume you have a topic called testTopic
to which you want to grant read and write access only to user called Bob
from a host with IP 197.5.6.1
:
bin/kafka-acls --authorizer-properties zookeeper.connect=localhost:2181 \
--add \
--allow-principal User:'Bob' --allow-host '197.5.6.1' \
--operation Read --operation Write \
--topic testTopic \

Giorgos Myrianthous
- 36,235
- 20
- 134
- 156