Keycloak and Wazuh SSO integration

Keycloak and Wazuh SSO integration uses SAML 2.0 to sign analysts into the Wazuh dashboard. This page covers the client, the Roles mapper, the indexer configuration and role mapping, and the failure points teams hit.

On this page

How the Keycloak and Wazuh SSO integration signs analysts in

This integration uses SAML 2.0 with Keycloak as the identity provider, while the Wazuh dashboard and the Wazuh indexer act as the service provider, using the single sign-on method Wazuh documents for its dashboard. Once it is in place, analysts open the Wazuh dashboard, get redirected to the Keycloak login page, and sign in with the same credentials and multi-factor settings they use for other internal applications. Keycloak then returns a SAML assertion that carries the user's roles, and Wazuh maps those roles to the backend roles that decide whether a user gets administrator or read-only access. Analysts stop managing a separate Wazuh password, and when someone leaves the organization, disabling the account in Keycloak removes their dashboard access without a second change in Wazuh.

For administrators, the change is mostly in where access decisions live. Role assignment moves to Keycloak groups and realm roles, and the Wazuh side keeps only the mapping from those roles to Wazuh backend roles. That split means a security lead can review who holds administrator rights in one place, but it also means a mistake in the role mapper can lock out a whole team or grant broader rights than intended. Local Wazuh accounts remain in place as a recovery path for the case where Keycloak or the SAML connection is unavailable, and that local access should be tested before the single sign-on cutover, not discovered missing during an outage.

Before you build anything, confirm the exact field names, the saml_auth_domain configuration layout and the file locations against the Wazuh single sign-on documentation for the 4.14 release line you run, because these settings change between Wazuh versions. Check the same for the Keycloak client settings you plan to use, and record the Wazuh version alongside your test results so that a later upgrade can be checked against the same assertions.

What you need before configuring either side

Both sides of this SAML integration must be running, reachable and trusted by each other before any mapping work starts. The cards below cover the Keycloak and Wazuh components, the network and certificate paths between them, and the people who own role membership.

A running Keycloak realm

Start with a Keycloak server on the current 26.8.1 release line, published October 13, 2026, with an administrator account for the admin console. Create a dedicated realm for Wazuh users rather than placing them in the master realm, so that the SAML client, users and groups stay separate from Keycloak's own administration. Confirm which database backs the deployment, because production installs should not use the development file database. Keycloak's production guidance calls for TLS on all communication and a reverse proxy with path restrictions, so plan both before the SAML metadata is exchanged.

Keycloak production guide

A Wazuh deployment with config access

Run a Wazuh deployment on the 4.14 line, where 4.14.9 was released on October 14, 2026, and confirm you can edit the Wazuh indexer and Wazuh dashboard configuration files on each host. The SAML settings are split across both components, so a deployment where only the dashboard is reachable will not be enough. Record the Wazuh version now, because release notes and the saml_auth_domain configuration steps should be checked against the version you run.

Wazuh release notes

A stable HTTPS dashboard hostname

Give the Wazuh dashboard a fixed DNS name that users will type into their browser, and use it consistently in the Keycloak client redirect URI and in the dashboard configuration. Changing this hostname later means updating the SAML client and the dashboard settings together. Confirm that the name resolves identically for users on the corporate network and for any remote staff who reach the dashboard through a VPN or proxy.

A certificate chain both sides trust

Keycloak and the Wazuh dashboard both need TLS certificates issued by a chain that the other party trusts. Confirm the certificate authority used for the Keycloak hostname and the dashboard hostname, and install the root or intermediate certificates in the trust stores the Wazuh components read. Plan how the SAML signing certificate from the Keycloak realm will be exchanged and rotated, since a mismatch at this stage is a common reason SAML sign-in fails silently.

Network paths between components

Map two network paths before configuring anything. The first runs from user browsers to Keycloak for sign-in and to the Wazuh dashboard for the SAML response. The second runs from the Wazuh dashboard to the Wazuh indexer, which must accept the authenticated session. Verify each path with a test from the host that will carry it, including any firewall, load balancer or reverse proxy rules that restrict paths or ports.

A named owner for role membership

Assign one accountable person or team to decide who belongs to each Keycloak group that maps to Wazuh administrator or read-only access. The Roles mapper will pass whatever roles Keycloak holds, so unclear ownership leads to users keeping Wazuh administrator rights after they change jobs. Agree in advance who approves group changes, how often membership is reviewed, and who can remove access during an incident.

