Skip to main content

LDAP

This reference document describes the configuration options for LDAP authentication in Infrahub.

Enterprise Edition

LDAP authentication is available exclusively in the Enterprise Edition. The Community Edition includes the configuration model but rejects LDAP sign-ins with an enterprise-required error. See Community vs enterprise for details.

All options live under the top-level ldap configuration group. Each maps to an environment variable prefixed with INFRAHUB_LDAP_ and to a key under the [ldap] table in infrahub.toml.

Connection​

ParameterEnvironment VariableTOML PathDescriptionDefault
EnabledINFRAHUB_LDAP_ENABLEDldap.enabledEnable LDAP sign-in on this deployment. When off, new LDAP sign-ins are refused; existing sessions are unaffected.false
ServersINFRAHUB_LDAP_SERVERSldap.serversLDAP server URIs, tried in declaration order. Must use the ldap or ldaps scheme. As an environment variable, comma-separated.none
Per-server timeoutINFRAHUB_LDAP_PER_SERVER_TIMEOUTldap.per_server_timeoutSeconds to wait for a server to respond before treating it as unreachable and trying the next.10.0

Service account and user lookup​

ParameterEnvironment VariableTOML PathDescriptionDefault
Service account DNINFRAHUB_LDAP_SERVICE_ACCOUNT_DNldap.service_account_dnDistinguished name of the directory account used to look up users before verifying their credentials.none
Service account passwordINFRAHUB_LDAP_SERVICE_ACCOUNT_PASSWORDldap.service_account_passwordPassword for the service account used during the user lookup.none
User search baseINFRAHUB_LDAP_USER_SEARCH_BASEldap.user_search_baseDistinguished name of the subtree where user entries are stored, e.g. OU=Users,DC=corp,DC=example,DC=com.none
User search filterINFRAHUB_LDAP_USER_SEARCH_FILTERldap.user_search_filterFilter used to locate a user by sign-in name. The {username} placeholder is substituted at sign-in time and escaped. If empty, a default is generated from attribute_username.generated

User attribute mapping​

ParameterEnvironment VariableTOML PathDescriptionDefault
Username attributeINFRAHUB_LDAP_ATTRIBUTE_USERNAMEldap.attribute_usernameAttribute that holds a user's sign-in name. sAMAccountName is typical on Active Directory; uid is typical on OpenLDAP.sAMAccountName
Display name attributeINFRAHUB_LDAP_ATTRIBUTE_DISPLAY_NAMEldap.attribute_display_nameAttribute that holds a user's human-readable display name.displayName
Disabled attributeINFRAHUB_LDAP_ATTRIBUTE_DISABLEDldap.attribute_disabledAttribute signaling whether an account is disabled. Leave empty to skip the disabled-account check.userAccountControl
Disabled bitmaskINFRAHUB_LDAP_ATTRIBUTE_DISABLED_BITMASKldap.attribute_disabled_bitmaskWhen attribute_disabled is set, its integer value is treated as a bitmask; the account is disabled if any of these bits are set. 0x2 matches Active Directory's standard disabled flag.2

Group resolution​

ParameterEnvironment VariableTOML PathDescriptionDefault
Group resolution enabledINFRAHUB_LDAP_GROUP_ENABLEDldap.group_enabledResolve directory group memberships and map them to local groups. Requires group_base_dn.false
Group base DNINFRAHUB_LDAP_GROUP_BASE_DNldap.group_base_dnDistinguished name of the subtree where group entries are stored. Required when group_enabled is true.none
Group filterINFRAHUB_LDAP_GROUP_FILTERldap.group_filterFilter used to look up a user's groups. The {user_dn} placeholder is substituted with the user's distinguished name at sign-in time and escaped.(member={user_dn})
Group name attributeINFRAHUB_LDAP_GROUP_NAME_ATTRIBUTEldap.group_name_attributeAttribute read as the group's name and matched against local group names to grant permissions.cn
Group strategyINFRAHUB_LDAP_GROUP_STRATEGYldap.group_strategyHow nested-group memberships are resolved: bfs (any directory) or ad_in_chain (Active Directory transitive-membership search).bfs
Group BFS max depthINFRAHUB_LDAP_GROUP_BFS_MAX_DEPTHldap.group_bfs_max_depthMaximum nesting levels traversed when group_strategy is bfs. Cycles are detected automatically. Minimum 10.16

TLS​

ParameterEnvironment VariableTOML PathDescriptionDefault
TLS enabledINFRAHUB_LDAP_TLS_ENABLEDldap.tls_enabledEncrypt the connection. Pair with ldaps:// URIs, or set tls_starttls.false
STARTTLSINFRAHUB_LDAP_TLS_STARTTLSldap.tls_starttlsUpgrade a plain ldap:// connection to TLS using STARTTLS instead of connecting via ldaps://.false
CA bundleINFRAHUB_LDAP_TLS_CA_BUNDLEldap.tls_ca_bundlePEM-encoded CA bundle used to verify the server's certificate. A file path or the PEM contents directly. Checked at startup.none
InsecureINFRAHUB_LDAP_TLS_INSECUREldap.tls_insecureSkip TLS certificate validation. Test and development only; never enable in production.false
Minimum TLS versionINFRAHUB_LDAP_TLS_MINIMUM_VERSIONldap.tls_minimum_versionMinimum TLS protocol version accepted: TLSv1.2 or TLSv1.3.TLSv1.2
note

tls_starttls and an ldaps:// server URI are mutually exclusive, as are tls_insecure and tls_ca_bundle. Either combination is rejected when the server starts.

Login button​

ParameterEnvironment VariableTOML PathDescriptionDefault
Display labelINFRAHUB_LDAP_DISPLAY_LABELldap.display_labelText shown on the LDAP sign-in button on the login page.Sign in with LDAP
IconINFRAHUB_LDAP_ICONldap.iconMaterial Design icon name shown on the LDAP sign-in button.mdi:account-key-outline

Examples​

Active Directory​

[ldap]
enabled = true
servers = ["ldaps://dc1.corp.example.com:636", "ldaps://dc2.corp.example.com:636"]
tls_enabled = true

service_account_dn = "CN=infrahub-svc,OU=Service,DC=corp,DC=example,DC=com"
service_account_password = "service-account-password"
user_search_base = "OU=Users,DC=corp,DC=example,DC=com"

group_enabled = true
group_base_dn = "OU=Groups,DC=corp,DC=example,DC=com"
group_strategy = "ad_in_chain"

OpenLDAP​

[ldap]
enabled = true
servers = ["ldaps://ldap.example.com:636"]
tls_enabled = true

service_account_dn = "cn=infrahub,ou=services,dc=example,dc=com"
service_account_password = "service-account-password"
user_search_base = "ou=people,dc=example,dc=com"
attribute_username = "uid"
attribute_disabled = ""

group_enabled = true
group_base_dn = "ou=groups,dc=example,dc=com"
group_strategy = "bfs"