PIP-49: Permission levels and inheritance

Motivation

The current pulsar admin‘s permission mechanism is somewhat confusing. There are some commands that have unreasonable permission verification, which causes pulsar’s permission management to be incorrectly applied in pulsar admin.

This PIP proposes the following permission changes for each admin API.

clusters

CommandCurrent PermissionsProposed Permissions
getsuper-usersuper-user
createsuper-usersuper-user
updatesuper-usersuper-user
deletesuper-usersuper-user
listsuper-usersuper-user
update-peer-clusterssuper-usersuper-user
get-peer-clusterssuper-usersuper-user
get-failure-domainsuper-usersuper-user
create-failure-domainsuper-usersuper-user
update-failure-domainsuper-usersuper-user
delete-failure-domainsuper-usersuper-user
list-failure-domainsuper-usersuper-user

brokers

CommandCurrent PermissionsProposed Permissions
listsuper-usersuper-user
namespacessuper-usersuper-user
update-dynamic-configsuper-usersuper-user
delete-dynamic-configsuper-usersuper-user
list-dynamic-configsuper-usersuper-user
get-all-dynamic-configsuper-usersuper-user
get-internal-configsuper-usersuper-user
get-runtime-configsuper-usersuper-user
healthchecksuper-usersuper-user

broker-stats

CommandCurrent PermissionsProposed Permissions
monitoring-metricssuper-usersuper-user
mbeanssuper-usersuper-user
topicssuper-usersuper-user
allocator-statssuper-usersuper-user
load-reportsuper-usersuper-user

functions-worker

CommandCurrent PermissionsProposed Permissions
function-statssuper-usersuper-user
monitoring-metricssuper-usersuper-user
get-clustersuper-usersuper-user
get-cluster-leadersuper-usersuper-user
get-function-assignmentssuper-usersuper-user

resource-quotas

CommandCurrent PermissionsProposed Permissions
getsuper-usersuper-user
setsuper-usersuper-user
reset-namespace-bundle-quotasuper-usersuper-user

ns-isolation-policy

CommandCurrent PermissionsProposed Permissions
getsuper-usersuper-user
setsuper-usersuper-user
listsuper-usersuper-user
deletesuper-usersuper-user
brokerssuper-usersuper-user
brokersuper-usersuper-user

tenants

CommandCurrent PermissionsProposed Permissions
getsuper-usersuper-user
createsuper-usersuper user
updatesuper-usersuper user
deletesuper-usersuper user
listsuper-usersuper user

schemas

CommandCurrent PermissionsProposed Permissions
gettenant adminsuper user and tenant admin and produce
uploadtenant adminsuper user and tenant admin and produce
extracttenant adminsuper user and tenant admin and produce
deletetenant adminsuper user and tenant admin and produce

functions

CommandCurrent PermissionsProposed Permissions
localrunnonenone
createsuper-user and tenant admin and functionsuper-user and tenant admin and function
deletesuper-user and tenant admin and functionsuper-user and tenant admin and function
updatesuper-user and tenant admin and functionsuper-user and tenant admin and function
getsuper-user and tenant admin and functionsuper-user and tenant admin and function
restartsuper-user and tenant admin and functionsuper-user and tenant admin and function
stopsuper-user and tenant admin and functionsuper-user and tenant admin and function
startsuper-user and tenant admin and functionsuper-user and tenant admin and function
statussuper-user and tenant admin and functionsuper-user and tenant admin and function
statssuper-user and tenant admin and functionsuper-user and tenant admin and function
listsuper-user and tenant admin and functionsuper-user and tenant admin and function
querystatesuper-user and tenant admin and functionsuper-user and tenant admin and function
triggersuper-user and tenant admin and functionsuper-user and tenant admin and function
putstatesuper-user and tenant admin and functionsuper-user and tenant admin and function

sources

CommandCurrent PermissionsProposed Permissions
localrunnonenone
createsuper-user and tenant admin and functionsuper-user and tenant admin and function
deletesuper-user and tenant admin and functionsuper-user and tenant admin and function
updatesuper-user and tenant admin and functionsuper-user and tenant admin and function
getnonesuper-user and tenant admin and function
statussuper-user and tenant admin and functionsuper-user and tenant admin and function
stopsuper-user and tenant admin and functionsuper-user and tenant admin and function
startsuper-user and tenant admin and functionsuper-user and tenant admin and function
listsuper-user and tenant admin and functionsuper-user and tenant admin and function
restartsuper-user and tenant admin and functionsuper-user and tenant admin and function

sinks

CommandCurrent PermissionsProposed Permissions
localrunnonenone
createsuper-user and tenant admin and functionsuper-user and tenant admin and function
deletesuper-user and tenant admin and functionsuper-user and tenant admin and function
updatesuper-user and tenant admin and functionsuper-user and tenant admin and function
getnonesuper-user and tenant admin and function
statussuper-user and tenant admin and functionsuper-user and tenant admin and function
stopsuper-user and tenant admin and functionsuper-user and tenant admin and function
startsuper-user and tenant admin and functionsuper-user and tenant admin and function
listsuper-user and tenant admin and functionsuper-user and tenant admin and function
restartsuper-user and tenant admin and functionsuper-user and tenant admin and function

topics

