Overview
Single Sign-On allows users to authenticate to the Wazuh Dashboard using their organization’s identity management system. The Dashboard integrates with OpenSearch Security’s SAML authentication to provide seamless access control.Prerequisites
Before configuring SSO, ensure the following requirements are met:- Wazuh indexer and Wazuh Dashboard are installed and operational
- An Identity Provider (IdP) that supports SAML 2.0:
- Okta
- Microsoft Entra ID (formerly Azure AD)
- Keycloak
- OneLogin
- Other SAML 2.0 compatible IdPs
- Administrator access to the Dashboard and indexer security configuration
- Access to configure the IdP application settings
Required Parameters
The following parameters are required for SAML SSO configuration:IdP Configuration
idp.metadata_url or idp.metadata_file
The URL or file path to the IdP metadata document. This document contains the IdP’s configuration, including endpoints, certificates, and entity ID.
Example (URL):
idp.entity_id
The unique identifier for your Identity Provider. This is provided by the IdP.
Example:
Service Provider Configuration
sp.entity_id
The unique identifier for the Wazuh Dashboard (Service Provider). This value must match what is configured in the IdP application.
Example:
kibana_url
The fully qualified URL where users access the Wazuh Dashboard.
Example:
SAML Attributes
roles_key
The SAML attribute name that contains the user’s role or group membership information. The IdP sends this attribute in the SAML assertion.
Common values:
roles(generic)groups(Active Directory/Entra ID)memberOf(LDAP-based)
Security
exchange_key
A secure random string used for encrypting the SAML authentication exchange. This must be at least 64 characters long.
Example:
Configuration Workflow
High-Level Setup Steps
-
Create groups in the IdP
- Create two groups for different access levels (e.g.,
wazuh-adminandwazuh-readonly) - Assign users to appropriate groups
- Create two groups for different access levels (e.g.,
-
Configure SAML application in the IdP
- Use the SP metadata from the Wazuh indexer security plugin
- Configure attribute mappings
- Set up group/role claims
-
Configure SAML in Wazuh indexer and Dashboard
- Update the OpenSearch Security configuration
- Define SAML settings with required parameters
- Configure authentication domains
-
Map IdP groups to OpenSearch security roles
- Create or modify role mappings
- Map
wazuh-admingroup to administrator role - Map
wazuh-readonlygroup to read-only role
-
Apply configuration and restart services
- Run the
securityadminscript to apply changes - Restart the Wazuh indexer and Dashboard services if required
- Run the
-
Validate and test
- Test authentication with users from both groups
- Verify role-based access is working correctly
- Confirm read-only users have restricted permissions
Role Mapping
Administrator Access
Create a role mapping for users who should have full access to the Wazuh Dashboard: IdP Group:wazuh-admin
OpenSearch Role: all_access or a custom administrative role
Permissions:
- Full read/write access to all indices
- Dashboard management capabilities
- Wazuh Server API access with appropriate privileges
- Ability to modify settings and configurations
Read-Only Access
Create a role mapping for users who should have read-only access: IdP Group:wazuh-readonly
OpenSearch Role: kibana_read_only or a custom read-only role
Permissions:
- Read access to Wazuh indices
- View-only access to dashboards and visualizations
- Limited Wazuh Server API access (read-only operations)
- Cannot modify settings or configurations
Example Configuration
OpenSearch Security Configuration
Edit the OpenSearch Security configuration file (typicallyconfig.yml in the OpenSearch security plugin directory):
Role Mapping Configuration
Edit the role mapping configuration (typicallyroles_mapping.yml):
Applying Configuration Changes
After modifying the security configuration files, apply the changes using thesecurityadmin script:
-cd: Configuration directory containing security files-icl: Ignore cluster name-nhnv: No hostname verification-cacert: Path to CA certificate-cert: Path to admin certificate-key: Path to admin key
Restart Services
Restart the services to apply the configuration:Testing SSO Configuration
Administrator Access Test
- Log out of any existing Dashboard session
- Navigate to the Dashboard URL
- You should be redirected to the IdP login page
- Authenticate with a user assigned to the
wazuh-admingroup - Verify you are redirected back to the Dashboard
- Confirm full access to all features and settings
Read-Only Access Test
- Log out of the current session
- Navigate to the Dashboard URL
- Authenticate with a user assigned to the
wazuh-readonlygroup - Verify you can view data but cannot modify settings
- Test that write operations are blocked
Troubleshooting
Common Issues
Redirect Loop Cause: Misconfiguredkibana_url or sp.entity_id
Solution: Verify the URLs match exactly between IdP and SP configuration
Authentication Fails
Cause: Invalid SAML response or attribute mapping
Solution:
- Check IdP logs for error messages
- Verify
roles_keymatches the attribute name sent by the IdP - Ensure users are assigned to the correct groups
- Validate SAML response using browser developer tools
- Verify group names in the IdP match
backend_rolesin role mapping - Check for case sensitivity differences
- Review OpenSearch Security logs for mapping errors
- Verify the IdP metadata contains valid certificates
- Update metadata if certificates have been rotated
- Check system time synchronization (important for SAML)
Log Files
Check the following logs for troubleshooting: OpenSearch/Indexer Logs:Security Considerations
- Use HTTPS: Always configure the Dashboard and IdP with HTTPS
- Secure Exchange Key: Generate a strong, random exchange key
- Certificate Validation: Ensure proper certificate validation is enabled
- Session Timeout: Configure appropriate session timeout values
- Audit Logging: Enable audit logging to track authentication events
- Regular Updates: Keep IdP metadata updated when certificates rotate
Official Documentation References
For IdP-specific configuration steps and additional details, refer to the official Wazuh documentation:- SSO Overview: Wazuh SSO Documentation
- Administrator Role Setup: Administrator Configuration
- Read-Only Role Setup: Read-Only Configuration