Create topic policy

Learn how to grant privileges to a Machine User for accessing and modifying Kafka topics using the Ranger web UI. You must create a new policy, select the Machine User, and add permissions for the Machine User.

You must have created a Machine User, granted environment access to the Machine User, and created two Kafka topics.
  1. Navigate to Management Console > Environments, and select the environment where your Kafka cluster is running.
  2. Click Ranger on the top pane to open the Ranger web UI.
  3. In the Ranger web UI, click Access Manager > Resource Based Policies.
  4. Under the KAFKA group, select the policy of your Kafka cluster.

    To select it, click on the policy name, and not on the icon. You see the list of pre-defined policies for your Kafka cluster.

  5. Click Add New Policy to create a new policy and enter the following details:
    • Policy Name: Machine Data topics
    • Topic: machine-data*
    • Description: All topics prefixed with machine-data
  6. Below the Allow Conditions section, click the empty Select Users box and select the Machine User you created.
  7. Click Add Permissions, select the Publish, Consume, and Describe permissions, and then click the tick mark.
  8. Scroll to the bottom of the page and click Add to save the policy.