Set Up LDAP/LDAPS Directory

In this guide, you will configure an LDAP or LDAPS directory in Guardrails. Unlike other directory types, LDAP/LDAPS directories are not used for authentication. They sync Active Directory groups to Guardrails profiles. This is typically paired with a SAML directory that handles the actual user login.

The most common pattern is to create a SAML directory for authentication (e.g., Okta or Entra ID), then add an LDAP directory to sync group memberships from your on-premise Active Directory.

Prerequisites

Step 1: Create the LDAP Directory in Guardrails

  1. Navigate to Workspace > Directories.

  2. Click Create Directory and select LDAP.

  3. Fill in the connection details:

FieldDescription
TitleA name for the directory (e.g., Corporate AD Group Sync).
DescriptionOptional.
URLThe LDAP URL including the base DN. For LDAP: ldap://server.internal.company.com/DC=internal,DC=company,DC=com. For LDAPS: ldaps://server.internal.company.com:636/DC=internal,DC=company,DC=com.
Distinguished NameThe DN of the service account used to query AD. Example: CN=svc-guardrails,OU=ServiceAccounts,DC=internal,DC=company,DC=com. This account must have read access to all users.
PasswordThe service account password.
BASEThe LDAP base DN for user queries. Example: CN=Users,DC=internal,DC=company,DC=com.
Profile ID TemplateDefault {{profile.$source.mail}} generates IDs from the AD mail attribute. Must be unique per profile.
Group Profile ID TemplateDefault {{groupProfile.#source.cn}} generates group IDs from the common name. Must be unique per group.

Step 2: Configure TLS Settings (If Applicable)

If your organization uses TLS for LDAP connections:

SettingDescription
Enforce TLSEnable to require TLS for the LDAP connection.
Require Trusted CertificateEnable to reject connections with untrusted certificates.
CA CertificatePaste the TLS CA certificate if required.

Step 3: Configure User Filters

User filters control which AD users Guardrails discovers and syncs. All filter fields are optional. Guardrails provides sensible defaults.

FilterDescriptionExample
User Object FilterBase filter for all user searches.(&(objectCategory=person)(objectClass=user))
Disabled User FilterExcludes disabled users. Do not include the NOT operator. Guardrails adds it automatically.userAccountControl:1.2.840.113556.1.4.803:=2
User Match FilterFilter for matching a specific user during login. {{username}} is replaced with the search query.(sAMAccountName={{username}})
User Search FilterFilter for general user searches. {{username}} is replaced with the search query.`(
User Search AttributesAttributes to request from LDAP. Default * returns all attributes.*

Step 4: Configure Group Filters

Group filters control which AD groups are synced to Guardrails.

FilterDescriptionExample
Group Object FilterBase filter for all group searches.(objectCategory=group)
Disabled Group FilterExcludes disabled groups. Defaults to (description=disabled).(description=disabled)
Group Search FilterFilter for general group searches. {{groupname}} is replaced with the search query.Leave empty for default behavior.
Group Sync FilterLimits which groups sync to Guardrails. If empty, all groups the user belongs to (within the Groups Base DN) sync.(ou:dn:=DEV)

Step 5: Configure Attribute Map

The Attribute Map section maps AD attributes to Guardrails profile fields:

SettingDescriptionCommon Value
User Email AttributeAD attribute containing the user's email.mail
User Family Name AttributeAD attribute containing the user's last name.sn
Group Membership AttributeAD attribute listing group memberships.memberOf

Step 6: Create and Verify Connectivity

  1. Click Create.

  2. After creation, Guardrails runs a Turbot > IAM > LDAP Directory > Connectivity Test control automatically. Navigate to the directory detail view and verify the connectivity test control reaches the OK state.

  3. If the connectivity test fails, verify:

    • Network connectivity between Guardrails and the LDAP server
    • The service account DN and password are correct
    • The LDAP URL format is correct (including the base DN)
    • TLS settings match your server configuration

Step 7: Activate the Directory

Once the connectivity test passes, click the Activate action on the directory to enable group synchronization.

Troubleshooting

IssueSolution
Connectivity test failsVerify network path (firewall rules, VPN, VPC peering) and service account credentials.
Groups not syncingVerify the Group Sync Filter isn't too restrictive. Check that the Groups Base DN includes the groups you expect.
User attributes are emptyVerify the attribute map settings match your AD schema. Common issue: using mail when the attribute is userPrincipalName.
LDAPS connection failsVerify the server is listening on port 636, the certificate is valid, and the CA certificate is configured in TLS settings if needed.
Too many groups syncingAdd a Group Sync Filter to limit which groups are synced (e.g., (ou:dn:=Guardrails) to only sync groups in a specific OU).

Next Steps