Configure Authentication Method for Active Directory Integration
This topic describes how to integrate the authentication method of the and Microsoft Active Directory. You will learn how to retrieve and validate User ID/Group ID information from the Active Directory for authentication.
gateway83
This topic describes how to integrate the authentication method of the
API Gateway
and Microsoft Active Directory. You will learn how to retrieve and validate User ID/Group ID information from the Active Directory for authentication.This topic assumes that you are familiar with Microsoft Active Directory.
Instructions on configuring the Microsoft Active Directory are provided "as is" and are accurate at the time of writing. The Microsoft Active Directory interface may change at any time without notice. Consult the Active Directory documentation from Microsoft for the most current information.
Prerequisites:
- Ensure that the Windows Domain has Services for UNIX or a similar extension to the schema incorporated.
- Create an LDAP browser user through Active Directory Users and Computers MMC. Define that User cannot change password and Password never expires. After the user is created, set the UNIX attributes for the user to UID and GID 499, with home directory set to:/dev/null and shell /bin/false
- Secure TLS connections should have a certificate that is imported into the Domain Controller. This certificate should be available as a standalone PEM file or available through a URL
Contents:
Step 1: Preparation
Configure the user and group objects for the Windows accounts, to ensure POSIX compliancy.
- Connect to the Active Directory Server and open theActive Directory Users and Computersmanagement tool.
- Modify a group object to function as a POSIX group:
- Right-click the group object and selectProperties.
- Select theUnix Attributestab.
- Complete theNIS DomainandGIDnumber as appropriate.
- Modify a user object to function as a POSIX user:
- Right-click the user object and selectProperties.
- Select theUnix Attributestab.
- Complete the fields on the tab.Tip:The "Home Directory" is the same as "/home/" on the Linux file system.
- Add the user as a UNIX member of the group:
- Right-click the group object and selectProperties.
- Select theUnix Attributestab.
- Ensure that the NIS Domain is correct.
- ClickAdd.
- Select your user and then clickOK.
Step 2: Configure Authentication Method on the Gateway
- Access the Gateway main menu.
- Select1(Configure system settings) and then4(Configure authentication method).
- Select2(LDAP) as the authentication method.
- Complete the authentication wizard as follows:
- Is the directory service to be used an Active Directory?y
- Do you want to use LDAPS (secure)?Enteryornas appropriate
- Enter the address of the LDAP server:Enter the address of the LDAP server (for example, "machine.mycompany.com").
- Enter the LDAP server port:The default port should suffice. Enter a custom port number if you know it has changed.
- Enter the LDAP base DN:Enter the Base DN that defines where the LDAP query begins looking for objects in the Active Directory (for example, "dc=example,dc=com")The scope attribute confines the search to the base, one level below, or to search through all lower levels. Specify the scope by enteringbase,one, orsub, respectively.
- Do you want to enable LDAP Anonymous Bind?Enteryornas appropriate for the needs of your organization. Anonymous binding is a bind request that uses simple authentication with no (that is, zero length) bind DN or password.If you enable LDAP Anonymous Bind, the next two prompts are not displayed.
- (If Anonymous Bind disabled) Enter the LDAP bind DN:Optionally specify the Bind DN (for example, cn=browse,cn=users,dc=example,dc=com).Without a secure communication, a bind user is required to query the LDAP contents. This account is a domain user with read access. The password for this user should be written to the/etc/ldap.secretfile and should not be visible as plain text.
- (If Anonymous Bind disabled) Enter the LDAP bind password:Enter the password for the LDAP browser user.
- Which object in the LDAP will be used to find the password for users:Specify the appropriate object. This is usually "CN=Users".
- Enter the object class that contains the attributes for creating the local user account:Specify the appropriate class. The default is often sufficient ("posixAccount, Default ActiveDirectory=user").
- Do you want to change the current setting:Entery.
- Select the filter for account access:pam_filter
- pam_filterfilters by account attributes. Example:"gidNumber=4000" grants access to accounts that have attribute "gidNumber" and the value is "4000".
- groupdnfilters by the full domain name of the target group that contains the list of memberUid.
- Enter the pam_filter to limit account access: Enter a gidNumber (for example: "gidNumber=501").
- Specify the PAM login attribute name:uid
- You should now see a summary of your configuration (example below). Review your settings carefully before applying the configuration.Authentication Configuration Summary-------------------------------------------------------Label | Value------------------------------------------------------------------------------Secure | falseActiveDirectory | falseServer | ad.example.com BaseDn | dc=example,dc=comPort | 389AnonymousBind | falseBindDn | CN=test,CN=Users,dc=l7net,dc=localBindPassword | <Hidden>Object for finding the password for users | CN=UsersCertificate Action | NEVERFilter for account access | gidNumber=501PAM login attribute | uid
Step 3: Map Attributes
Certain
nss
attributes on the local UNIX LDAP differ from how they are referenced on the Windows server. You resolve these differences by mapping the attributes.Before you proceed, ensure that you have:
- A print out of your test users' attribute
- Access to one of the domain controllers (preferably one that has permissions to modify the attribute values).
The UNIX attribute names vary slightly depending on the version of the SFU packages. Use the suggestions that are shown here for reference purposes only.
Map the following attributes to suit your environment:
- nss_base_passwd
- nss_base_shadow
- nss_base_group
In general, you can use the value of the base variable. If your Active Directory authenticates for a sub-domain, you must adjust accordingly.
The userPassword line is not necessary when pam_password is set to 'ad'. In this case, the pam_ldap module controls the management of password functions, using the Active Directory password stored in the unicodePwd attribute.
Step 4: Update LDAP Configuration File
- Open/etc/pam_ldap.confin a text editor.
- Uncomment the following lines in the file:# RFC 2307 (AD) mappingsnss_map_objectclass posixAccount usernss_map_objectclass shadowAccount usernss_map_attribute uid sAMAccountNamenss_map_attribute homeDirectory unixHomeDirectorynss_map_attribute shadowLastChange pwdLastSetnss_map_objectclass posixGroup groupnss_map_attribute uniqueMember membernss_override_attribute_value loginShell /bin/bashnss_map_attribute uidNumber uidNumberpam_login_attribute sAMAccountNamepam_filter objectclass=Userpam_password adAbout the PAM attributes:
- Pam_login_attributedefines the username that the user logs in with. To ensure consistency with Active Directory and Services for UNIX, use thesAMAccountNameattribute.
- Pam_filterfilters user accounts. This helps prevent you from authenticating users against other Active Directory objects.
- Pam_passworddefines the password for Active Directory. Set this toadto prevent issues from occurring when you change your password from the Linux workstation
- Save and exit.
Step 5: Updates for CentOS and RHEL
Update the following files when configuring LDAP authentication for CentOS and RHEL:
- /etc/pam.d/sshd
- /etc/pam.d/login
Add
account sufficient pam_localuser.so
before account required pam_ldap.so ignore_authinfo_unavail ignore_unknown_user
as shown below:account sufficient pam_localuser.so account required pam_ldap.so ignore_authinfo_unavail ignore_unknown_user
Step 6: Restart the Gateway
Restart the Gateway for the configuration changes to take effect:
- SelectX(Exit menu).
- SelectR(Reboot the Gateway appliance).