writer-jill commented on code in PR #13245:
URL: https://github.com/apache/druid/pull/13245#discussion_r1011656742


##########
docs/operations/auth-ldap.md:
##########
@@ -22,182 +23,279 @@ title: "LDAP auth"
   ~ under the License.
   -->
 
+You can use [Lightweight Directory Access Protocol 
(LDAP)](https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol) to 
secure access to Apache Druid. This topic describes how to set up Druid 
authentication and authorization with LDAP and LDAP over TLS (LDAPS). The 
examples on this page show the configuration for an Active Directory LDAP 
system.
 
-This page describes how to set up Druid user authentication and authorization 
through LDAP. The first step is to enable LDAP authentication and authorization 
for Druid. You then map an LDAP group to roles and assign permissions to roles.
+The first step is to enable LDAP authentication and authorization for Druid. 
You then map an LDAP group to Druid roles and assign permissions to those 
roles. After you've completed this configuration you can optionally choose to 
enable LDAPS to make LDAP traffic confidential and secure.
 
-## Enable LDAP in Druid
+## Prerequisites
 
-Before starting, verify that the active directory is reachable from the Druid 
Master servers. Command line tools such as `ldapsearch` and `ldapwhoami`, which 
are included with OpenLDAP, are useful for this testing. 
+Before you start to configure LDAP for Druid, test your LDAP connection and 
perform a sample search.
 
-### Check the connection
+### Check your LDAP connection
 
-First test that the basic connection and user credential works. For example, 
given a user `[email protected]`, try:
+Verify that your LDAP connection is working by testing it with user 
credentials. For example, the following command tests the connection for the 
user `[email protected]`. Insert your LDAP server IP address and substitute 
`389` for the port number of your LDAP instance, if different.
 
 ```bash
-ldapwhoami -vv -H ldap://<ip_address>:389  -D"[email protected]" -W
+ldapwhoami -vv -H ldap://ip_address:389  -D "[email protected]" -W
 ```
 
-Enter the password associated with the user when prompted and verify that the 
command succeeded. If it didn't, try the following troubleshooting steps:  
+Enter the password for the user when prompted and verify that the command 
succeeded. If it failed, check the following:
 
-* Verify that you've used the correct port for your LDAP instance. By default, 
the LDAP port is 389, but double-check with your LDAP admin if unable to 
connect. 
-* Check whether a network firewall is not preventing connections to the LDAP 
port.
-* Check whether LDAP clients need to be specifically whitelisted at the LDAP 
server to be able to reach it. If so, add the Druid Coordinator server to the 
AD whitelist. 
+- Make sure you're using the correct port for your LDAP instance.
+- Check whether a network firewall is preventing connections to the LDAP port.
+- Review your LDAP implementation details to see whether you need to 
specifically whitelist LDAP clients at the LDAP server. If so, add the Druid 
Coordinator server to the whitelist.
 
+### Test your LDAP search
 
-### Check the search criteria
+Once your LDAP connection is working, search for a user. For example, the 
following command searches for the user myuser in an Active Directory system. 
The `sAMAccountName` attribute is specific to Active Directory and contains the 
authenticated user identity:
 
-After verifying basic connectivity, check your search criteria. For example, 
the command for searching for user `[email protected] ` is as follows: 
+```bash
+ldapsearch -x -W -H ldap://ip_address:389  -D "cn=admin,dc=example,dc=com" -b 
"dc=example,dc=com" "(sAMAccountName=myuser)" +
+```
+
+The `memberOf` attribute in the results shows the groups the user belongs to. 
For example, the following response shows that the user is a member of the 
`group1` group:
 
 ```bash
-ldapsearch -x -W -H ldap://<ldap_server>  -D"[email protected]" -b 
"dc=example,dc=com" "(sAMAccountName=uuser1)"
+memberOf: cn=group1,ou=groups,dc=example,dc=com
 ```
 
-Note the `memberOf` attribute in the results; it shows the groups that the 
user belongs to. You will use this value to map the LDAP group to the Druid 
roles later. This attribute may be implemented differently on different types 
of LDAP servers. For instance, some LDAP servers may support recursive 
groupings, and some may not. Some LDAP server implementations may not have any 
object classes that contain this attribute altogether. If your LDAP server does 
not use the `memberOf` attribute, then Druid will not be able to determine a 
user's group membership using LDAP. The sAMAccountName attribute used in this 
example contains the authenticated user identity. This is an attribute of an 
object class specific to Microsoft Active Directory. The object classes and 
attribute used in your LDAP server may be different.
+You use this information to map the LDAP group to Druid roles in a later step. 
+
+> Druid uses the `memberOf` attribute to determine a group's membership using 
LDAP. If your LDAP server implementation doesn't include this attribute, you 
must complete some additional steps when you [map LDAP groups to Druid roles]().
 
-## Configure Druid user authentication with LDAP/Active Directory 
+## Configure Druid for LDAP authentication
 
-1. Enable the `druid-basic-security` extension in the 
`common.runtime.properties` file. See [Security Overview](security-overview.md) 
for details.   
-2. As a best practice, create a user in LDAP to be used for internal 
communication with Druid. 
-3. In `common.runtime.properties`, update LDAP-related properties, as shown in 
the following listing: 
-       ```
-       druid.auth.authenticatorChain=["ldap"]
-       druid.auth.authenticator.ldap.type=basic
-       druid.auth.authenticator.ldap.enableCacheNotifications=true
-       druid.auth.authenticator.ldap.credentialsValidator.type=ldap
-       druid.auth.authenticator.ldap.credentialsValidator.url=ldap://<AD 
host>:<AD port>
-       druid.auth.authenticator.ldap.credentialsValidator.bindUser=<AD admin 
user, e.g.: [email protected]>
-       druid.auth.authenticator.ldap.credentialsValidator.bindPassword=<AD 
admin password>
-       druid.auth.authenticator.ldap.credentialsValidator.baseDn=<base dn, 
e.g.: dc=example,dc=com>
-       druid.auth.authenticator.ldap.credentialsValidator.userSearch=<The LDAP 
search, e.g.: (&(sAMAccountName=%s)(objectClass=user))>
-       
druid.auth.authenticator.ldap.credentialsValidator.userAttribute=sAMAccountName
-       druid.auth.authenticator.ldap.authorizerName=ldapauth
-       druid.escalator.type=basic
-       druid.escalator.internalClientUsername=<AD internal user, e.g.: 
[email protected]>
-       druid.escalator.internalClientPassword=Welcome123
-       druid.escalator.authorizerName=ldapauth
-       druid.auth.authorizers=["ldapauth"]
-       druid.auth.authorizer.ldapauth.type=basic
-       druid.auth.authorizer.ldapauth.initialAdminUser=AD user who acts as the 
initial admin user, e.g.: [email protected]>
-       druid.auth.authorizer.ldapauth.initialAdminRole=admin
-       druid.auth.authorizer.ldapauth.roleProvider.type=ldap
+To configure Druid to use LDAP authentication, follow these steps. See 
[Configuration reference](../configuration/index.md) for the location of the 
configuration files. 
+
+1. Create a user in your LDAP system that you'll use for internal 
communication with Druid. See [Security overview](./security-overview.md) for 
more information.

Review Comment:
   Updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to