Enterprise
LDAP Configuration for NetBox Enterprise
In the Admin Console for NetBox Enterprise, navigate to the Config tab and scroll to the bottom to check Show Advanced Settings.
Python Configuration
First, apply the following into NetBox Python Configuration Overrides:
REMOTE_AUTH_ENABLED = True
REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend'
REMOTE_AUTH_CREATE_USER = True
Environment Configuration
Your LDAP environments might differ, so check each setting and make sure your group, search, and other attributes match your schema.
Quoting Values
Environment variables are always turned into text when passed into the containers. Ensure all boolean and numeric values are quoted in addition to strings to avoid formatting errors.
Active Directory LDAP
AUTH_LDAP_SERVER_URI: "ldaps://xxxxxxx:636"
AUTH_LDAP_BIND_DN: "cn=administrator,cn=users,dc=your,dc=org,dc=domain"
AUTH_LDAP_BIND_PASSWORD: "xxxxxx"
LDAP_IGNORE_CERT_ERRORS: "true"
AUTH_LDAP_CONNECTION_OPTIONS: "{ ldap.OPT_REFERRALS: 0 }"
AUTH_LDAP_CACHE_TIMEOUT: "0"
AUTH_LDAP_GROUP_TYPE: "NestedGroupOfNamesType"
AUTH_LDAP_GROUP_SEARCH_BASEDN: "cn=users,dc=your,dc=org,dc=domain"
AUTH_LDAP_FIND_GROUP_PERMS: "true"
AUTH_LDAP_REQUIRE_GROUP_DN: "cn=Netbox Users,cn=Users,dc=your,dc=org,dc=domain"
AUTH_LDAP_IS_ADMIN_DN: "cn=Netbox Admins,cn=Users,dc=your,dc=org,dc=domain"
AUTH_LDAP_IS_SUPERUSER_DN: "cn=Netbox Superusers,cn=Users,dc=your,dc=org,dc=domain"
AUTH_LDAP_MIRROR_GROUPS: "true"
AUTH_LDAP_USER_SEARCH_ATTR: "sAMAccountName"
AUTH_LDAP_USER_SEARCH_BASEDN: "cn=users,dc=your,dc=org,dc=domain"
AUTH_LDAP_USER_SEARCH: 'LDAPSearch("cn=users,dc=your,dc=org,dc=domain", ldap.SCOPE_SUBTREE, "sAMAccountName=%(user)s")'
OpenLDAP
AUTH_LDAP_SERVER_URI: "ldaps://xxxxxxx:636"
AUTH_LDAP_BIND_DN: "cn=admin,dc=your,dc=org,dc=domain"
AUTH_LDAP_BIND_PASSWORD: "xxxxxx"
LDAP_IGNORE_CERT_ERRORS: "true"
AUTH_LDAP_CONNECTION_OPTIONS: "{ ldap.OPT_REFERRALS: 0 }"
AUTH_LDAP_CACHE_TIMEOUT: "0"
AUTH_LDAP_GROUP_TYPE: "PosixGroupType"
AUTH_LDAP_GROUP_SEARCH_BASEDN: "ou=Groups,dc=your,dc=org,dc=domain"
AUTH_LDAP_FIND_GROUP_PERMS: "true"
AUTH_LDAP_REQUIRE_GROUP_DN: "cn=netbox-users,ou=Groups,dc=your,dc=org,dc=domain"
AUTH_LDAP_IS_ADMIN_DN: "cn=netbox-admins,ou=Groups,dc=your,dc=org,dc=domain"
AUTH_LDAP_IS_SUPERUSER_DN: "cn=netbox-superusers,ou=Groups,dc=your,dc=org,dc=domain"
AUTH_LDAP_MIRROR_GROUPS: "true"
AUTH_LDAP_USER_SEARCH_ATTR: "uid"
AUTH_LDAP_USER_SEARCH_BASEDN: "ou=People,dc=your,dc=org,dc=domain"
AUTH_LDAP_USER_SEARCH: 'LDAPSearch("ou=People,dc=your,dc=org,dc=domain", ldap.SCOPE_SUBTREE, "uid=%(user)s")'