Dear Team,
I'm using Wazuh 4.11.2
I have configured my Wazuh with LDAP. I have two OUs with total of 35 users.
My OU names are
OU1: 25 users + 3 groups
OU2: 10 users
Group name: wazuh_admins (5 users), it is located under OU1, users are from OU1
Group name: wazuh_monitoring (10 users) it is located under OU2, all the users are from OU2
I was able to set login and admin privileges for users in OU1. I have given full admin rights to a group (wazuh_admins) that is in the OU1 using roles_mapping. The LDAP configuration is given below. I have tried multiple ways to add second OU, but failed.
OU1 users can login, but OU2 users can't. The error says the incorrect credentials, even though they are correct. OU1 users have full admin rights as the configuration.
I have added one role, "read_only" with the following permissions. It is used to give read-only permission in Wazuh for OU2.
Cluster permissions:
read
indices:data/read*
indices:admin/mappings/fields/get*
indices:admin/resolve/index
kibana_all_read
kibana:saved_objects/*/read
indices:data/read/explain
indices:data/read/field_caps
indices:data/read/field_caps*
indices:data/read/get
indices:data/read/mget
indices:data/read/mget*
indices:data/read/msearch
indices:data/read/msearch/template
indices:data/read/mtv
indices:data/read/mtv*
indices:data/read/point_in_time/create
indices:data/read/point_in_time/delete
indices:data/read/point_in_time/readall
indices:data/read/scroll
indices:data/read/search
indices:data/read/search/template
indices:data/read/tv
indices:data/read/search*
indices:data/read/scroll/clear
cluster:admin/opensearch/ql/datasources/read
indices_monitor
indices:monitor/*
cluster_monitor
cluster:monitor/*
Index permissions:
wazuh-*
read
Backend Role:
wazuh_monitoring
The LDAP configuration is given below.
My configuration in:
/etc/wazuh-indexer/opensearch-security/config.yml
ldap:
description: "Authenticate via LDAP or Active Directory"
http_enabled: true
transport_enabled: true
order: 1
http_authenticator:
type: basic
challenge: false
authentication_backend:
type: ldap
config:
enable_ssl: false
enable_start_tls: false
enable_ssl_client_auth: false
verify_hostnames: true
hosts:
-
testdc.com:389 bind_dn: CN=user1,CN=Users,DC=testdc,DC=com
password: <password>
userbase: 'OU=OU1,DC=testdc,DC=com'
usersearch: '(sAMAccountName={0})'
username_attribute: cn
ldap2:
description: "Authenticate via LDAP or Active Directory"
http_enabled: true
transport_enabled: true
order: 1
http_authenticator:
type: basic
challenge: false
authentication_backend:
type: ldap
config:
enable_ssl: false
enable_start_tls: false
enable_ssl_client_auth: false
verify_hostnames: true
hosts:
-
testdc.com:389 bind_dn: CN=user1,CN=Users,DC=testdc,DC=com
password: <password>
userbase: 'OU=OU2,DC=testdc,DC=com'
usersearch: '(sAMAccountName={0})'
username_attribute: cn
authz:
roles_from_ldap1:
description: "Authorize via LDAP or Active Directory"
http_enabled: true
transport_enabled: true
authorization_backend:
type: ldap
config:
enable_ssl: false
enable_start_tls: false
enable_ssl_client_auth: false
verify_hostnames: true
hosts:
-
testdc.com:389 bind_dn: CN=user1,CN=Users,DC=testdc,DC=com
password: <password>
rolebase: 'OU=OU1,DC=testdc,DC=com'
rolesearch_enabled: true
rolesearch: '(member={0})'
userroleattribute: null
userrolename: none
rolename: cn
resolve_nested_roles: true
userbase: 'OU=OU1,DC=testdc,DC=com'
usersearch: (sAMAccountName={0})
roles_from_ldap2:
description: "Authorize via another Active Directory"
http_enabled: true
transport_enabled: true
authorization_backend:
type: ldap
config:
enable_ssl: false
enable_start_tls: false
enable_ssl_client_auth: false
verify_hostnames: true
hosts:
-
testdc.com:389 bind_dn: CN=user1,CN=Users,DC=testdc,DC=com
password: <password>
rolebase: 'OU=OU2,DC=testdc,DC=com'
rolesearch_enabled: true
rolesearch: '(member={0})'
userroleattribute: null
userrolename: none
rolename: cn
resolve_nested_roles: true
userbase: 'OU=OU2,DC=testdc,DC=com'
usersearch: (sAMAccountName={0})
My Configuration in:
/etc/wazuh-indexer/opensearch-security/roles_mapping.yml
_meta:
type: "rolesmapping"
config_version: 2
all_access:
reserved: true
hidden: false
backend_roles:
- "admin"
- "wazuh_admins"
hosts: []
users: []
and_backend_roles: []
description: "Maps admin to all_access"
#
#
# All other default configurations here, no change
#
#
#
read_only:
reserved: false
hidden: false
backend_roles:
- "wazuh_monitoring"
hosts: []
users: []
and_backend_roles: []
I have tried all basic troubleshooting and multiple configurations as well, nothing worked yet for OU2. OU1 is working perfectly. Please help