KAFKA-14236; ListGroups request produces too much Denied logs in authorizer (#12652)

Avoid `is Denied Operation` logs when calling ListGroups api, by adding `logIfDenied = false` to `authorize` calls.

Reviewers: Jason Gustafson <jason@confluent.io>
This commit is contained in:
aLeX 2022-09-22 02:42:30 +02:00 committed by GitHub
parent 695424fa9d
commit cb9557a990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1635,12 +1635,12 @@ class KafkaApis(val requestChannel: RequestChannel,
)
}
val (error, groups) = groupCoordinator.handleListGroups(states)
if (authHelper.authorize(request.context, DESCRIBE, CLUSTER, CLUSTER_NAME))
if (authHelper.authorize(request.context, DESCRIBE, CLUSTER, CLUSTER_NAME, logIfDenied = false))
// With describe cluster access all groups are returned. We keep this alternative for backward compatibility.
requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
createResponse(requestThrottleMs, groups, error))
else {
val filteredGroups = groups.filter(group => authHelper.authorize(request.context, DESCRIBE, GROUP, group.groupId))
val filteredGroups = groups.filter(group => authHelper.authorize(request.context, DESCRIBE, GROUP, group.groupId, logIfDenied = false))
requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
createResponse(requestThrottleMs, filteredGroups, error))
}