Understand Pulsar & Kafka ACLs
Both Kafka and Pulsar have access control lists (ACLs) to control access to resources. You grant permissions to principals (users or service accounts) to perform actions on resources. Pulsar allows you to grant permissions to users or service accounts at the namespace level or topic level.- If you grant the permissions at the namespace level, then the permissions apply to all the topics under the namespace.
- If you grant the permissions at the topic level, then the permissions apply to the specific topic.
Understand Pulsar & Kafka actions
Pulsar supports the following authorization actions:- produce
- consume
- functions
- sources
- sinks
- packages
- READ
- IDEMPOTENT_WRITE
- WRITE
- DESCRIBE
- CREATE
- DELETE
- ALTER
- DESCRIBE_CONFIGS
- ANY
- ALTER_CONFIGS
- CLUSTER_ACTION
- UNKNOWN
- ALL
pulsar-admin topics grant-permission
command to grant permissions to a topic. Here is an example on how to grant produce
action to a topic:
kafka-acls.sh
command to grant permissions to a topic. Here is an example on how to grant WRITE
and CREATE
operations to a topic:
Mapping between Kafka and Pulsar ACLs
Because StreamNative Cloud doesn’t support Kafka ACLs directly, you need to map Kafka ACLs to Pulsar authorization actions. Below table shows the mapping between Kafka ACL operations and Pulsar authorization actions.StreamNative Cloud only supports the ‘produce’ and ‘consume’ actions for topics. The principal with Super Admin (also known as Super User) permission can perform all operations.
Kafka ACL Operation | Pulsar Authorization Action |
---|---|
READ | consume |
WRITE | produce |
IDEMPOTENT_WRITE | produce |
CREATE | Super User |
DELETE | Super User |
ALTER | Super User |
DESCRIBE | produce or consume |
DESCRIBE_CONFIGS | produce or consume |
CLUSTER_ACTION | N/A |
ALTER_CONFIGS | N/A |
UNKNOWN | N/A |
ALL | Super User |
ANY | Super User |
Managed Pulsar ACLs using pulsar-admin
You can use pulsar-admin
CLI to manage the ACLs, for example, grant produce
and consume
actions to role (aka principal) test-role
in test-tenant/namespace1
namespace.