Skip to content

KC event logging

Problem/Motivation

Keycloak generated logs, with the configured set of event types in a realm. It would be great to process that information.

Those can be consumed with event listener, but KC only provides a couple of them, the Logging Event Listener and the Email Event Listener.

So, to consume the data from a place like Datadog, more steps than default KC codebase are needed.

Proposed resolution

A. Create a custom SPI extension

As other places for extension, event listeners can be created and then added as extra packages for a given KC instance.

There is an Event listener SPI.

This approach would be similar to the proposed at #66 (closed).

It is portable, to any KC hosting.

B. Use cloud-iam REST API

Additionally from KC, the hosting provider, cloud-iam, exposes an endpoint, /deployments/{deploymentId}/logs, on its REST API that could be used to retrieve logs.

That may also involve a custom client to poll the data, and push it into Datadog.

That client could be vector.

This approach is based on feedback a slack conversation with drumm and nnewton.

It is not portable, since it is based on cloud-iam KC hosting.

Notes

The react on delete described at #66 (closed) may also be implemented by using the data already ingested into Datadog, if that is preferable.

Q. Is this a requirement pre-launch?

cc @hestenet, @drumm, @nnewton