How a SAML login moves between the browser, Keycloak and the Wazuh stack

The sign-in starts in the analyst's browser, which is sent to the Wazuh dashboard acting as the service provider. The dashboard hands the browser to Keycloak as the identity provider, where the user authenticates and Keycloak returns a signed SAML response through the browser. The Wazuh indexer then checks that response against the signing certificate configured for the SAML realm and applies backend roles to decide between administrator and read-only access. Check that the certificate exchanged at setup matches the realm's active signing key and that the roles in the assertion map to the intended backend roles before you go live.

Sequence of a SAML sign-in between the browser, Wazuh dashboard, Keycloak and the Wazuh indexer.

Configuring the Keycloak client, Roles mapper and Wazuh indexer

This sequence connects a Keycloak SAML client to the Wazuh dashboard, passes role attributes in the assertion, and maps those roles to administrator or read-only access in the Wazuh indexer. Each step ends with a check so the team can confirm the chain works before users depend on it.

  1. Collect the Wazuh SSO values

    The engineer responsible for the Wazuh deployment reads the single sign-on section of the Wazuh single sign-on documentation for the installed release line. They record the exact entity ID, assertion consumer URL, and the role attribute name the dashboard expects, along with the dashboard hostname and indexer address. Done means the values sit in one change record and match the documentation for the version in use, with no values copied from older guides.

  2. Create the SAML client in the realm

    In the Keycloak admin console, the identity administrator selects the target realm, opens Clients, and creates a client with the SAML protocol. The client ID and the valid redirect or assertion consumer values are set to the entity ID and URL recorded in the previous step. Done means the client appears in the Clients list with the SAML protocol, and its settings page shows the same entity ID that Wazuh documents.

  3. Configure signing and the realm certificate

    On the same client, the administrator sets assertion signing, the signature algorithm, and the name ID format that the Wazuh documentation specifies. The realm's signing key and certificate are used, and the Wazuh documentation determines whether a specific key type or algorithm is required. Done means the client's SAML keys section shows the realm certificate, and the realm's SAML 2.0 identity provider metadata, reachable from the realm endpoints, contains that same certificate.

  4. Add the Roles mapper to the client

    On the client's dedicated scope, the administrator adds a mapper using the role list mapper type. The attribute name must match the role attribute that Wazuh reads, and the mapper should be set to emit the realm roles the team will use for administrators and read-only users. Done means the mapper is saved on the client, and a test assertion (captured with a SAML response inspector) contains a role attribute with the expected role names.

  5. Assign test users to the Keycloak roles

    The administrator creates at least one administrator test user and one read-only test user in the realm, then assigns each to the matching realm role. Role names are chosen by the team and should be documented. Done means the Role mapping tab for each test user lists the intended role, and no test user holds a role that grants more access than its test purpose requires.

  6. Map backend roles in the indexer

    The Wazuh administrator adds the saml_auth_domain configuration to the Wazuh indexer security configuration, following the Wazuh single sign-on documentation for the IdP metadata, the roles key, and the subject key. The Keycloak role names are then mapped to indexer backend roles, and those backend roles are linked to the administrator or read-only security roles. Done means the indexer security initialization runs without errors in its logs, and the saml_auth_domain appears in the loaded configuration.

  7. Enable dashboard SSO and restart in order

    The administrator sets the SSO options in the Wazuh dashboard configuration as the documentation describes, then restarts the indexer, server and dashboard in the order the Wazuh documentation gives. The team then signs in once with each test user in a private browser session. Done means the dashboard shows the SSO sign-in path, the administrator test user reaches the administrator functions, and the read-only test user sees the dashboard without administrative actions.

Mapping Keycloak roles to Wazuh backend roles

This table compares the Keycloak group or role, the SAML attribute value it sends, the Wazuh backend role it should match and the access that role grants. Names in the first two columns are placeholders the team chooses, so read each row as a pattern to copy and then confirm against the built-in Wazuh roles in your version. The main takeaway is that both sides must use identical strings, and any user who matches no row should get no access at all.

Keycloak group or role (illustrative)Attribute value in SAML assertionWazuh backend roleAccess granted
wazuh-admins groupwazuh-adminsBuilt-in administrator role, confirmed in Wazuh docsFull administrator access to the dashboard and its settings
wazuh-analysts groupwazuh-analystsCustom read-only role, mapped to read permissions you defineView alerts, agents and dashboards without changing configuration
wazuh-soc-readonly groupwazuh-soc-readonlyCustom read-only role with index patterns limited to selected dataRead-only access to the data sources your SOC needs
Realm role wazuh-auditorwazuh-auditorCustom read-only role for compliance reviewersRead-only views of compliance dashboards
No matching group or roleAttribute absent or emptyNo backend role assignedNo access (least privilege default)
Group name differs in one characterwazuh-AdminsNo matching backend roleSilent mismatch, so the user lands without the intended access

