forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ccl, sql: add authZ handler for ldap groups retrieval
informs cockroachdb#125087 fixes CRDB-39227 Epic CRDB-33829 This PR adds support for fetching LDAP groups info for sql user trying to gain authorization for cockroach cluster via LDAP. This change will enable us to assign appropriate role privileges for user on CRDB. Release note(enterprise, security): We add support for authorization to CRDB cluster via LDAP, retrieving AD groups membership information for LDAP user. The new HBA conf cluster setting option `ldapgrouplistfilter` performs filtered search query on LDAP for matching groups. Example hba conf entry to support LDAP authZ configuration: ``` # TYPE DATABASE USER ADDRESS METHOD OPTIONS # Allow all users to connect to using LDAP authentication with search and bind host all all all ldap ldapserver=ldap.example.com ldapport=636 "ldapbasedn=ou=users,dc=example,dc=com" "ldapbinddn=cn=readonly,dc=example,dc=com" ldapbindpasswd=readonly_password ldapsearchattribute=uid "ldapsearchfilter=(memberof=cn=cockroachdb_users,ou=groups,dc=example,dc=com)" "ldapgrouplistfilter=(objectClass=groupOfNames)" # Fallback to password authentication for the root user host all root 0.0.0.0/0 password ``` Example to use for azure AD server: ``` SET cluster setting server.host_based_authentication.configuration = 'host all all all ldap ldapserver=azure.dev ldapport=636 "ldapbasedn=OU=AADDC Users,DC=azure,DC=dev" "ldapbinddn=CN=Some User,OU=AADDC Users,DC=azure,DC=dev" ldapbindpasswd=my_pwd ldapsearchattribute=sAMAccountName "ldapsearchfilter=(memberOf=CN=azure-dev-domain-sync-users,OU=AADDC Users,DC=crlcloud,DC=dev)" "ldapgrouplistfilter=(objectCategory=CN=Group,CN=Schema,CN=Configuration,DC=crlcloud,DC=dev)" host all root 0.0.0.0/0 password'; ``` Post configuration CRDB cluster should be able to authorize users via LDAP server if: 1. Users LDAP authentication attempt is successful, and it has the user's DN for LDAP server. 2. `ldapgrouplistfilter` is properly configured, and it successfully syncs groups of the user.
- Loading branch information
Showing
9 changed files
with
770 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.