Skip to main content

Synchronize PostgreSQL roles from LDAP

Project description

ldap2pg logo

Continuous Integration report Code coverage report Documentation Version on PyPI

Swiss-army knife to synchronize Postgres roles and ACLs from any LDAP directory.

Features

  • Creates, alter and drops PostgreSQL roles from LDAP queries.

  • Creates static roles from YAML to complete LDAP entries.

  • Manage role members (alias groups).

  • Grant or revoke custom ACL statically or from LDAP entries.

  • Dry run.

  • Logs LDAP queries as ldapsearch commands.

  • Logs every SQL queries.

  • Reads settings from YAML config file.

$ cat ldap2pg.yml
sync_map:
  ldap:
    base: ou=people,dc=ldap2pg,dc=local
    filter: "(objectClass=organizationalRole)"
    attribute: cn
  role:
    name_attribute: cn
    options: LOGIN
$ ldap2pg --real
Using ./ldap2pg.yml.
Using /home/.../src/dalibo/ldap2pg/ldap2pg.yml.
Starting ldap2pg 1.0.
Running in real mode.
Inspecting Postgres...
Querying LDAP cn=dba,ou=groups,dc=ldap2pg,dc=local...
Querying LDAP ou=groups,dc=ldap2pg,dc=local...
Create alan.
Create dave.
Create david.
Create ldap_users.
Add ldap_users members.
Add missing backend members.
Delete spurious backend members.
Update options of alice.
Would reassign oscar objects and purge ACL on backend.
Would reassign oscar objects and purge ACL on frontend.
Would reassign oscar objects and purge ACL on legacy.
Would reassign oscar objects and purge ACL on postgres.
Would reassign oscar objects and purge ACL on template1.
Drop oscar.
Synchronization complete.
$

See versionned ldap2pg.yml for further options.

Installation

Install it from PyPI tarball:

pip install ldap2pg

ldap2pg is licensed under PostgreSQL license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ldap2pg-2.0.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

ldap2pg-2.0-py2.py3-none-any.whl (20.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page