This python script creates and deletes postgres user accounts by comparing members of an LDAP group. LDAP group members will have accounts created. Postgres users not in the LDAP group, who are not SuperUsers, will be deleted.
This is currently written to support ActiveDirectory nested groups. This uses Microsoft's matching rule OIDs in the LDAP search filter.
- Python >= 3.6
Python libraries
- configparser
- ldap
- psycopg2