Open sookeke opened 1 year ago
Hi, for this particular demonstration the ACLs are defined in Keycloak (RH SSO) realm configuration files - found in https://github.com/keunlee/amq-streams-broker-authorization-sample/tree/master/ocp/bootstrap/roles/ocp4-install-rh-sso/files.
I haven't tried it yet on this demo, but I think if I did, I would give a shot at looking through some of the examples in the strimzi configuration docs - https://strimzi.io/docs/operators/latest/configuring.html#con-securing-kafka-authorization-str
@keunlee thanks for the response. Yes, I was thinking of the implementation of the strimzi class io.strimzi.kafka.oauth.server.authorizer.KeycloakRBACAuthorizer which is an extension of the AclAuthorizer class should be:
There's some comment in the strimzi document that's kinda confusing to me. It reads
"The authorizer (i.e KeycloakRBACAuthorizer) fetches a list of granted permissions from the authorization server as needed, and enforces authorization locally on the Kafka Broker, making rapid authorization decisions for each client request."
Does that mean this Authorizer does not communicate to the Zookeeper Authorizer store and does not cache ACL in the broker like other Authorizer classes?
How then can we view the ACL in the cluster other than via keycloak. I mean using rest proxy or bridge traditionally we can view acls on the cluster with GET /v3/clusters/{CLUSTER_ID}/acls but with this new authorizer KeycloakRBACAuthorizer it returns NULL
@keunlee another quote
Keycloak Authorization Services REST endpoints provide a list of granted permissions on resources for authenticated users. The list of grants (permissions) is fetched from the Keycloak server as the first action after an authenticated session is established by the Kafka client. The list is refreshed in the background so that changes to the grants are detected. Grants are cached and enforced locally on the Kafka broker for each user session to provide fast authorization decisions.
Hi @keunlee
Thanks for putting this together. Are these ACLs described in Keycloak stored or cached in Kafka?
I notice when I got inside the Kafka cluster and run ./kafka-acls.sh --bootstrap-server XXX --command-config XXXX it returns nothing