其他分享
首页 > 其他分享> > ranger kafka - Authorizing Kafka access over non-authenticated channel via Ranger

ranger kafka - Authorizing Kafka access over non-authenticated channel via Ranger

作者:互联网

Authorizing Kafka access over non-authenticated channel via Ranger

This section answers some questions one is likely to encounter when trying to authorize access to Kafka over non-authenticated channel. This Kafka feature is available in HDP releases 2.3.4 (Dal-M20) or later.

Can I authorizer access to Kafka over a non-secure channel via Ranger?

Yes. you can control access by ip-address.

Can I authorize access to Kafka over non-secure channel by user/user-groups?

No, one can’t use user/group based access to authorize Kafka access over a non-secure channel.  This is because it isn't possible to assert client’s identity over the non-secure channel.

What is a recommended way to set-up policies when trying to control access to Kafka over a non-secure channel?

Ensure that all Brokers nodes have Kafka Admin access.  This is a mandatory step.  If you don’t perform this step then your cluster won’t work properly.

Screen Shot 2015-12-10 at 6.41.01 PM.png

Ensure publishers have appropriate access.

Screen Shot 2015-12-10 at 6.44.11 PM.png

Ensure consumers have appropriate access. Same process as publishers except change access type to Consume instead or Produce.

Screen Shot 2015-12-10 at 6.45.24 PM.png

Why do we have to specify public user group on all policies items created for authorizing Kafka access over non-secure channel?

What are the specific things to watch out for when setting up authorization for accessing Kafka over non-secure channel?

I have the policies as specified above, however, I am still not able to consume over an non-authenticated channel using bin/kafka-console-consumer.sh script that is a part of the Kafka distribution!  The consumer hangs and gives the error message “No brokers found in ZK.”  What gives?

I can’t edit the /etc/kafka/conf/kafka_client_jaas.conf file!  What should I do to consume kafka messages over an non-authenticated channel?

Why do I need to edit the /etc/kafka/conf/kafka_client_jaas.conf file?

Presence of Client block in /etc/kafka/conf/kafka_client_jaas.conf for service zookeeper causes the console consumer connect to zookeeper in  secure mode.  To do so it needs a ticket -- which won’t exist in simple auth mode, so it fails.

Authorizing topic creation

This section describes the issues one might encounter while trying to authorize topic creation in Kafka using Ranger.

Can I authorizer topic creation via Ranger?

Yes, but only if the topic is being auto-created by consumers or producers.

What is the recommended policy setup to authorize topic auto-creation for producers or consumers?

Can I authorize topic auto-creation for producers or consumers that connect over non-authenticated channel?

Why do I have to grant create access to all topics (via *) to allow for auto-creation to work for producers and/or consumers?

Topic creation is currently a cluster level privilege.  Thus it requires access privileges over all topics in a cluster, i.e. *.

I want to allow topic auto creation for any topic that starts with finance, e.g. finance_1finance_2, etc. to users that are part of Finance user group.  But I don’t want them to be able to auto create topics that start with other strings, say, marketing_123.  Can I model this sort of an authorization in Ranger Kafka plugin?

I am using the Kafka supplied console consumer to test topic auto creation by a consumer, but it is not working.  Shouldn’t the new topic get auto-created the moment I startup the consumer?  I have verified the recommended policy setup as indicated above!  What gives?

Make sure that you specify the following two argument to the console consumer.

Most common way of creating topic involves using the bin/kafka-tpics.sh script that is a part of the Kafka distribution.  Can I authorize topic creation via that mechanism?

No.

Why can’t I authorize topic creation done via the bin/kafka-tpics.sh script!?

So what are my options to authorize topic creation via the bin/kafka-tpics.sh script?

Is there a Ranger plugin for Zookeeper?

Not yet.

Where can I learn more about Kafka’s support for publish/consume over non-authenticated channel?

Please refer to KAFKA-1809 which implemented the multiple listeners Design.

标签:topic,non,via,authenticated,over,Kafka,access,channel
来源: https://www.cnblogs.com/felixzh/p/12259436.html