LDAP directory group sync
HERD can mirror group membership from your LDAP or Active Directory: map a directory group to a HERD group, sync on demand or on an interval, and let a sweep deactivate users the directory no longer lists. This page is the admin surface for all of it.
A mapping says "this directory group is that HERD group." A sync run makes the HERD side match the directory: memberships are added and removed, missing users are provisioned, and every run leaves an audit row. Group membership drives device visibility, so a sync run can change what people see and reserve.
Finding it
Where it lives
Go to Administration → LDAP Sync (/admin/ldap-sync). It is admin only. The page opens even when sync is off and says so: on a local-auth deployment you get a gray banner ("This deployment uses local authentication; directory sync is inactive") and existing mappings stay viewable and deletable for cleanup, while Create mapping and Sync now stay disabled.
For the buttons to light up you need, in order:
- HERD in LDAP mode (
AUTH_METHOD=ldap). The page confirms the mode before enabling anything. - A service account. Sync refuses to run over an anonymous bind.
ldap_group_sync_enabledfor the interval loop. Without it the page says "Automatic sync is disabled; runs are manual-only" and only Sync now works.
Step one
Mapping groups
Click Create mapping, paste the directory group's DN, and pick the HERD group it should drive. A directory group DN maps to exactly one HERD group and vice versa; creating a mapping to a group that is already mapped is refused. A mapping whose directory group currently has no members is accepted with a warning, not rejected: an amber banner names the DN so you can catch a typo that points at a non-group, while a legitimately empty group still maps.
Automatic sync runs every 1 hour.
| Directory group DN | Directory name | HERD group | Created | Actions |
|---|---|---|---|---|
| cn=herd-eng,ou=groups,dc=company,dc=local | herd-eng | lab-a | 2026-08-16 | Delete |
| cn=qa-lab,ou=groups,dc=company,dc=local | qa-lab | qa | 2026-08-21 | Delete |
| Started | Trigger | Status | Added | Removed | Skipped | Deactivated | Reactivated | Detail |
|---|---|---|---|---|---|---|---|---|
| 08-31 09:00 | interval | success | 3 | 1 | 0 | 0 | 1 | Details |
The LDAP Sync page (Administration → LDAP Sync): mappings on top, run history below.
- The status line. Confirms the mode and the interval; on a manual-only deployment it reads "Automatic sync is disabled; runs are manual-only."
- A mapping row. The directory DN, its cached display name, and the HERD group it drives. Deleting a mapping stops the syncing; the HERD group keeps its current members.
- Sync now. Starts one run in the background; the history below polls while it runs.
- A run row. Counts for everything the run did, plus a Details expander for per-item skips and their reasons.
Step two
Running a sync
Only one run executes at a time. Clicking Sync now while a run is in progress reports "A sync run is already in progress" (or "on another replica"); that is information, not an error.
What a run does, per mapped group:
- Membership converges to the directory. HERD group memberships are added and removed to match the directory's member list; a member with no HERD account yet is provisioned first.
- An incomplete read never deletes memberships. A member the directory cannot fully describe (missing email or username) is skipped, and when that happens removals for that group are suppressed for the run, since the skipped entry could be anyone.
- An outage skips the group. If the directory cannot be asked about a group, that group's reconcile is skipped entirely for the run rather than guessed at; the next run converges it.
- Deactivated users are invisible to sync in both directions: never removed from groups, never re-added.
The careful part
The deactivation sweep
Separately opted in, a sweep deactivates users who are no longer present in the directory, marking them with sync provenance. They are reactivated automatically when they reappear, but only if sync was what deactivated them: a manual activate or deactivate on the Users page always clears that provenance, so an admin's decision is never overridden by the directory.
Deactivation is a flag flip, never a delete: the user's reservations and audit history stay intact, and login is blocked until reactivation.
Reading the record
Run history
Each run lists its counts and, under Details, the per-item skips with reasons. Three things worth knowing when you read it:
- A run showing "running (stale)" has been running for over 30 minutes and likely belongs to a crashed process; a run orphaned by a crash is marked failed automatically.
- History is kept 90 days by default when the interval loop runs; pruning rides that loop.
- A sync-now-only deployment prunes nothing: rows accumulate until an admin clears them. That is deliberate, not a leak.