What is ldap2pg and what does it do?
masterldap2pg is a tool that automates the creation, update, and removal of PostgreSQL roles and users based on an enterprise directory (LDAP).
Key capabilities include:
- Role Lifecycle Management: Creates, alters, and drops PostgreSQL roles derived from LDAP searches.
- Static Role Creation: Creates roles defined directly in YAML to complement LDAP entries.
- Privilege Management: Grants or revokes privileges either statically via YAML or dynamically from LDAP entries.
- Group Management: Manages role parents (aliases for groups).
- Safety & Observability: Supports dry runs and check modes, logs LDAP searches as
ldapsearch(1)commands, and logs every SQL statement executed.
It is compatible with PostgreSQL versions 9.5 through 18 and works with directory services such as Samba DC, OpenLDAP, FreeIPA, Oracle Internet Directory, and Microsoft Active Directory.