Setting up Ranger authorization for Cloudera Streams Messaging

Set up Apache Ranger authorization for Kafka, Kafka Connect, and Schema Registry after deploying Cloudera Streams Messaging to grant end users access, both directly and through Cloudera Surveyor.

After deployment, Ranger allows only the internal communication that Cloudera Streams Messaging requires. The deployment creates default Ranger policies for this communication. The Ranger policy manager users configured during deployment also have full access, regardless of policies. Other end users and the client applications that run as those users have no access to Kafka, Kafka Connect, or Schema Registry. Cloudera Surveyor shows no data, and management actions, such as creating topics, are not possible. You must onboard end users by granting them access in Ranger.

Kafka, Kafka Connect, and Schema Registry each have their own Ranger service, which holds all of their policies, including the default policies created during deployment. Ranger policies can be configured in many ways. The following steps are an example of a basic configuration. You add a single user to every default policy in each of the three Ranger services, which gives that user full access to Kafka, Kafka Connect, and Schema Registry. You can repeat the steps for every user who needs full access, or configure access with your own policies instead.

The default policies differ between the Ranger services, because Kafka, Kafka Connect, and Schema Registry support different resources and permissions. Policy manager users are configured separately for each Ranger service during deployment. If you followed the recommendations in the deployment guide, the same users manage all three Ranger services. However, the users can differ. In that case, sign in as the matching policy manager user before you configure each Ranger service.

  • You deployed and have access to an instance of Cloudera Streams Messaging, if not see Deploying Cloudera Streams Messaging.

  • You know the users configured in the Ranger Policy Manager Users field of the Kafka, Kafka Connect, and Schema Registry engines, and you can sign in to Anywhere Cloud Console as these users. In typical deployments, the same users are configured for all three engines.

  • You know the Anywhere Cloud Console login username of the user that you want to grant access to.

  1. Sign in to Anywhere Cloud Console as a Ranger policy manager user.
  2. Open the Apache Ranger Admin UI.
    1. In Anywhere Cloud Console, go to Admin Center > Apps > Deployed Engines.
    2. Find and click the entry for your Cloudera Unified Data Fabric instance.
    3. In the Endpoints table, click the URL in the udfAuthzUI row to open the Ranger Admin UI.
  3. Add the user to the default Kafka policies.
    1. Go to Settings > Service Manager and find the Kafka section.
    2. Click the name of your Kafka Ranger service.

      The default Ranger service name is kafka-[***BLUEPRINT INSTANCE NAME***]. If you specified a different name in the Ranger Service Name field during deployment, look for that name instead. The access policies page opens. The default Kafka policies are the following:

      • every-topic
      • every-consumergroup
      • every-cluster
      • every-transactionalid
      • every-delegationtoken
    3. In the Policy ID column, click the ID of a default policy.
    4. In the Allow rules section, add a new rule.
    5. In Select Users, select the user.
    6. In Permissions, add all permissions.
    7. Click Save.
    8. Repeat these substeps for each remaining default Kafka policy.
  4. Add the user to the default Kafka Connect policies.
    1. Go to Settings > Service Manager and find the Kafka Connect section.
    2. Click the name of your Kafka Connect Ranger service.

      The default Ranger service name is connect-[***BLUEPRINT INSTANCE NAME***]. If you specified a different name in the Ranger Service Name field during deployment, look for that name instead. The access policies page opens. The default Kafka Connect policies are the following:

      • every cluster
      • every connector
    3. In the Policy ID column, click the ID of a default policy.
    4. In the Allow rules section, add a new rule.
    5. In Select Users, select the user.
    6. In Permissions, add all permissions.
    7. Click Save.
    8. Repeat these substeps for each remaining default Kafka Connect policy.
  5. Add the user to the default Schema Registry policy.
    1. Go to Settings > Service Manager and find the Schema Registry section.
    2. Click the name of your Schema Registry Ranger service.

      The default Ranger service name is sr-[***BLUEPRINT INSTANCE NAME***]. If you specified a different name in the Ranger Service Name field during deployment, look for that name instead. The access policies page opens. The default Schema Registry policy is every resource.

    3. In the Policy ID column, click the ID of the every resource policy.
    4. In the Allow rules section, add a new rule.
    5. In Select Users, select the user.
    6. In Permissions, add all permissions.
    7. Click Save.

The user has full access to Kafka, Kafka Connect, and Schema Registry, both through Cloudera Surveyor and through client applications that use credentials the user requested. Policy changes might take a few minutes to appear in Cloudera Surveyor.

  • Access Cloudera Surveyor as the user that you added to the policies. In Anywhere Cloud Console, go to Streams Messaging > [***SURVEYOR INSTANCE***].

    The name of the Cloudera Surveyor instance starts with the Blueprint Instance Name that you specified when you deployed Cloudera Streams Messaging.

    If the setup is successful, you see your Kafka cluster when you go to Clusters, and your Kafka Connect cluster when you go to Connect Clusters. On a new deployment, the clusters do not have topics or connectors yet. When you go to Schemas, the Schemas List is empty because no schemas are registered yet.

    To learn more about Cloudera Surveyor, see Get started with Cloudera Surveyor.

  • Connect Kafka clients to your cluster. See Connecting Kafka clients.

  • Learn about the authorization model and Ranger permissions of Kafka, Kafka Connect, and Schema Registry. See the following resources:

  • Learn more about managing Ranger policies. See Policy management and audit with Ranger.