Choosing how administrator and read-only access is granted

In a small team, a handful of named administrators run both the Wazuh deployment and the Keycloak realm, often the same two or three people. Keycloak realm administrators usually maintain membership, and one named owner keeps the mapping between Keycloak groups and Wazuh backend roles written down and current.

  • Who maintains membership: Realm administrators add users to the one or two Keycloak groups that map to the Wazuh administrator role. Name one owner for the mapping.
  • How changes are reviewed: A second administrator confirms each group change in a short written record before it takes effect. This works well when two or three people share the work.
  • Keep a local fallback: Keep a Wazuh administrator account that does not depend on Keycloak, stored under your existing secrets process. Confirm in your Wazuh version that it still signs in after SAML changes.
  • What to test after a change: Sign in as an affected user in a private browser session, confirm the admin screens match the role, and confirm that a user removed from the group loses admin access at the next sign-in.
  • Store the mapping in version control: Keep the group-to-role mapping and the saml_auth_domain settings in version control so the team can rebuild the setup.

Check that every administrator still signs in after each role change and that removed users lose admin rights in the dashboard.

Security settings for the Keycloak and Wazuh SSO integration

Single sign-on moves the trust decision for Wazuh dashboard access into Keycloak, so the security of the integration depends on settings in both systems. The cards below cover the controls to set and verify before users sign in and after every change to roles, certificates or endpoints.

TLS on the dashboard and every SAML endpoint

Serve the Wazuh dashboard and the Keycloak SAML endpoints over HTTPS only, and confirm that the dashboard URL, the Keycloak frontend URL and the assertion consumer URL all use the same trusted certificate chain. Keycloak's production guidance calls for TLS on all communication and a reverse proxy with path restrictions. Check that the browser never falls back to plain HTTP during the redirect round trip, because a downgrade there exposes SAML messages in transit.

Keycloak production guide

Admin console on a separate hostname

Keycloak's production guide recommends exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. Apply that split to your Keycloak deployment and confirm that the realm used for Wazuh sign-in is administered only through the restricted hostname. Test that the public hostname returns no admin pages, because an exposed admin console is the most direct route to changing the SAML client or its mappers.

Keycloak production guide

Signature validation and certificate rotation

Require signed SAML assertions in the Keycloak client settings and in the Wazuh indexer SAML configuration, and record which certificate the indexer trusts for the realm. Keep a dated inventory of the realm signing key and the IdP metadata file so that a rotation is planned rather than discovered when logins fail. After each rotation, test a sign-in with a read-only account and confirm that an assertion signed with an old key is rejected.

Short sessions and confirmed logout behavior

Set Keycloak session and SSO session lifetimes to values your security policy allows for dashboard users, and set the Wazuh dashboard session timeout to match. Single logout between Keycloak and the Wazuh dashboard is a behavior to confirm in your test environment, not one to assume: sign out in one system, then check whether the other session remains active. Document the result so the operations team knows what a user sees after a logout.

Local break-glass administrator in the indexer

Keep a local administrator account in the Wazuh indexer security configuration that does not depend on Keycloak. If the Keycloak realm, certificate or network path fails, this account is the only way to reach the security settings and repair the SAML configuration. Store its credentials in your secrets system, restrict who can read them, and test that the account still signs in after the SAML settings change.

Restricted editing of role mappings

Role mappings decide whether a Keycloak user becomes an administrator or a read-only analyst on the dashboard, so changes to the roles mapper, groups and client scopes should belong to a small named group of realm administrators. Require a second reviewer for any change that grants administrator access. Export the client and mapper configuration on a schedule so that an unexpected edit can be compared against the approved version.

Logging administrative changes in both systems

Turn on admin event logging in Keycloak and retain the events that cover client, mapper and realm changes, then forward them to the same log platform that receives Wazuh audit data. Review the Wazuh indexer security audit output for changes to roles and role mappings. Confirm that each log line identifies the actor, the object changed and the time, so a reviewer can tie a new administrator mapping to a specific approved change.

Why the Wazuh SSO login fails and how to fix it