CommandCurrent PermissionsProposed Permissions
compacttenant adminsuper user and tenant admin
compaction-statustenant adminsuper user and tenant admin
offloadtenant adminsuper user and tenant admin
offload-statustenant adminsuper user and tenant admin
create-partitioned-topictenant adminsuper user and tenant admin
delete-partitioned-topictenant adminsuper user and tenant admin
createtenant adminsuper user and tenant admin
get-partitioned-topic-metadatatenant adminsuper user and tenant admin and produce and consume
update-partitioned-topictenant adminsuper user and tenant admin
listtenant adminsuper user and tenant admin
terminatetenant adminsuper user and tenant admin
permissionstenant adminsuper user and tenant admin
grant-permissiontenant adminsuper user and tenant admin
revoke-permissiontenant adminsuper user and tenant admin
lookupproduce or consumesuper user and tenant admin and produce and consume
bundle-rangesuper-usersuper user
deletetenant adminsuper user and tenant admin
unloadsuper-usersuper user
create-subscriptiontenant adminsuper user and tenant admin and consume
statstenant adminsuper user and tenant admin and produce and consume
stats-internaltenant adminsuper user and tenant admin and produce and consume
info-internaltenant adminsuper user and tenant admin and produce and consume
partitioned-statstenant adminsuper user and tenant admin and produce and consume
skip-alltenant adminsuper user and tenant admin
expire-messages-all-subscriptionstenant adminsuper user and tenant admin
last-message-idtenant adminsuper user and tenant admin
create-subscriptiontenant admin and namespace produce or consumesuper user and tenant admin and produce and consume
unsubscribetenant admin and consumesuper user and tenant admin and consume
skiptenant admin or consumesuper user and tenant admin and consume
expire-messagestenant admin and produce or consumesuper user and tenant admin and consume
peek-messagestenant admin and produce or consumesuper user and tenant admin and consume
reset-cursortenant admin and produce or consumesuper user and tenant admin and consume
subscriptionstenant admin and produce or consumesuper user and tenant admin and consume

namespaces

CommandCurrent PermissionsProposed Permissions
listtenant adminsuper user and tenant admin
topicstenant adminsuper user and tenant admin
policiestenant adminsuper user and tenant admin
createtenant adminsuper user and tenant admin
deletetenant adminsuper user and tenant admin
set-deduplicationtenant adminsuper user and tenant admin
permissionstenant adminsuper user and tenant admin
grant-permissionstenant adminsuper user and tenant admin
revoke-permissionstenant adminsuper user and tenant admin
grant-subscription-permissiontenant adminsuper user and tenant admin
revoke-subscription-permissiontenant adminsuper user and tenant admin
set-clusterstenant adminsuper user and tenant admin
get-clusterstenant adminsuper user and tenant admin
get-backlog-quotastenant adminsuper user and tenant admin
set-backlog-quotatenant adminsuper user and tenant admin
remove-backlog-quotatenant adminsuper user and tenant admin
get-persistencetenant adminsuper user and tenant admin
get-backlog-quotastenant adminsuper user and tenant admin
set-backlog-quotatenant adminsuper user and tenant admin
remove-backlog-quotatenant adminsuper user and tenant admin
get-persistencetenant adminsuper user and tenant admin
set-persistencetenant adminsuper user and tenant admin
get-message-ttltenant adminsuper user and tenant admin
set-message-ttltenant adminsuper user and tenant admin
get-anti-affinity-grouptenant adminsuper user and tenant admin
set-anti-affinity-grouptenant adminsuper user and tenant admin
delete-anti-affinity-grouptenant adminsuper user and tenant admin
get-anti-affinity-namespacestenant adminsuper user and tenant admin
get-retentiontenant adminsuper user and tenant admin
set-retentiontenant adminsuper user and tenant admin
unloadsuper-usersuper user
set-replicator-dispatch-ratesuper-usersuper user
get-replicator-dispatch-ratetenant adminsuper user and tenant admin
split-bundlesuper-usersuper user
set-dispatch-ratesuper-usersuper user
get-dispatch-ratetenant adminsuper user and tenant admin
get-subscribe-ratetenant adminsuper user and tenant admin
set-subscribe-ratesuper-usersuper user
set-subscription-dispatch-ratesuper-usersuper user
get-subscription-dispatch-ratetenant adminsuper user and tenant admin
clear-backlogtenant adminsuper user and tenant admin
unsubscribetenant adminsuper user and tenant admin
set-encryption-requiredtenant adminsuper user and tenant admin
set-subscription-auth-modetenant adminsuper user and tenant admin
get-max-producers-per-topictenant adminsuper user and tenant admin
set-max-producers-per-topicsuper-usersuper user
get-max-consumers-per-topictenant adminsuper user and tenant admin
set-max-consumers-per-topicsuper-usersuper user
get-max-consumers-per-subscriptiontenant adminsuper user and tenant admin
get-compaction-thresholdtenant adminsuper user and tenant admin
get-offload-thresholdtenant adminsuper user and tenant admin
get-offload-deletion-lagtenant adminsuper user and tenant admin
get-schema-autoupdate-strategytenant adminsuper user and tenant admin
get-schema-validation-enforcedtenant adminsuper user and tenant admin
set-schema-autoupdate-strategysuper-usersuper user
set-schema-validation-enforcedsuper-usersuper user
set-offload-deletion-lagsuper-usersuper user
clear-offload-deletion-lagsuper-usersuper user
set-offload-thresholdsuper-usersuper user
set-compaction-thresholdsuper-usersuper user
set-max-consumers-per-subscriptionsuper-usersuper user