Skip to main content

ad2openldap - IDMAP for Linux replicated from AD

Why ad2openldap ?

ad2openldap is a lightweight replicator for user, group and netgroup information from Microsoft Active Directory into an OpenLDAP server to serve as Unix IDMAP solution. The original version was developed at Fred Hutch in 2010 to overcome frustrations with slow and unreliable Linux LDAP connectivity to Active Directory and to isolate badly behaving HPC scripts (“fork bombs”) from critical AD infrastructure.

ad2openldap in 2018 and beyond

In 2017 we observed that newer solutions have grown in complexity (SSSD, Centrify) but have not been able to match ad2openldap in performance and reliability (SSSD). As we are migrating more services to cloud we continue to benefit from LDAP caches/replicas that provide low latency ldap services and ad2openldap continues to be a critical piece of infrastructure on more than 2000 servers/compute nodes on premise and in AWS and Google cloud. We decided to port the tool to Python3, add an easy installer via pip3 and test it on newer OS. We hope it will be as useful to others as it is to us.

Installation

Ubuntu

On Ubuntu you will be prompted for an new LDAP Administrator password. please remember this password.

sudo apt install -y python3-pip slapd
sudo pip3 install ad2openldap

RHEL/CentOS 6 (untested in 2018)

sudo yum -y install epel-release
sudo yum -y install python34 python34-setuptools python34-devel gcc slapd
sudo easy_install-3.4 pip
sudo pip3 install ad2openldap

RHEL/CentOS 7 (untested in 2018)

sudo yum -y install python??
sudo pip3 install ad2openldap

Configuration

/etc/ad2openldap/ad2openldap.conf requires these minimum settings:

# openldap adimistrator password (you set this during installation)
bind_dn_password: ChangeThisLocalAdminPassword12345
# AD service account (userPrincipalName aka UPN)
ad_account: ldap@example.com
# password for AD service account
ad_account_password: ChangeThisPassword
# AD LDAP URL of one of your domain controllers
ad_url: ldap://dc.example.com
# The base DN to use from Active Directory, under which objects are  retrieved.
ad_base_dn: dc=example,dc=com

execute the setup script and enter items when prompted

ad2openlap3 setup

then create a cronjob in file /etc/cron.d/ad2openldap that runs ca. every 15 min

SHELL=/bin/bash
MAILTO=alertemail@institute.org
*/15 * * * *   root /usr/local/bin/ad2openldap3 deltasync
   --dont-blame-ad2openldap -v >>/var/log/ad2openldap/ad2openldap.log 2>&1 ;
   /usr/local/bin/ad2openldap3 healthcheck -N username

It is strongly recommended to up the default open files limit for slapd to at least 8192

echo “ulimit -n 8192” >> /etc/default/slapd (or /etc/defaults/slapd depending on distribution)

Troubleshooting

Use the –verbose flag to log to STDOUT/STDERR.

The AD dumps and diffs are in /tmp by default:

ad_export.ldif - current dump
ad_export.ldif.0 - last dump
ad_export_delta.diff - computed differences between these files

Possible failure modes are:

LDAP server failure - needs restart, possibly followed by forced full update if corrupt or incomplete

Firewall block still improperly active - look at update script for removal syntax (this failure is very unlikely given the current process)

Bad or conflicting AD entities - a forced full update should remedy this

In the event that an incremental update is not possible or bypassed using the command line parameter ‘–fullsync’, a full update will instead occur.

A full update:

  • Dumps groups, users and NIS group entities from AD

  • Locks out remote access to the LDAP server via the firewall

  • Shuts down the LDAP server

  • Writes a new blank database using the LDIF template

  • Directly imports AD dump into database

  • Restarts LDAP server

  • Removes firewall block on LDAP server

Release files for ad2openldap 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ad2openldap 1.0.2
File Size Uploaded
ad2openldap-1.0.2.tar.gz 34.0 kB Details

Release files / ad2openldap-1.0.2.tar.gz

Download URL ad2openldap-1.0.2.tar.gz
Size 34.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a202e236d1504649f3017f5d9a3adb68e509a79c733fba12080e0b1ea1dab3db
BLAKE2b-256 checksum
How to use checksums
325c5a095d11c401d86b8a0b2f6caae60c125cd97d4c3c6c6b6d94f64356deb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

1.0.1.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page