Almost every organisation with a directory has dozens of LDAP bind accounts that nobody owns, that can read far more of the directory than their application needs, and whose passwords sit in configuration files that have not changed in years. A bind account is the identity an application, appliance or script uses to connect to Active Directory, OpenLDAP or another LDAP directory to look up users, check group membership or validate passwords. This guide covers the three jobs that turn that sprawl into something you control: finding every bind account and what uses it, cutting its read rights down to what the application needs, and replacing it with a better pattern where one exists. It is written for identity, directory and NHI programme teams. Bind methods, LDAP signing and channel binding are covered in the LDAP Security Deep Dive Guide, and appliance-held credentials in the Edge Appliances as Credential Harvesters; this page does not repeat them.
Key takeaways
- Bind accounts are non-human identities with directory-wide reach. In a default Active Directory forest, an authenticated account can read most user, group and computer attributes, so a stolen bind credential is a reconnaissance licence.
- No single log finds them all. Event 2889 catches unsigned and clear-text binds only; binds over LDAPS need configuration review, logon telemetry and network flows to find.
- Scope by search base and by attribute, not just by group. Keeping a bind account out of privileged groups is necessary but does nothing about what it can read through default permissions.
- The best bind account is the one you remove. Federation (SAML or OIDC) or provisioning (SCIM) removes the application's need to query the directory at all; managed accounts and certificates remove the static password.
- Every remaining bind account needs an owner, a record and a rotation date. Treat it through the same lifecycle as any other service account.
Why bind accounts deserve their own programme
Bind accounts are a sub-population of service accounts with three properties that make them riskier than average:
- Read reach: their job is to search the directory, so they are granted, or simply inherit, broad read access. ATT&CK lists directory enumeration as T1087.002 Domain Account and T1069.002 Domain Groups discovery; a bind account is a ready-made identity for both.
- Stored passwords: most applications and appliances store the bind password in a configuration file, database or appliance config, which ATT&CK covers as T1552.001 Credentials In Files. Once recovered, the account is a valid domain account (T1078.002).
- Invisible ownership: they are created during an application install by whoever had admin rights that day, named after the product, and set never to expire so the integration does not break.
After the 2024 Ivanti Connect Secure exploitation, CISA directed agencies to reset passwords for service accounts used for the gateways' authentication server configuration, alongside other credentials on the appliance. See Ivanti Connect Secure Exploitation 2024: How Two VPN Zero-Days Exposed Credentials, Service Accounts and Sessions for that incident; the general lesson is that every directory credential stored on an exposed system has to be assumed recoverable.
Finding bind accounts
Use several sources and reconcile them. Each one sees a different slice.
| Source | What it finds | Blind spots |
|---|---|---|
| Directory Service event 2889 on domain controllers | Client IP and the identity used for unsigned SASL binds and simple binds over clear-text LDAP | Not logged by default (needs LDAP Interface Events diagnostic logging); does not record binds over LDAPS or StartTLS; diagnostic logging costs DC performance |
| Events 2887 and 2888 | Daily counts of unsigned or clear-text binds allowed or rejected | Counts only, no identities |
| Domain controller security logs | Successful logons for each candidate account and the source address | Needs the candidate list first; volume is high |
| Network flow data | Hosts talking to DCs or directory servers on 389, 636, 3268 and 3269 | Shows hosts, not accounts; must be joined to configuration |
| Account attribute heuristics | Accounts with servicePrincipalName set, PasswordNeverExpires, delegation flags, "svc" naming or service descriptions | Microsoft notes there is no attribute that marks a user as a service account, so heuristics miss some |
| Application and appliance configuration | The bind DN, server, port and whether certificates are validated | Only as complete as your application inventory |
| Secrets scanning of repositories and config stores | Bind DNs and passwords in code, scripts, Helm values and infrastructure templates | Finds stored secrets, not live usage |
| OpenLDAP access logging (stats level) | BIND operations with the DN and connection source | Log volume; must be enabled and retained |
Microsoft's guidance on user accounts used as services suggests searching for accounts trusted for delegation, accounts with service principal names and accounts whose passwords never expire, and warns that these criteria may not find every account. Collect over a full business cycle so month-end and quarter-end jobs appear.
The inventory record
For each bind account, record:
- Account and directory: sAMAccountName or DN, directory, OU.
- Consumers: every application, appliance and host that uses it, with source IPs.
- Owner: a named person or team accountable for it, and the business service it supports.
- Purpose: user lookup, group lookup, password validation (bind-as-user after search), or write-back.
- Bind method: simple bind over LDAPS, StartTLS, SASL Kerberos, certificate, or clear text (to be fixed).
- Read scope: search base, attributes needed, and the effective permissions found.
- Credential: where the password is stored, last change date, rotation owner.
- Disposition: keep and scope, replace (with target pattern), or retire.
Microsoft's on-premises service account guidance asks for the same core fields: owner, purpose, permission scopes, risk profile, anticipated lifetime with periodic attestation, and where the password is stored. Feed the record into the NHI Inventory Reconciliation process.
Understanding what a bind account can read
Most teams check group membership and stop. The real question is effective read access.
- Default read in Active Directory: authenticated principals can read a large share of the directory by default. A bind account that is "just a domain user" can usually enumerate every user, group, group membership and computer.
- Confidential attributes: Active Directory supports marking an attribute confidential through bit 128 (0x80) of the attribute's searchFlags in the schema, which removes it from ordinary read access. Base schema attributes ignore the flag. Check which sensitive custom attributes in your schema carry it.
- Delegated and inherited ACLs: helpdesk and provisioning delegations applied to OUs often grant broader rights than intended, and bind accounts placed in those OUs or groups inherit them. See the Active Directory ACL and Delegation Hygiene Guide.
- Sensitive data on objects: local administrator password attributes, BitLocker recovery information and similar data must never be readable by a bind account. Verify with an effective permissions check against real objects, not by reading the group list.
- Write rights: password reset or attribute write-back integrations need write permissions. Keep those on a separate account from read-only lookups, scoped to the exact OUs and attributes.
In OpenLDAP, access is governed by olcAccess rules: the first matching rule and the first matching requester decide, each rule ends with an implicit deny for anyone not listed, and the access levels are cumulative (auth, then search, then read). A bind DN can be limited to read specific attributes under one subtree, for example:
1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.
olcAccess: to dn.subtree="ou=people,dc=example,dc=com" attrs=entry,uid,cn,mail,memberOf
by dn.exact="cn=app-portal-bind,ou=services,dc=example,dc=com" read
by * breakThe OpenLDAP Administrator's Guide notes that if no access directives apply, the default policy allows read by all clients, so a directory without explicit rules gives every bind account full read. See OpenLDAP Security.
Scoping bind accounts down
| Technique | What it limits | Effort and trade-offs |
|---|---|---|
| Restrict the application's search base | Which part of the tree the application queries | Low effort; a client setting only, so a stolen credential can still read everything the ACLs allow |
| Server-side ACLs on OUs and attributes | What the account can actually read | Moderate effort in AD (deny or explicit-grant designs need testing); straightforward in OpenLDAP with olcAccess |
| Confidential attributes for sensitive custom data | Read of specific attributes by ordinary principals | Schema change; affects every reader, not only bind accounts |
| Dedicated read replica or directory proxy exposing a subset | The whole data set an application can see | Higher cost; strong isolation for internet-facing applications and appliances |
| Logon restrictions on the account | Where the account can be used | Deny interactive and Remote Desktop logon, restrict source hosts where the directory supports it; does not limit LDAP read from permitted hosts |
| One account per application | Blast radius and attribution | More accounts to manage, but each can be scoped, rotated and retired independently |
Scoping procedure
- Document what the application needs: which OUs hold its users, which attributes it reads (often uid or sAMAccountName, mail, displayName, memberOf), and whether it needs group lookups.
- Create a new, dedicated account rather than editing a shared one, named to show the application and owner.
- Grant the minimum through server-side ACLs or a scoped proxy; set the application's search base to match.
- Check effective permissions against a sample of sensitive objects and attributes and record the result.
- Test in a non-production instance of the application: log in as users in and out of scope, test group-based authorisation, test password change flows.
- Cut over during a change window, keep the old account enabled but unused for a short rollback period, then disable it.
- Delete the old account after a further observation period with no logon activity, and update the inventory.
Rollback is simple when you work this way: switch the application back to the old account, which you only disabled. Never reuse an old account by changing its password and permissions in place; it keeps its history, its inherited rights and every copy of its name in old configurations.
Replacing bind accounts
For each bind account, ask whether the application needs to query the directory at all.
| Pattern | Removes | Fits | Considerations |
|---|---|---|---|
| Federated sign-in (SAML or OIDC) through an identity provider | The bind account and the application's direct password handling | Web applications and SaaS that only need to authenticate users and receive group claims | Group claims must carry what authorisation needs. See the LDAP vs SAML vs OIDC guide. |
| SCIM provisioning | Live directory lookups for user and group data | Applications that keep their own user store and support SCIM | Push model with its own token to protect. See LDAP vs SCIM. |
| Group managed service account (gMSA) | The static, human-managed password | Windows services, IIS application pools and scheduled tasks on supported Windows Server versions | Windows manages the password and authorised hosts retrieve it from domain controllers; not an option for most appliances. See the Group Managed Service Accounts (gMSA) Guide. |
| Kerberos with a keytab (SASL GSSAPI) | Passwords on the wire | Linux and Unix services joined to the realm | The keytab is a credential; protect and rotate it like a password |
| Certificate-based bind (SASL EXTERNAL over TLS) | The shared password | Applications and directories that support client certificates | Depends on certificate issuance, renewal and revocation working |
| Scoped bind account with vaulted, rotated password | Standing exposure, not the account | Appliances and legacy applications with no better option | Interim state for most estates; rotation must be coordinated with every consumer |
Small organisations should start with the scoped-account pattern for everything and move the two or three most exposed systems (VPN, internet-facing portals) to federation first. Large estates benefit from setting a rule that no new application may use a bind account where it supports SAML, OIDC or SCIM, and from tracking legacy bind accounts as technical debt with owners and dates.
Credential handling for the accounts that remain
- Store: in a secrets manager or the application's encrypted credential store, never in plain configuration files or scripts. See the Service Account Security Guide.
- Rotate: on a schedule, when an administrator with access leaves, and after any suspected compromise of a consuming system. Coordinate with every consumer recorded in the inventory.
- Restrict: deny interactive and Remote Desktop logon; keep out of privileged groups; Microsoft's guidance is to remove service accounts from privileged groups and grant only the rights the service needs.
- Encrypt the channel: LDAPS or StartTLS with certificate and hostname validation, or signed SASL binds, as set out in the LDAP Security Deep Dive Guide.
Detection and measurement
- Bind from a new source: alert when a bind account authenticates from a host not in its inventory record.
- Bulk enumeration: unusually large or broad searches by a bind account, such as every user with all attributes, or queries for privileged groups it has no reason to read.
- Interactive or remote logon: any interactive use of a bind account is suspicious.
- Clear-text binds: event 2889 entries naming a bind account show a channel to fix.
- Use after retirement: logon attempts against disabled bind accounts reveal forgotten consumers or misuse.
Metrics:
- Percentage of bind accounts with a named owner and inventory record.
- Percentage with an effective-permissions check in the last 12 months.
- Percentage of bind accounts with credentials rotated within policy.
- Number of applications moved from bind accounts to federation or provisioning this quarter.
- Number of clear-text or unsigned binds per day (trend to zero).
- Shared bind accounts (used by more than one application) remaining.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-2, CM-8 | Account management and inventory of bind accounts and their consumers |
| NIST SP 800-53 Rev 5 | AC-6 | Least privilege read scope |
| NIST SP 800-53 Rev 5 | IA-5, IA-9 | Authenticator management and service authentication |
| NIST SP 800-53 Rev 5 | AU-6 | Review of bind account activity |
| NIST CSF 2.0 | PR.AA-01, PR.AA-05 | Identities and credentials for services managed; permissions least privilege and reviewed |
| CIS Controls v8.1 | 5.5 | Inventory of service accounts |
| MITRE ATT&CK | T1552.001, T1078.002, T1087.002, T1069.002 | Stored credential theft, domain account abuse and directory discovery |
Common failure patterns
- One bind account for everything: a single "ldapbind" account used by the VPN, wiki, ticketing system and printers, so rotation breaks everything and nobody rotates it.
- Privileged bind account: placed in Domain Admins or Account Operators during an install to make an integration work and never removed.
- Scoped in the client only: the application's search base is narrow, but the account can still read the whole directory with any other tool.
- Password in a repository: the bind DN and password committed to a script or deployment template and copied into every environment.
- Edited in place instead of replaced: an old account gets a new password and trimmed groups but keeps inherited delegations and its exposure history.
- Left in place after federation: the application moved to SAML or OIDC, but the bind account stayed enabled "in case".
Practitioner checklist
- Build the bind account list from configuration, event 2889, DC logons, network flows, attribute heuristics and secrets scanning.
- Record owner, consumers, purpose, bind method, read scope and credential location for each account.
- Run an effective permissions check against sensitive objects and attributes for every account.
- Split shared accounts so each application has its own.
- Enforce read scope server-side with ACLs, olcAccess rules or a scoped proxy, not only by search base.
- Separate write-back accounts from read-only lookup accounts.
- Move applications that support SAML, OIDC or SCIM off bind accounts, starting with internet-facing systems.
- Vault and rotate remaining bind credentials, and deny interactive logon.
- Alert on binds from unrecorded hosts, bulk enumeration and use of retired accounts.
- Re-attest every bind account with its owner at least annually.
Standards and references
- Microsoft Learn: Securing on-premises service accounts
- Microsoft Learn: Secure user-based service accounts in Active Directory
- Microsoft Learn: Group Managed Service Accounts overview
- Microsoft Learn: Event ID 2889, LDAP signing
- Microsoft Learn: Search-Flags attribute
- OpenLDAP: Administrator's Guide, Access Control
- MITRE ATT&CK: Credentials In Files
- NIST: SP 800-53 Rev. 5, Security and Privacy Controls
Related NHI Mgmt Group resources: Service Account Security Guide · LDAP Security Deep Dive Guide · Edge Appliances as Credential Harvesters · NHI Ownership Guide