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
- Signed in to Guardrails with
Turbot/Ownerpermissions at the Turbot (root) level. - Network connectivity from the Guardrails workspace to your LDAP server (may require VPN or VPC peering for enterprise installations).
- An Active Directory service account with read access to users and groups.
- Knowledge of your AD structure: domain name, organizational units, and group names.
Step 1: Create the LDAP Directory in Guardrails
-
Navigate to Workspace > Directories.
-
Click Create Directory and select LDAP.
-
Fill in the connection details:
| Field | Description |
|---|---|
| Title | A name for the directory (e.g., Corporate AD Group Sync). |
| Description | Optional. |
| URL | The 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 Name | The 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. |
| Password | The service account password. |
| BASE | The LDAP base DN for user queries. Example: CN=Users,DC=internal,DC=company,DC=com. |
| Profile ID Template | Default {{profile.$source.mail}} generates IDs from the AD mail attribute. Must be unique per profile. |
| Group Profile ID Template | Default {{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:
| Setting | Description |
|---|---|
| Enforce TLS | Enable to require TLS for the LDAP connection. |
| Require Trusted Certificate | Enable to reject connections with untrusted certificates. |
| CA Certificate | Paste 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.
| Filter | Description | Example |
|---|---|---|
| User Object Filter | Base filter for all user searches. | (&(objectCategory=person)(objectClass=user)) |
| Disabled User Filter | Excludes disabled users. Do not include the NOT operator. Guardrails adds it automatically. | userAccountControl:1.2.840.113556.1.4.803:=2 |
| User Match Filter | Filter for matching a specific user during login. {{username}} is replaced with the search query. | (sAMAccountName={{username}}) |
| User Search Filter | Filter for general user searches. {{username}} is replaced with the search query. | `( |
| User Search Attributes | Attributes to request from LDAP. Default * returns all attributes. | * |
Step 4: Configure Group Filters
Group filters control which AD groups are synced to Guardrails.
| Filter | Description | Example |
|---|---|---|
| Group Object Filter | Base filter for all group searches. | (objectCategory=group) |
| Disabled Group Filter | Excludes disabled groups. Defaults to (description=disabled). | (description=disabled) |
| Group Search Filter | Filter for general group searches. {{groupname}} is replaced with the search query. | Leave empty for default behavior. |
| Group Sync Filter | Limits 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:
| Setting | Description | Common Value |
|---|---|---|
| User Email Attribute | AD attribute containing the user's email. | mail |
| User Family Name Attribute | AD attribute containing the user's last name. | sn |
| Group Membership Attribute | AD attribute listing group memberships. | memberOf |
Step 6: Create and Verify Connectivity
-
Click Create.
-
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
OKstate. -
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
| Issue | Solution |
|---|---|
| Connectivity test fails | Verify network path (firewall rules, VPN, VPC peering) and service account credentials. |
| Groups not syncing | Verify the Group Sync Filter isn't too restrictive. Check that the Groups Base DN includes the groups you expect. |
| User attributes are empty | Verify the attribute map settings match your AD schema. Common issue: using mail when the attribute is userPrincipalName. |
| LDAPS connection fails | Verify 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 syncing | Add 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
- Set Up Okta: Pair this LDAP directory with a SAML directory for authentication.
- Set Up Entra ID: Pair with Entra ID for authentication.
- Profiles: Understand how synced group profiles work.