Skip to content
atlas-biPublic

Repository files navigation

LDAP ETL

Atlas BI Library ETL | LDAP Supplementary ETL

Website • Demo • Documentation • Chat

Loads data from an LDAP server into a database accessible by the primary Atlas metadata ETL.

Getting started

Create database

Use LDAPDatabaseCreationScript.sql to create the required tables.

System dependencies

Install packages

uv sync

Create .env file

Create a .env file (or pass the same values as environment variables):

LDAP_HOST=localhost
LDAP_USERNAME=cn=admin,dc=example,dc=org
LDAP_PASSWORD=adminpassword
LDAP_BASE=dc=example,dc=org
LDAP_USE_SSL=False
LDAP_USE_TLS=False

AD_DOMAIN=EXAMPLEHEALTH

LDAP_GROUP_SEARCH=(objectClass=group)

# Optionally limit results to DNs that contain an OU (comma-separated).
LDAP_GROUP_OU=Email Distribution Groups,Room & Shared Mailboxes,Access & Permissions

LDAP_GROUP_USERNAME=sAMAccountName
LDAP_GROUP_DISPLAYNAME=displayName
LDAP_GROUP_EMAIL=mail,email

LDAP_USER_SEARCH=(&(objectClass=person)(sAMAccountName=*))
LDAP_USER_EMPLOYEEID=employeeID
LDAP_USER_ACCOUNTNAME=sAMAccountName
LDAP_USER_DISPLAYNAME=displayName
LDAP_USER_FULLNAME=cn,name
LDAP_USER_FIRSTNAME=givenName
LDAP_USER_LASTNAME=sn
LDAP_USER_DEPARTMENT=department
LDAP_USER_TITLE=title,description
LDAP_USER_PHONE=ipPhone,telephoneNumber
LDAP_USER_EMAIL=mail,proxyAddresses,userPrincipalName
LDAP_USER_PHOTO=thumbnailPhoto,profilePhoto

DATABASE=DRIVER={ODBC Driver 17 for SQL Server};SERVER=atlas;DATABASE=LDAP;UID=datagov;PWD=123

Running

uv run python ldap.py

Other tools

Active Directory Explorer is useful for browsing LDAP to find bases and DCs.

Testing

  1. Start an LDAP server:
docker run -p 389:1389 bitnami/openldap:latest
  1. Set test env vars:
LDAP_HOST=ldap://localhost:389
LDAP_USERNAME=cn=admin,dc=example,dc=org
LDAP_PASSWORD=adminpassword
DATABASE=>> your test db connection
AD_DOMAIN=
LDAP_BASE=dc=example,dc=org
LDAP_USER_SEARCH=(objectClass=inetOrgPerson)
LDAP_GROUP_SEARCH=(objectClass=groupOfNames)
LDAP_USE_SSL=false
LDAP_USE_TLS=false
  1. Run tests:
uv sync --group dev
uv run pytest tests.py

Releases

Used by

Contributors

Languages