Keycloak Events
Overview
Events in Keycloak track important actions performed by users and administrators. Events help you to detect suspicious or unauthorized activity, audit changes and access within your IAM system and comply with security policies and regulations.
Supported by Keycloak
Yes, natively supported and configurable on Managed Keycloak by Cloud-IAM.
Admin Events
Admin events track actions performed in the Keycloak Admin Console. Examples include (might vary depending on configuration):
- Creating, updating, or deleting:
- Users
- Groups
- Roles
- Clients
- Client scopes
- Changing realm settings or configurations
- Managing authentication flows or identity providers
- Granting or revoking user roles
- Configuring password policies or MFA settings
- Deleting sessions or tokens
- Impersonation of a user
User Events
User events track actions performed by end-users. Examples include (might vary depending on configuration):
- Login successes and failures
- Logout events
- Password changes or resets
- Account updates (profile, email, attributes)
- Registration events (new account creation)
- Email verification events
- TOTP or MFA configuration changes
- Consent given or revoked for client applications
- Account disabling or deletion
Configuring Keycloak Events
Enable and Configure Admin Events
- Log in to Keycloak using an Admin account.
- Select the realm to be configured.
- Navigate to
Realm Settings
then clickEvents
andAdmin Events Settings
- Enable the
Save Events
toggle. - Enable
Include Representation
captures the full details of the changed object, which is helpful for audits - Set the Expiration period (minimum recommended: 7 days).
- Click
Save
to apply the configuration.

Enable and Configure User Events
- Log in to Keycloak using an Admin account.
- Select the realm to be configured.
- Navigate to
Realm Settings
then clickEvents
andUser Events Settings
- Enable the
Save Events
toggle. - Set the Expiration period (minimum recommended: 7 days).
- Click
Save
to apply the configuration.

Accessing Events
Accessing Admin Events
- Log in to Keycloak using an Admin account.
- Select the realm you want to inspect (e.g., Master or another realm).
- Navigate to
Events
then clickAdmin Events
- You will see a list of recorded admin events.

Accessing User Events
- Log in to Keycloak using an Admin account.
- Select the realm you want to inspect (e.g., Master or another realm).
- Navigate to
Events
then clickUser Events
- You will see a list of recorded admin events.

Advanced Analysis with SIEM
To enable advanced monitoring, Keycloak events must be collected and then forwarded to a Security Information and Event Management (SIEM) platform.
Event Collection Layer
Keycloak does not send data directly to a SIEM.
The recommended approach is to use a log collector to capture and forward events.
Log Collectors / Forwarders (main method)
Export events in JSON or syslog format and use tools such as:- Logstash (with the ELK/Elastic stack)
- Fluentd or Fluent Bit
- Filebeat
- Vector
These tools normalize, enrich, and ship the data into your SIEM for analysis.
Admin REST API (complementary option)
Keycloak also provides endpoints to query Admin Events and User Events.
This method is especially useful for:- On-demand audits
- Custom integrations
- Lightweight monitoring setups without a collector
Best practice: Use a log collector for continuous SIEM integration, and the API for audits or custom checks.
SIEM Analysis Layer
Once events are ingested by the SIEM (e.g., Splunk, Elastic SIEM, QRadar, Microsoft Sentinel, etc.), you can:
- Correlate admin and user actions with other systems
- Detect suspicious activity such as brute-force attacks or privilege escalation
- Visualize trends with dashboards and reports
- Set alerts on critical security events like repeated failed logins or unauthorized admin actions
By combining Keycloak with a log collector and optionally the Admin REST API, you create a robust security monitoring pipeline that enhances visibility, detection, and compliance across your IAM infrastructure.
References
- Deploy my Keycloak on Cloud-IAM - Comprehensive guides to deploy your dedicated Keycloak on Cloud-IAM
- Keycloak Documentation – Events
- Keycloak Security and Configuration Best Practices Guide