Active Directory

Rotating Active Directory user accounts remotely using KeeperPAM

Overview

In this guide, you'll learn how to remotely rotate Active Directory user accounts using KeeperPAM.

Prerequisites

This guide assumes the following tasks have already taken place:

1. Set up a PAM User Record

Keeper Rotation will use the credentials in this PAM User record to rotate other accounts in your directory. This account does not need to be a domain admin account, but needs to be able to successfully change passwords for other accounts.

PAM User record for AD Admin
PAM User record for AD Admin

The PAM User record needs to be in a shared folder that is shared to the KSM application created in the pre-requisites. Only the KSM application needs access to this privileged account, it does not need to be shared with any users.

PAM User Record Fields

Field
Description

Record Type

PAM User

Title

Keeper record title

Login

The username of the Active Directory admin. The format of the username depends on the target system and type of service. Examples: Administrator [email protected]

Password

Password of the admin user on the Active Directory.

Distinguished Name

Full Distinguished Name (DN) of the admin user on the Active Directory.

2. Set up a PAM Configuration

A PAM Configuration associates an environment with a Keeper Gateway and credentials. If you don't have a PAM Configuration set up yet for this use case, create one.

Field
Description

Title

Configuration name, example: My Active Directory

Environment

Select: Domain Controller

Gateway

Select the Gateway that has access to your directory server

Application Folder

Select the Shared folder that contains the PAM User record created in step 1.

Administrative Credential

Select the PAM User record created in step 1.

Hostname or IP Address

Enter the domain or IP address of your Active Directory domain.

Port

Enter 636 (LDAPS). 389 LDAP is not supported for rotations.

Use SSL

Ensure this checkbox is checked.

3. Set up PAM User records

KeeperPAM will use the credentials linked from the PAM User record to rotate other PAM User records in your environment. The PAM User credential needs to be saved in a shared folder that is assigned to the secrets manager application. In the example below, the AD user demouser can be rotated.

Example of Active Directory account password rotation

PAM User Record Fields

Field
Description

Record Type

PAM User

Title

Keeper record title, e.g. AD User - demouser

Login

Username of the account being rotated. The format of the username depends on the target system and type of service. Examples: demouser [email protected]

Password

Account password is optional. In most cases, a password rotation will not require the existing password to be present. However there are some scenarios and protocols which may require it.

Distinguished Name

The LDAP DN for the user, e.g. CN=Demo User,CN=Users,DC=lureydemo,DC=local

If you don't know the user's DN, the following PowerShell command can be used to find it:

Get-ADUser -Identity <username> -Properties DistinguishedName

4. Configure Rotation on the Record

Select the PAM User record, edit the record and open the Password Rotation Settings.

Any user with edit rights to a PAM User record and enforcement policies allowing rotation has the ability to set up rotation for that record.

PAM User scheduled rotations
PAM User scheduled rotations
  • The "Rotation" should be of type IAM User.

  • The "PAM Configuration" field should point to the Active Directory PAM Configuration created in step 2.

  • Select the desired schedule and password complexity.

  • Upon saving, the rotation button will be enabled and available to rotate on demand, or via the selected schedule.

Troubleshooting

An easy way to test if LDAP is properly configured is to run 'LDP.exe' and test the connection. If this connection succeeds, then Keeper Rotation should also succeed.

Testing and LDAP connection with LDP.exe

Testing with a Self-Signed Cert

For the purpose of testing an Active Directory user account rotation with Keeper, it is necessary to ensure that the LDAPS connection is active and using a valid certificate. If you are just testing and don't have a production certificate, the instructions below provide you with a self-signed cert.

1

Create a cert

From PowerShell running as an administrator, create a self-signed cert. Note that the subject name and alternate names of the certificate must match with the server hostname. In this example, the primary name is XYZ123.company.local with alternate names company.local and company.

New-SelfSignedCertificate -DnsName XYZ123.company.local,company.local,company, -CertStoreLocation cert:\LocalMachine\My
2

Install the cert

This script will locate the cert in the personal section of the certificate manager and copy it into the trusted domains. Replace the company parameter in the first line of this script with the domain in step 1.

# Get the cert we just created
$cert = Get-ChildItem -Path "Cert:\LocalMachine\My" | Where-Object {$_.Subject -like "*company*"}
$thumbprint = ($cert.Thumbprint | Out-String).Trim()

# Copy to NTDS through registry
$certStoreLoc = 'HKLM:/Software/Microsoft/Cryptography/Services/NTDS/SystemCertificates/My/Certificates'
if (!(Test-Path $certStoreLoc)) {
    New-Item $certStoreLoc -Force
}
Copy-Item -Path HKLM:/Software/Microsoft/SystemCertificates/My/Certificates/$thumbprint -Destination $certStoreLoc

# Copy to Trusted Root store
$rootStore = New-Object System.Security.Cryptography.X509Certificates.X509Store([System.Security.Cryptography.X509Certificates.StoreName]::Root, 'LocalMachine')
$rootStore.Open('ReadWrite')
$rootStore.Add($cert)
$rootStore.Close()
3

Restart NTDS

After restarting the NTDS service, the certificate should be installed.

Restart-Service NTDS -force
4

Check the connectivity

Run 'LDP.exe' and make sure that you're able to connect to the local domain over port 636 with SSL enabled.

Connect using LDP.exe

Last updated

Was this helpful?