Setting up self-managed Active Directory
To set up a self-managed AD, take the following steps.
Topics
Step 1: Create an Organizational Unit in your AD
Important
We recommend creating a dedicated OU and service credential scoped to that OU for any Amazon account that owns an RDS for SQL Server DB instance joined your self-managed AD domain. By dedicating an OU and service credential, you can avoid conflicting permissions and follow the principal of least privilege.
To create an OU in your AD
-
Connect to your AD domain as a domain administrator.
-
Open Active Directory Users and Computers and select the domain where you want to create your OU.
-
Right-click the domain and choose New, then Organizational Unit.
-
Enter a name for the OU.
-
Keep the box selected for Protect container from accidental deletion.
-
Click OK. Your new OU will appear under your domain.
Step 2: Create an AD domain service account in your AD
The domain service account credentials will be used for the secret in Amazon Secrets Manager.
To create an AD domain service account in your AD
-
Open Active Directory Users and Computers and select the domain and OU where you want to create your user.
-
Right-click the Users object and choose New, then User.
-
Enter a first name, last name, and logon name for the user. Click Next.
-
Enter a password for the user. Don't select "User must change password at next login". Don't select "Account is disabled". Click Next.
-
Click OK. Your new user will appear under your domain.
Step 3: Delegate control to the AD domain service account
To delegate control to the AD domain service account in your domain
-
Open Active Directory Users and Computers MMC snap-in and select the domain where you want to create your user.
-
Right-click the OU that you created earlier and choose Delegate Control.
-
On the Delegation of Control Wizard, click Next.
-
On the Users or Groups section, click Add.
-
On the Select Users, Computers, or Groups section, enter the AD domain service account you created and click Check Names. If your AD domain service account check is successful, click OK.
-
On the Users or Groups section, confirm your AD domain service account was added and click Next.
-
On the Tasks to Delegate section, choose Create a custom task to delegate and click Next.
-
On the Active Directory Object Type section:
-
Choose Only the following objects in the folder.
-
Select Computer Objects.
-
Select Create selected objects in this folder.
-
Select Delete selected objects in this folder and click Next.
-
-
On the Permissions section:
-
Keep General selected.
-
Select Validated write to DNS host name.
-
Select Validated write to service principal name and click Next.
-
To enable Kerberos authentication, keep Property-specific selected and select Write servicePrincipalName from the list.
-
-
For Completing the Delegation of Control Wizard, review and confirm your settings and click Finish.
-
For Kerberos authentication, open the DNS Manager and open Server properties.
-
In the Windows dialog box, type
dnsmgmt.msc
. -
Add the AD domain service account under the Security tab.
-
Select the Read permission and apply your changes.
-
Step 4: Create an Amazon KMS key
The KMS key is used to encrypt your Amazon secret.
To create an Amazon KMS key
Note
For Encryption Key, don't use the Amazon default KMS key. Be sure to create the Amazon KMS key in the same Amazon account that contains the RDS for SQL Server DB instance that you want to join to your self-managed AD.
-
In the Amazon KMS console, choose Create key.
-
For Key Type, choose Symmetric.
-
For Key Usage, choose Encrypt and decrypt.
-
For Advanced options:
-
For Key material origin, choose KMS.
-
For Regionality, choose Single-Region key and click Next.
-
-
For Alias, provide a name for the KMS key.
-
(Optional) For Description, provide a description of the KMS key.
-
(Optional) For Tags, provide a tag the KMS key and click Next.
-
For Key administrators, provide the name of an IAM user and select it.
-
For Key deletion, keep the box selected for Allow key administrators to delete this key and click Next.
-
For Key users, provide the same IAM user from the previous step and select it. Click Next.
-
Review the configuration.
-
For Key policy, include the following to the policy Statement:
{ "Sid": "Allow use of the KMS key on behalf of RDS", "Effect": "Allow", "Principal": { "Service": [ "rds.amazonaws.com" ] }, "Action": "kms:Decrypt", "Resource": "*" }
-
Click Finish.
Step 5: Create an Amazon secret
To create a secret
Note
Be sure to create the secret in the same Amazon account that contains the RDS for SQL Server DB instance that you want to join to your self-managed AD.
-
In Amazon Secrets Manager, choose Store a new secret.
-
For Secret type, choose Other type of secret.
-
For Key/value pairs, add your two keys:
For the first key, enter
SELF_MANAGED_ACTIVE_DIRECTORY_USERNAME
.For the value of the first key, enter only the username (without the domain prefix) of the AD user. Do not include the domain name as this causes instance creation to fail.
For the second key, enter
SELF_MANAGED_ACTIVE_DIRECTORY_PASSWORD
.For the value of the second key, enter the password that you created for the AD user on your domain.
-
For Encryption key, enter the KMS key that you created in a previous step and click Next.
-
For Secret name, enter a descriptive name that helps you find your secret later.
-
(Optional) For Description, enter a description for the secret name.
-
For Resource permission, click Edit.
-
Add the following policy to the permission policy:
Note
We recommend that you use the
aws:sourceAccount
andaws:sourceArn
conditions in the policy to avoid the confused deputy problem. Use your Amazon Web Services account foraws:sourceAccount
and the RDS for SQL Server DB instance ARN foraws:sourceArn
. For more information, see Preventing cross-service confused deputy problems. -
Click Save then click Next.
-
For Configure rotation settings, keep the default values and choose Next.
-
Review the settings for the secret and click Store.
-
Choose the secret you created and copy the value for the Secret ARN. This will be used in the next step to set up self-managed Active Directory.