AWS Security Blog
How to improve LDAP security in AWS Directory Service with client-side LDAPS
You can now better protect your organization’s identity data by encrypting Lightweight Directory Access Protocol (LDAP) communications between AWS Directory Service products (AWS Directory Service for Microsoft Active Directory, also known as AWS Managed Microsoft AD, and AD Connector) and self-managed Active Directory. Client-side secure LDAP (LDAPS) support enables applications that integrate with AWS Directory Service, such as Amazon WorkSpaces and AWS Single Sign-On, to connect to AD using Secure Sockets Layer/Transport Layer Security (SSL/TLS).
Note: In 2017, AWS Directory Service released server-side LDAPS support in AWS Managed Microsoft AD. This update adds client-side LDAPS support to both AWS Managed Microsoft AD and AD Connector.
In this post, I’ll step through configuring client-side LDAPS to enable encrypted communications between Amazon WorkSpaces and an Amazon Elastic Compute Cloud (Amazon EC2)-based self-managed AD.
When you have completed the steps outlined in this post, your solution will look like Figure 1:
To build the solution, you will follow a three step process:
- Prepare all prerequisites, including the setup of certificate-based security in the self-managed AD environment.
- Register your certificate authority (CA) certificate into AWS Directory Service and enable client-side LDAPS (purple arrow in diagram above).
- Test client-side LDAPS using Amazon WorkSpaces and AWS Directory Service (yellow arrows in diagram above).
Step one: Set up prerequisites
To follow the steps described in this blog, you will need:
- A self-managed AD deployment to store your user identities. You can find setup guidance in “Step 1: Set Up Your Environment for Trusts” of the Tutorial: Creating a Trust from AWS Managed Microsoft AD to a Self-Managed Active Directory Installation on Amazon EC2.
- A server authentication certificate installed on your self-managed AD domain controller. Creating the certificate is typically done one of two ways:
- Using Active Directory Certificate Services (AD CS) in Windows Server to deploy an in-house CA for issuing server certificates. For help with setting up an AD CS deployment that supports LDAPS, see Microsoft’s LDAP over SSL (LDAPS) Certificate.
- Purchasing SSL certificates from a commercial CA like Verisign or AWS Certificate Manager. For help using commercial certificates with AD, see How to enable LDAP over SSL with a third-party certification authority.
- An AWS Directory Service directory, either AWS Managed Microsoft AD or AD Connector, to act as a bridge from AWS to your self-managed AD. See the documentation for AWS Managed Microsoft AD or AD Connector for detailed steps and tutorials. If you’re using AWS Managed Microsoft AD, also set up a two-way trust with your self-managed AD using Tutorial: Creating a Trust from AWS Managed Microsoft AD to a Self-Managed Active Directory Installation on Amazon EC2.
- Amazon WorkSpaces connected to your AWS Directory Service directory to look up and authenticate users. See the WorkSpaces documentation for detailed steps on using AWS Managed Microsoft AD with a Trusted Domain or AD Connector.
The remainder of this post assumes you have:
- Created an AWS Managed Microsoft AD instance called corp.example.com
- Connected corp.example.com via two-way trust to an EC2-based self-managed AD called example.local
- Deployed an AD CS enterprise root certificate authority in example.local with the common name Example SelfManaged CA.
When you perform the steps described below, you should replace these names with the names you selected.
Step two: Configure client-side LDAPS in AWS Directory Service
Now, you’ll retrieve the CA certificate — which represents the issuing certificate authority — from your self-managed AD and use it to enable client-side LDAPS in AWS Directory Service. To review CA certificate requirements for AWS Directory Service, see the client-side LDAPS documentation for AWS Managed Microsoft AD or AD Connector.
- Export the CA certificate from the example.local CA:
- To open the Certification Authority MMC snap-in, on the example.local server hosting AD CS, right-click the Windows icon, select Run, type certsrv.msc, and select OK.
- Right-click the name of the CA (in this case, Example SelfManaged CA) and select Properties.
- In the Properties window, on the General tab, under CA certificates, select the CA certificate listed, and then select View Certificate.
- In the Certificate window, on the Details tab, select Copy to File.
- In the Certificate Export Wizard, select Next.
- In the Export File Format screen, select Base-64 encoded X.509 (.CER), and then select Next. This saves the file in the format required by AWS.
- Select Browse, and then select a file name and save location for the CA certificate.
- Select Save, and then click Next.
- Select Finish, then select OK to complete the export process.
- Copy the file to a location accessible by the machine where you will be performing the AWS Directory Service configuration.
- Register the example.local CA certificate in AWS Directory Service:
- In the AWS Management Console, select Directory Service, and then select the Directory ID link for the AWS Directory Service directory connected to example.local (in this case, corp.example.com).
- On the Directory details page, in the Networking & security tab, in the Client-side LDAPS section (shown in Figure 5), select the Actions menu, and then select Register certificate.
- In the Register a CA certificate dialog box, select Browse, navigate to the location where you stored the CA certificate for your AD CS certificate authority, select Open, and then select Register certificate.
- Enable client-side LDAPS in AWS Directory Service:
- In the Client-side LDAPS section, once the Registration status field for the certificate reads Registered, select the Enable button. Click the Refresh button for updated status.
- In the Enable client-side LDAPS dialog box, select Enable.
- In the Client-side LDAPS section, under Status, when the status field changes to Enabled, LDAPS is successfully configured. Click the Refresh button for updated status.
Step three: Test client-side LDAPS with Amazon WorkSpaces
The last step is to test client-side LDAPS with an AWS application. Now that client-side LDAPS has been configured, all LDAP traffic to the self-managed AD will be encrypted and travel over port 636.
Note: Ensure that AWS security group, network firewall, and Windows firewall settings applied to the AWS Directory Service directory (outbound) and self-managed AD (inbound) allow TCP communications on port 636.
To test your client-side LDAPS configuration, perform a WorkSpaces user look up:
- In the AWS Management Console, choose WorkSpaces, and then click Launch WorkSpaces.
- On the Select a Directory screen, pick corp.example.com and then select Next Step.
- On the Identify Users screen, In the Select trust from forest menu, select example.local, and then select Show All Users (see Figure 9 for an example). This search will be executed over LDAPS.
In this post, we’ve explored how client-side LDAPS support in AWS Managed Microsoft AD and AD Connector improves LDAP security for AWS applications and services like Amazon WorkSpaces, AWS Single Sign-On, and Amazon QuickSight by encrypting sensitive network traffic between AWS and Active Directory.
To learn more about using AWS Managed Microsoft AD or AD Connector, visit the AWS Directory Service documentation. For general information and pricing, see the AWS Directory Service home page. If you have comments about this blog post, submit a comment in the Comments section below. If you have implementation or troubleshooting questions, start a new thread on the Directory Service forum or contact AWS Support.
Want more AWS Security how-to content, news, and feature announcements? Follow us on Twitter.