This table pairs each common Keycloak to Wazuh SAML failure with its likely cause and the first check to make. Read the symptom column first, then work the fix down the list, starting with the log named in the fix. Most failures trace back to certificates, entity IDs, clock drift, role attributes or the indexer security configuration.

SymptomLikely causeFirst check and logs to read
Keycloak shows "invalid signature" or the Wazuh login page rejects the assertionThe signing certificate in the Wazuh SAML settings does not match the realm's active RS256 signing key, often after a key rotation or realm changeCompare the certificate in the Keycloak SAML descriptor with the one configured for the Wazuh indexer. Read the Wazuh indexer log for signature validation errors and the Keycloak event log for the failed login.
Login fails with an unknown or mismatched issuer, or the assertion consumer URL is not acceptedA typo in the Keycloak client entity ID or in the assertion consumer service URL, or a trailing slash or wrong portCheck that the client ID, redirect URL and the Wazuh dashboard URL match character for character. Read the Keycloak event log and the Wazuh dashboard log for the rejected request.
Assertion is rejected as expired or not yet validClock skew between the Keycloak host, the Wazuh indexer and the dashboard hostConfirm all three hosts sync time with the same source and compare system clocks. Read the system time status on each host and the indexer log around the failed login time.
User authenticates successfully but lands on a page with no data or no permissionsThe roles attribute is missing from the assertion, or the mapper name or value does not match the backend role configured for WazuhInspect the SAML response in the browser developer tools or the Keycloak event details to confirm the roles attribute is present. Check the Wazuh security role mapping against the exact role name Keycloak sends.
Browser loops between the dashboard and Keycloak after sign-inThe reverse proxy alters the scheme, host or forwarded headers, so the dashboard builds URLs that do not match the client configurationConfirm the public hostname and HTTPS scheme are passed through to the dashboard, and that the redirect URL uses the same external address. Read the reverse proxy access log and the Wazuh dashboard log for repeated redirects.
Wazuh indexer fails to start or SAML login stops working after editing the SAML domainA YAML error or an incorrect saml_auth_domain block in the security configuration, or the security index was not reloaded after the changeValidate the security configuration file syntax and reapply it with the security admin tool. Read the Wazuh indexer log at startup and the output of the security admin command.
Users are signed in but see the wrong access level after a group changeKeycloak group membership changed but the token or assertion still carries the old roles, or the mapping points to a group that was renamedSign out fully, sign back in and compare the new assertion with the group names in Keycloak. Read the Keycloak event log for the sign-in and the Wazuh dashboard audit entries for the access decision.

Testing the login before analysts depend on it

Test the SAML login with named accounts for each access level before any analyst signs in. Create at least one Keycloak test user who receives the administrator backend role and one who receives the read-only role, using the Roles mapper on the Wazuh SAML client so that the role names in the assertion match the backend roles listed in your Wazuh indexer configuration. Sign in as each user and confirm that the administrator can open the management and configuration views while the read-only user sees dashboards and alerts but cannot change settings, add rules or manage users. Record the exact role names observed in the assertion for each account, because a mismatch between the claim value and the backend role is the most common reason an expected view is missing. Add a third test user with no mapped role and confirm that the login is refused or lands on an empty view, which tests the behavior your access model depends on.

Run the same checks on a non-production copy of the stack before changing anything in production. Include a certificate rotation test in that copy: replace the realm signing certificate in Keycloak, update the certificate or fingerprint your Wazuh SAML configuration trusts, restart the affected services as your runbook directs, and repeat the three sign-in tests. Confirm the exact steps and restart order with the Wazuh and Keycloak documentation for your versions, since this guide does not supply a rotation procedure. Throughout the testing, keep the local break-glass login available and verified, so that a failed SAML change cannot lock every administrator out of the dashboard.

Store the test plan, the account list with role assignments, the observed results and the rotation test log together as change evidence. Each production change to the SAML client, mappers or certificates should reference a dated run of this plan, which gives your change reviewers something concrete to check. Ask your security team which evidence format they require, and confirm that the results match the access policy your compliance program documents. Passing these tests shows that the configured behavior matches your intent in this environment, but it does not replace an independent review of the configuration.

Questions teams ask before setting up Keycloak SSO for Wazuh

What drives the effort of a Keycloak SSO setup for Wazuh?

The effort depends mostly on how many Wazuh components sit behind the sign-in, whether Keycloak already has SAML clients for other tools, how complex the role model is, and whether a test environment exists. A single dashboard with two roles is a small change. A deployment with several Wazuh components, a custom backend role model and no staging realm takes longer, because every mapping change must be tested against real accounts before it reaches production. Ask the implementation partner to list each of these factors in the written scope, so the quote reflects your actual environment rather than a generic template.

Can our own team set up Keycloak SSO for Wazuh without a partner?

Yes, if you have an administrator who knows Keycloak, an administrator who knows the Wazuh indexer and dashboard, and enough time to test the sign-in path end to end. The work centers on a SAML client in Keycloak with a Roles mapper, the saml_auth_domain settings in the Wazuh indexer configuration, and mapping backend roles to administrator or read-only access. The hardest part is usually testing: each role must be checked with a real account, and a wrong mapping can leave an administrator locked out. Teams without both skill sets, or without a staging environment, often bring in outside help for the first build and keep the runbook in house.

What do we need to provide before the integration work starts?

Before work starts, name an owner on the Keycloak side and an owner on the Wazuh side, and make sure both can approve changes. Provide test accounts in Keycloak for each intended role, including at least one administrator and one read-only user. Decide the certificate and DNS details in advance: the dashboard hostname, the certificate authority that signs it, and which signing certificate Keycloak uses for SAML assertions. Finally, agree a change window, because the indexer and dashboard configuration typically needs a restart and a sign-in outage during business hours affects every analyst.

Is the Keycloak and Wazuh SSO integration a one-time task or does it recur?

The first build is one-time work, but the integration needs ongoing attention. Certificates expire and must be renewed, and a renewed signing certificate or changed hostname means the Keycloak client and the Wazuh configuration must both be updated. Keycloak and Wazuh both ship regular releases, so each upgrade should be followed by a sign-in test covering every role. Wazuh's 4.14 line received patch releases on several dates in 2026, which is a reasonable indication of how often retesting may come up. Ask any provider whether the sign-in test is part of the upgrade scope or billed separately.

What should a quote for Keycloak SSO on Wazuh include?

A useful quote lists the scope in writing: the Keycloak client and Roles mapper, the Wazuh indexer saml_auth_domain configuration, the backend role mapping for each access level, and the test plan. It should state which environments are covered, whether a staging realm is included, and what the handover contains, such as a runbook and a rollback procedure. Check for the certificate and DNS decisions, the change window support and any retest after upgrades. DeployOpen does not publish a price list, so a quote follows from the written scope. Ask for each deliverable as a separate line so you can see what is included and what you would do yourself.

What breaks most often in a Keycloak SAML login to Wazuh?

The most common failures are mismatched entity IDs or assertion consumer URLs between Keycloak and the Wazuh configuration, certificates that do not match the ones the client trusts, and role attributes that do not reach Wazuh under the expected name. Each failure shows up as a failed sign-in or a user who logs in with no access. Test with a read-only account and an administrator account after every change, and keep a local administrator path in the Wazuh indexer so that a broken SSO setting does not block recovery. Confirm the exact configuration keys against the Wazuh single sign-on documentation for your version.

How DeployOpen scopes and delivers Keycloak SSO for Wazuh

DeployOpen plans and implements self-hosted Keycloak and Wazuh deployments inside your own infrastructure, including the SAML sign-in path between them. The work is fixed-scope, with scope, deliverables and timelines agreed in writing before the build starts, and ongoing support available as a retainer.

How we scope

  • Confirm the Wazuh deployment type, indexer and dashboard hostnames, and whether the environment is online or offline.
  • Agree which Keycloak realm, client and roles map to Wazuh administrator and read-only access.
  • Record which Keycloak certificate, metadata and TLS items each side needs, and who owns them.

How we build

  • Configure the Keycloak SAML client, including the Roles mapper, and test the assertion before touching Wazuh.
  • Apply the Wazuh indexer saml_auth_domain settings and map backend roles to dashboard access levels.
  • Test sign-in, role outcomes and a denied-access case with named test accounts for each role.

How we hand over

  • Deliver the written configuration record, with client settings, mappings, certificate locations and change steps.
  • Walk your identity, security and Wazuh operators through sign-in, role changes and fallback admin access.
  • Document how to rotate certificates and what to check after each Wazuh or Keycloak upgrade.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer for the Keycloak and Wazuh pair.
  • Re-verify the SAML path after each Keycloak minor release and each Wazuh 4.14 patch release you adopt.
  • Retest role mappings when your directory groups, admin roles or onboarding process change.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.