Integrate with Wazuh
Support level: Community
What is Wazuh?
Wazuh is an open source security platform that provides unified threat detection and response for endpoints and cloud workloads.
Preparation
The following placeholders are used in this guide:
wazuh-dashboard.companyis the FQDN of the Wazuh Dashboard installation.wazuh-indexer.companyis the FQDN of the Wazuh Indexer installation.authentik.companyis the FQDN of the authentik installation.
This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.
authentik configuration
To support the integration of Wazuh with authentik, you need to create a group, a property mapping, and an application/provider pair in authentik.
Create a user group in authentik
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Directory > Groups and click Create.
- Set a name for the group, such as
wazuh-administrators, and click Create. - Click the name of the newly created group and navigate to the Users tab.
- Click Add existing user, select the users that need Wazuh administrator access, and click Add.
Create a property mapping
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
Navigate to Customization > Property Mappings and click Create.
-
Create a SAML Provider Property Mapping with the following settings:
- Name: choose a descriptive name, such as
Wazuh roles. - SAML Attribute Name:
Roles. - Expression: change
wazuh-administratorsto the authentik group name that should receive administrator access in Wazuh.
if ak_is_group_member(request.user, name="wazuh-administrators"):yield "wazuh-admin"The yielded value,
wazuh-admin, is the backend role that Wazuh evaluates later. To map additional Wazuh roles, add more group checks that yield different backend role values. - Name: choose a descriptive name, such as
-
Click Finish.
Create an application and provider
authentik 2026.5 introduces changes to how the SAML provider behaves. Specifically, the provider now automatically sets the Issuer value to: https://authentik.company/application/saml/<application_slug>/metadata/
Older versions of authentik set this value to authentik by default. If you're running an older version, please set Issuer to https://authentik.company/application/saml/<application_slug>/metadata/, where <application_slug> is the slug that you selected for the application.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Applications > Applications and click New Application to open the application wizard.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Note the Slug value because it will be required later.
- Choose a Provider type: select SAML Provider as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Set the ACS URL to
https://wazuh-dashboard.company/_opendistro/_security/saml/acs. - Set the Audience to
wazuh-saml. - Under Advanced protocol settings:
- Select a Signing Certificate. If you do not already have one, create it under System > Certificates before configuring the provider.
- Set NameID Property Mapping to the property mapping that Wazuh should use for usernames, such as
authentik default SAML Mapping: Nameorauthentik default SAML Mapping: Email. - Add the Wazuh roles property mapping that you created earlier.
- Set the ACS URL to
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
- Click Submit to save the new application and provider.
Download the provider metadata
- Navigate to Applications > Providers and open the SAML provider that you created in the previous section.
- Open the Metadata tab.
- Under SAML Metadata, click Download. Save the file as
wazuh_authentik_meta.xml; this metadata file is required in the next section.
Wazuh configuration
To support the integration of authentik with Wazuh, you need to configure SAML authentication on the Wazuh Indexer server and create role mappings on the Wazuh Dashboard server.
Configure SAML on the Wazuh Indexer server
Back up the Wazuh Indexer security configuration before changing it.
-
Generate a 64-character exchange key:
openssl rand -hex 32The output is the
exchange_keyvalue that you will use in/etc/wazuh-indexer/opensearch-security/config.yml. -
Copy the downloaded
wazuh_authentik_meta.xmlfile to the/etc/wazuh-indexer/opensearch-security/directory on your Wazuh Indexer server. -
Change ownership of the metadata file:
sudo chown wazuh-indexer:wazuh-indexer /etc/wazuh-indexer/opensearch-security/wazuh_authentik_meta.xml -
Edit
/etc/wazuh-indexer/opensearch-security/config.yml. Setorderto0andchallengetofalsein the existingbasic_internal_auth_domainsection, then add asaml_auth_domainsection underauthc:/etc/wazuh-indexer/opensearch-security/config.yml---authc:basic_internal_auth_domain:description: "Authenticate via HTTP Basic against internal users database"http_enabled: truetransport_enabled: trueorder: 0http_authenticator:type: "basic"challenge: falseauthentication_backend:type: "intern"saml_auth_domain:http_enabled: truetransport_enabled: falseorder: 1http_authenticator:type: samlchallenge: trueconfig:idp:metadata_file: "/etc/wazuh-indexer/opensearch-security/wazuh_authentik_meta.xml"entity_id: "https://authentik.company/application/saml/<application_slug>/metadata/"sp:entity_id: "wazuh-saml"kibana_url: "https://wazuh-dashboard.company/"roles_key: Rolesexchange_key: "<exchange key generated in step 1>"authentication_backend:type: noop -
Run the
securityadmin.shscript to load the configuration changes. Update the-hvalue to your Wazuh Indexer FQDN:sudo env JAVA_HOME=/usr/share/wazuh-indexer/jdk/ bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -f /etc/wazuh-indexer/opensearch-security/config.yml -icl -key /etc/wazuh-indexer/certs/admin-key.pem -cert /etc/wazuh-indexer/certs/admin.pem -cacert /etc/wazuh-indexer/certs/root-ca.pem -h wazuh-indexer.company -nhnv -
Edit
/etc/wazuh-indexer/opensearch-security/roles_mapping.ymland includewazuh-adminas abackend_rolein the appropriate section. The following example mapswazuh-adminto theall_accessrole:/etc/wazuh-indexer/opensearch-security/roles_mapping.ymlall_access:reserved: truehidden: falsebackend_roles:- "wazuh-admin"- "admin"hosts: []users: []and_backend_roles: []description: "Maps admin to all_access" -
Run the
securityadmin.shscript again, with the-fvalue set to/etc/wazuh-indexer/opensearch-security/roles_mapping.yml. Update the-hvalue to your Wazuh Indexer FQDN:sudo env JAVA_HOME=/usr/share/wazuh-indexer/jdk/ bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -f /etc/wazuh-indexer/opensearch-security/roles_mapping.yml -icl -key /etc/wazuh-indexer/certs/admin-key.pem -cert /etc/wazuh-indexer/certs/admin.pem -cacert /etc/wazuh-indexer/certs/root-ca.pem -h wazuh-indexer.company -nhnv
Configure the Wazuh Dashboard server
-
On the Wazuh Dashboard server, check the value of
run_asin the/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.ymlconfiguration file:/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.ymlhosts:- default:url: https://127.0.0.1port: 55000username: wazuh-wuipassword: "<WAZUH_WUI_PASSWORD>"run_as: falseWhen
run_asis set totrue, Wazuh uses authorization context information to assign roles to users.If
run_asis set tofalse, proceed to step 4. Ifrun_asis set totrue, proceed with the following steps to add a role mapping on the Wazuh dashboard. -
On the Wazuh dashboard, click the upper-left menu icon ☰ to open the menu, then go to Server management > Security > Roles mapping.
-
Click Create Role mapping and configure the following parameters:
- Role Name: set a name for the role mapping, such as
authentik_admins. - Roles: select a role, such as
administrator. - Custom rules: click Add new rule and set:
- User field:
backend_roles - Search operation:
FIND - Value:
wazuh-admin
- User field:
Click Save role mapping.
- Role Name: set a name for the role mapping, such as
-
On the Wazuh Dashboard server, add the SAML settings to
/etc/wazuh-dashboard/opensearch_dashboards.yml. Ifopensearch_security.session.keepalivealready exists in your configuration, change it tofalse./etc/wazuh-dashboard/opensearch_dashboards.ymlopensearch_security.auth.type: "saml"server.xsrf.allowlist:["/_opendistro/_security/saml/acs","/_opendistro/_security/saml/logout","/_opendistro/_security/saml/acs/idpinitiated",]opensearch_security.session.keepalive: falseUse this configuration block instead if you want to keep both username/password authentication and SAML SSO enabled:
/etc/wazuh-dashboard/opensearch_dashboards.ymlopensearch_security.auth.type: ["basicauth", "saml"]opensearch_security.auth.multiple_auth_enabled: trueserver.xsrf.allowlist:["/_opendistro/_security/saml/acs","/_opendistro/_security/saml/logout","/_opendistro/_security/saml/acs/idpinitiated",]opensearch_security.session.keepalive: false -
Restart the Wazuh dashboard service using the following command:
sudo systemctl restart wazuh-dashboard
Configuration verification
To confirm that authentik is properly configured with Wazuh, open Wazuh and log in using an account that is a member of the appropriate authentik group, such as wazuh-administrators.