For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pl/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pl/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/analytics/kafka-configure-acl.md.
Przejdź do treści

Kafka - How to use Access Control Lists (ACLs)

Pokaż jako Markdown

Find out how to grant topic and Schema Registry permissions to your Kafka users with Access Control Lists (ACLs)

Objective

Apache Kafka is an open-source, distributed event streaming platform designed for real-time, large-scale data processing with high scalability, durability, and low latency.

A Kafka user has no access to your topics until you grant it access with an access control list (ACL). This guide explains how to create topic ACLs from the OVHcloud Console or the OVHcloud API, and Schema Registry ACLs from the OVHcloud API.

Requirements


OVHcloud Console Access

  • Direct link:
  • Navigation path: Public Cloud > Select your project > Analytics

Instructions

Default access

When your service is created, the preconfigured admin user avnadmin has the admin permission on all topics (*) and can write to the Schema Registry once it is enabled.

Any user you create afterwards has no access. Until you add an ACL for this user, producing to or consuming from a topic fails with the error TOPIC_AUTHORIZATION_FAILED.

We recommend creating one user per application and granting each user only the topics and the permission it needs.

Permissions

For a user and a topic (or all topics with *), you can grant one of the following permissions:

  • admin: full access to the topic, including its management
  • read: consume messages from the topic
  • write: produce messages to the topic
  • readwrite: produce and consume messages

The list of permissions available on your service is also returned by the API:

{
  "names": ["admin", "read", "write", "readwrite"],
  "topic": ["admin", "read", "write", "readwrite"],
  "schemaRegistry": ["schema_registry_read", "schema_registry_write"]
}

Configuring topic ACLs

OVHcloud Console
OVHcloud API

In the ACL tab, click the Add an ACL button.

In the Add an ACL panel, select the Username, enter the Topic name (or * for all topics), choose the Permission (Admin, Read, Write or Read and write), then click Create.

Configuring Schema Registry ACLs with the API

Once the Schema Registry is enabled, a user also needs a Schema Registry ACL to read or register schemas.

Two permissions are available:

  • schema_registry_read: read schemas
  • schema_registry_write: read and register schemas

The resource is either:

  • Subject:<subject name>, for example Subject:orders-value, or Subject:* for all subjects;
  • Config:, for the global compatibility configuration of the Schema Registry.

By default, avnadmin has the schema_registry_write permission on Config: and on Subject:*.

Create a Schema Registry ACL:

{
  "username": "app-orders",
  "resource": "Subject:orders-value",
  "permission": "schema_registry_write"
}

With this ACL, app-orders can register schemas for the orders-value subject. The Schema Registry behaves as follows for any user:

  • without any Schema Registry ACL, every request returns 401 Unauthorized;
  • a subject not covered by its ACLs is reported as not found (404).

List and delete Schema Registry ACLs:

Go further

Kafka - How to enable the Schema Registry

Kafka - How to enable the REST API

We want your feedback!

We would love to help answer questions and appreciate any feedback you may have.

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.

Are you on Discord? Connect to our channel at https://discord.gg/ovhcloud and interact directly with the team that builds our Analytics service!

Join our community of users.

Czy ta strona była pomocna?