diff --git a/docs/security.html b/docs/security.html index 5f6d0aceb8e..28c506c7c0e 100644 --- a/docs/security.html +++ b/docs/security.html @@ -1258,6 +1258,450 @@ +

Authorization Primitives

+

Protocol calls are usually performing some operations on certain resources in Kafka. It is required to know the + operations and resources to set up effective protection. In this section we'll list these operations and + resources, then list the combination of these with the protocols to see the valid scenarios.

+
Operations in Kafka
+

There are a few operation primitives that can be used to build up privileges. These can be matched up with + certain resources to allow specific protocol calls for a given user. These are:

+ +
Resources in Kafka
+

The operations above can be applied on certain resources which are described below.

+ +
Operations and Resources on Protocols
+

In the below table we'll list the valid operations on resources that are executed by the Kafka API protocols.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Protocol (API key)OperationResourceNote
PRODUCE (0)WriteTransactionalIdAn transactional producer which has its transactional.id set requires this privilege.
PRODUCE (0)IdempotentWriteClusterAn idempotent produce action requires this privilege.
PRODUCE (0)WriteTopicThis applies to a normal produce action.
FETCH (1)ClusterActionClusterA follower must have ClusterAction on the Cluster resource in order to fetch partition data.
FETCH (1)ReadTopicRegular Kafka consumers need READ permission on each partition they are fetching.
LIST_OFFSETS (2)DescribeTopic
METADATA (3)DescribeTopic
METADATA (3)CreateClusterIf topic auto-creation is enabled, then the broker-side API will check for the existence of a Cluster + level privilege. If it's found then it'll allow creating the topic, otherwise it'll iterate through the + Topic level privileges (see the next one).
METADATA (3)CreateTopicThis authorizes auto topic creation if enabled but the given user doesn't have a cluster level + permission (above).
LEADER_AND_ISR (4)ClusterActionCluster
STOP_REPLICA (5)ClusterActionCluster
UPDATE_METADATA (6)ClusterActionCluster
CONTROLLED_SHUTDOWN (7)ClusterActionCluster
OFFSET_COMMIT (8)ReadGroupAn offset can only be committed if it's authorized to the given group and the topic too (see below). + Group access is checked first, then Topic access.
OFFSET_COMMIT (8)ReadTopicSince offset commit is part of the consuming process, it needs privileges for the read action.
OFFSET_FETCH (9)DescribeGroupSimilarly to OFFSET_COMMIT, the application must have privileges on group and topic level too to be able + to fetch. However in this case it requires describe access instead of read. Group access is checked first, + then Topic access.
OFFSET_FETCH (9)DescribeTopic
FIND_COORDINATOR (10)DescribeGroupThe FIND_COORDINATOR request can be of "Group" type in which case it is looking for consumergroup + coordinators. This privilege would represent the Group mode.
FIND_COORDINATOR (10)DescribeTransactionalIdThis applies only on transactional producers and checked when a producer tries to find the transaction + coordinator.
JOIN_GROUP (11)ReadGroup
HEARTBEAT (12)ReadGroup
LEAVE_GROUP (13)ReadGroup
SYNC_GROUP (14)ReadGroup
DESCRIBE_GROUPS (15)DescribeGroup
LIST_GROUPS (16)DescribeClusterWhen the broker checks to authorize a list_groups request it first checks for this cluster + level authorization. If none found then it proceeds to check the groups individually. This operation + doesn't return CLUSTER_AUTHORIZATION_FAILED.
LIST_GROUPS (16)DescribeGroupIf none of the groups are authorized, then just an empty response will be sent back instead + of an error. This operation doesn't return CLUSTER_AUTHORIZATION_FAILED. This is applicable from the + 2.1 release.
SASL_HANDSHAKE (17)The SASL handshake is part of the authentication process and therefore it's not possible to + apply any kind of authorization here.
API_VERSIONS (18)The API_VERSIONS request is part of the Kafka protocol handshake and happens on connection + and before any authentication. Therefore it's not possible to control this with authorization.
CREATE_TOPICS (19)CreateClusterIf there is no cluster level authorization then it won't return CLUSTER_AUTHORIZATION_FAILED but + fall back to use topic level, which is just below. That'll throw error if there is a problem.
CREATE_TOPICS (19)CreateTopicThis is applicable from the 2.0 release.
DELETE_TOPICS (20)DeleteTopic
DELETE_RECORDS (21)DeleteTopic
INIT_PRODUCER_ID (22)WriteTransactionalId
INIT_PRODUCER_ID (22)IdempotentWriteCluster
OFFSET_FOR_LEADER_EPOCH (23)ClusterActionClusterIf there is no cluster level privilege for this operation, then it'll check for topic level one.
OFFSET_FOR_LEADER_EPOCH (23)DescribeTopicThis is applicable from the 2.1 release.
ADD_PARTITIONS_TO_TXN (24)WriteTransactionalIdThis API is only applicable to transactional requests. It first checks for the Write action on the + TransactionalId resource, then it checks the Topic in subject (below).
ADD_PARTITIONS_TO_TXN (24)WriteTopic
ADD_OFFSETS_TO_TXN (25)WriteTransactionalIdSimilarly to ADD_PARTITIONS_TO_TXN this is only applicable to transactional request. It first checks + for Write action on the TransactionalId resource, then it checks whether it can Read on the given group + (below).
ADD_OFFSETS_TO_TXN (25)ReadGroup
END_TXN (26)WriteTransactionalId
WRITE_TXN_MARKERS (27)ClusterActionCluster
TXN_OFFSET_COMMIT (28)WriteTransactionalId
TXN_OFFSET_COMMIT (28)ReadGroup
TXN_OFFSET_COMMIT (28)ReadTopic
DESCRIBE_ACLS (29)DescribeCluster
CREATE_ACLS (30)AlterCluster
DELETE_ACLS (31)AlterCluster
DESCRIBE_CONFIGS (32)DescribeConfigsClusterIf broker configs are requested, then the broker will check cluster level privileges.
DESCRIBE_CONFIGS (32)DescribeConfigsTopicIf topic configs are requested, then the broker will check topic level privileges.
ALTER_CONFIGS (33)AlterConfigsClusterIf broker configs are altered, then the broker will check cluster level privileges.
ALTER_CONFIGS (33)AlterConfigsTopicIf topic configs are altered, then the broker will check topic level privileges.
ALTER_REPLICA_LOG_DIRS (34)AlterCluster
DESCRIBE_LOG_DIRS (35)DescribeClusterAn empty response will be returned on authorization failure.
SASL_AUTHENTICATE (36)SASL_AUTHENTICATE is part of the authentication process and therefore it's not possible to + apply any kind of authorization here.
CREATE_PARTITIONS (37)AlterTopic
CREATE_DELEGATION_TOKEN (38)Creating delegation tokens has special rules, for this please see the + Authentication using Delegation Tokens section.
RENEW_DELEGATION_TOKEN (39)Renewing delegation tokens has special rules, for this please see the + Authentication using Delegation Tokens section.
EXPIRE_DELEGATION_TOKEN (40)Expiring delegation tokens has special rules, for this please see the + Authentication using Delegation Tokens section.
DESCRIBE_DELEGATION_TOKEN (41)DescribeDelegationTokenDescribing delegation tokens has special rules, for this please see the + Authentication using Delegation Tokens section.
DELETE_GROUPS (42)DeleteGroup
+

7.5 Incorporating Security Features in a Running Cluster

You can secure a running cluster via one or more of the supported protocols discussed previously. This is done in phases: