Define an LDAP scheme
Hyper-Converged Database (HCD) supports LDAP for:
-
Authentication: HCD passes through the credentials to the configured LDAP.
-
Role management: HCD looks up the authenticated user and retrieves a list of LDAP groups and then matches LDAP group names to HCD role names.
Prerequisites
-
Locate the
cassandra.yamlconfiguration file.The location of the
cassandra.yamlfile depends on your installation type:-
Package installations:
/etc/hcd/cassandra/cassandra.yaml -
Tarball installations:
INSTALL_DIRECTORY/resources/cassandra/conf/cassandra.yaml
-
-
Complete Enable HCD Unified Authentication with the following options:
-
For authentication, ensure that
authenticator.parameters.default_scheme: ldaporauthenticator.parameters.additional_schemes: ldapis set in thecassandra.yamlfile:authenticator: class_name: com.datastax.cassandra.auth.AdvancedAuthenticator parameters: ... scheme: ldap -
For role management, ensure that
role_manager.parameters.mode: ldapis set in thecassandra.yamlfile:role_manager: class_name: com.datastax.cassandra.auth.AdvancedRoleManager parameters: mode: ldap
-
-
Ensure that a supported LDAP v3 server is available.
HCD supports:
-
Microsoft Active Directory (
AD):-
Windows 2008
-
Windows 2012
-
-
OpenLDAP 2.4.x
-
Oracle Directory Server Enterprise Edition 11.1.1.7.0
-
Configure LDAP parameters
On every node, configure the LDAP parameters in the cassandra.yaml file under the authenticator.parameters section.
|
For multi-datacenter support, use the nearest available LDAP host. |
-
Set the required LDAP parameters:
Required LDAP parameters Parameter Description ldap_serversComma-separated list of LDAP servers and optional port numbers in the format
host:_port_. The default port for unencrypted connections is389. The default port for SSL connections is636. For example,ldap1:389,ldap2:389.ldap_user_search_basesList of DNs from which to start the recursive search for user entries. For example,
ou=users,dc=example,dc=com. Active Directory typically usesCN=Users,DC=example,DC=internal.ldap_user_search_filterFilter that identifies a user entry. The default is
(uid={0}). For Active Directory, use(sAMAccountName={0}).Active Directory does not allow anonymous binds, so
ldap_account_dnandldap_account_passwordare also required.Required LDAP parameters for Active Directoryauthenticator: class_name: com.datastax.cassandra.auth.AdvancedAuthenticator parameters: ldap_servers: LDAP_HOST:PORT ldap_account_dn: ACCOUNT_DN ldap_account_password: ACCOUNT_PASSWORD ldap_user_search_bases: - USER_SEARCH_BASE ldap_user_search_filter: (sAMAccountName={0})Replace the following:
-
LDAP_HOST: The hostname or IP address of the LDAP server. -
PORT: The port that the LDAP server listens on. The default for unencrypted connections is389. The default for SSL connections is636. -
ACCOUNT_DN: The distinguished name (DN) of the service account used to search for users. For example,cn=lookup_user,cn=users,dc=example,dc=com. -
ACCOUNT_PASSWORD: The password for theACCOUNT_DNaccount. -
USER_SEARCH_BASE: The DN from which to start searching for user entries. For example,cn=users,dc=example,dc=com.
-
-
Configure optional parameters as needed:
Optional LDAP parameters — account and search Parameter Description ldap_account_dnDN of the account used to search for users. This account requires only enough permissions to perform searches. Remove this parameter to use an anonymous bind.
ldap_account_passwordPassword for the
ldap_account_dnaccount. Requiresldap_account_dnto be set.ldap_account_anonymousSet to
trueto use an anonymous bind. When enabled, this parameter takes precedence overldap_account_dnandldap_account_password.ldap_search_retries_maxMaximum number of retries when a user or group search fails.
ldap_search_retries_intervalInterval between search retries.
Optional LDAP parameters — connection Parameter Description ldap_connection_use_sslSet to
trueto enable SSL connections to the LDAP server. The default isfalse.ldap_connection_use_tlsSet to
trueto enable TLS connections to the LDAP server. The default isfalse.ldap_connection_ssl_protocolSSL protocol to use when
ldap_connection_use_sslistrue. The default isTLS.ldap_connection_hostname_verificationSet to
trueto verify the LDAP server’s hostname during SSL/TLS connections. Requiresldap_connection_use_sslorldap_connection_use_tlsto betrueand a validldap_connection_truststore_path. The default isfalse.ldap_connection_truststore_pathPath to the truststore file for SSL/TLS certificates.
ldap_connection_truststore_passwordPassword for the truststore.
ldap_connection_truststore_typeType of truststore. The default is
jks.ldap_connection_timeoutTimeout for LDAP connections. The default is
PT30S(30 seconds).Optional LDAP parameters — connection pool Parameter Description ldap_connection_pool_max_connectionsMaximum size of the connection pool.
ldap_connection_pool_when_exhausted_blockSet to
trueto block new requests when the connection pool is exhausted, for the duration set inldap_connection_pool_max_wait. The default isfalse.ldap_connection_pool_max_waitMaximum time to wait for a connection when the pool is exhausted and
ldap_connection_pool_when_exhausted_blockistrue.ldap_connection_pool_max_idleMaximum number of idle connections to keep in the pool.
ldap_connection_pool_min_idleMinimum number of idle connections to keep in the pool.
ldap_connection_pool_test_on_borrowSet to
trueto validate a connection before borrowing it from the pool.ldap_connection_pool_test_on_returnSet to
trueto validate a connection before returning it to the pool.ldap_connection_pool_test_while_idleSet to
trueto validate idle connections in the pool.ldap_connection_pool_time_between_eviction_runsTime between runs of the idle connection eviction thread.
ldap_connection_pool_num_tests_per_eviction_runNumber of connections to test per eviction run.
ldap_connection_pool_min_evictable_idle_timeMinimum time a connection must be idle before the eviction thread considers removing it.
ldap_connection_pool_soft_min_evictable_idle_timeMinimum time a connection must be idle before the eviction thread considers removing it, provided the pool has more than
ldap_connection_pool_min_idleconnections.Optional LDAP parameters — caching Parameter Description ldap_caching_user_validityDuration for which HCD caches user search results. Set to
0to disable. The cache is disabled by default. Changes to user data on the LDAP server do not take effect in HCD until the cache expires.ldap_caching_user_update_intervalInterval at which HCD asynchronously refreshes cached user entries before they expire.
ldap_caching_user_max_entriesMaximum number of user entries to hold in the cache.
ldap_caching_group_validityDuration for which HCD caches group search results. Set to
0to disable. The cache is disabled by default. Changes to group data on the LDAP server do not take effect in HCD until the cache expires.ldap_caching_group_update_intervalInterval at which HCD asynchronously refreshes cached group entries before they expire.
ldap_caching_group_max_entriesMaximum number of group entries to hold in the cache.
ldap_caching_credentials_validityDuration for which HCD caches user credentials locally. Caching reduces repeated binds to the LDAP server and improves post-authentication performance. Set to
0to disable. The cache is disabled by default. Changes to credentials on the LDAP server do not take effect in HCD until the cache expires.ldap_caching_credentials_update_intervalInterval at which HCD asynchronously refreshes cached credentials before they expire.
ldap_caching_credentials_max_entriesMaximum number of credential entries to hold in the cache.
Optional LDAP parameters — failover Parameter Description ldap_failover_retry_countNumber of times HCD retries a failed LDAP server before marking it as unavailable.
ldap_failover_quarantine_opening_thresholdNumber of failures required to quarantine an LDAP server.
ldap_failover_quarantine_opening_intervalInterval during which failures are counted toward the quarantine threshold.
ldap_failover_quarantine_close_thresholdNumber of successes required to bring a quarantined LDAP server back into service.
ldap_failover_quarantine_close_intervalInterval during which successes are counted toward the close threshold.
-
For LDAP role management, choose one of the following:
-
Option 1. Configure HCD to get a list of groups from an attribute of the user entry:
parameters: ldap_group_search_type: memberof_search ldap_group_search_memberof_attribute: memberofmemberofis the attribute that contains a list of groups in the default Microsoft Active Directory LDAP scheme. OpenLDAP does not include amemberofattribute by default.Options for memberof search Parameter Setting Description ldap_group_search_typememberof_searchReads group membership from an attribute on the user entry. HCD assigns roles that exactly match any group name in that attribute.
Unmatched groups are ignored.
ldap_group_search_memberof_attributememberofAttribute on the user entry that lists the DNs of groups the user belongs to.
To use an optimized single-request search for all parent groups including inherited ones, also configure the following optional parameters:
Optional memberof search — all-parents optimization Parameter Description ldap_group_search_all_parents_memberof_attributeAttribute that lists all parent groups transitively, for LDAP servers that support this mechanism. For example, Oracle LDAP supports this with the
isMemberOfattribute. The default isisMemberOf.ldap_group_search_all_parents_search_typeSet to
memberof_searchordirectory_searchto enable the all-parents optimization. Leave empty to disable this mechanism when the LDAP server does not support it.ldap_group_search_all_parents_search_filterFilter used to find all groups a role belongs to in a single request. For example, Active Directory supports
(member:1.2.840.113556.1.4.1941:={0}). -
Option 2. Configure HCD to search group objects from the search base and return the groups that contain the user:
parameters: ldap_group_search_type: directory_search ldap_group_search_bases: - GROUP_SEARCH_BASE ldap_group_search_filter: (uniquemember={0}) ldap_group_search_name_attribute: cnReplace
GROUP_SEARCH_BASEwith the DN from which to start searching for group objects. For example,cn=internal,ou=group,dc=example,dc=com.uniquememberis the attribute that lists users in a group in the default Microsoft Active Directory LDAP scheme.Options for directory search Parameter Setting Description ldap_group_search_typedirectory_searchSearches for group objects using
ldap_group_search_basesand returns the groups that contain the user.ldap_group_search_basesGROUP_SEARCH_BASEList of DNs from which to start the recursive search for group objects.
ldap_group_search_filter(uniquemember={0})Filter that matches users within a group. In most LDAP services, this attribute is
uniquemember.ldap_group_search_name_attributecnAttribute that contains the group name that HCD matches to a role. The group name must exactly match the HCD role name, including case.
Unmatched groups are ignored.
-
-
Perform a rolling restart to implement the changes.
When adding LDAP to and authentication enabled HCD environment, DataStax recommends setting up roles for LDAP users and groups before restarting.
Use Apache Cassandra® open-source authenticators
HCD provides AdvancedAuthenticator with built-in LDAP support.
However, you can use Cassandra’s open-source authenticators if you need compatibility with existing Cassandra configurations or custom authenticator implementations.
Consider using Cassandra’s open-source authenticators when you:
-
Migrate from Cassandra and want to reuse existing LDAP configurations.
-
Have custom authenticator implementations built on Cassandra’s
IAuthenticatorinterface. -
Need specific Cassandra authenticator behavior for compatibility requirements.
Compare with AdvancedAuthenticator
Before you choose open-source authenticators, review the advantages of HCD’s AdvancedAuthenticator:
-
Multiple authentication schemes: Supports internal, LDAP, and OIDC authentication simultaneously
-
Advanced role management: Provides automatic LDAP group-to-role mapping with
AdvancedRoleManager -
Unified configuration: Centralizes all authentication settings in one location
-
Enhanced security: Offers additional configuration options and security controls
-
Modern standards: Includes built-in support for OIDC and modern authentication protocols
Configure open-source authenticators
|
To use Cassandra’s open-source authenticators, you must configure all three security components together:
|
To configure Cassandra’s open-source authenticators, do the following:
-
Open your
cassandra.yamlfile. -
Set the
authenticator,authorizer, androle_managerto use Cassandra classes:# Use Apache Cassandra's PasswordAuthenticator authenticator: org.apache.cassandra.auth.PasswordAuthenticator # Or use your custom LDAP authenticator class # authenticator: com.example.CustomLDAPAuthenticator # Must use CassandraAuthorizer with open-source authenticators authorizer: org.apache.cassandra.auth.CassandraAuthorizer # Must use CassandraRoleManager with open-source PasswordAuthenticator or a custom LDAP authenticator class. role_manager: org.apache.cassandra.auth.CassandraRoleManager -
Increase the
system_authkeyspace replication factor. For more information, see Configure the security keyspaces replication factors. -
Perform a rolling restart of all nodes in the cluster.