Skip to main content

Synchronize PostgreSQL roles and ACLs from LDAP

Project description

ldap2pg: PostgreSQL role and ACL management

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 ACL statically or from LDAP entries.

  • Dry run.

  • Logs LDAP queries as ldapsearch commands.

  • Logs every SQL queries.

  • Reads settings from an expressive YAML config file.

Here is a sample configuration and execution:

$ cat docs/ldap2pg.minimal.yml
- role:
    name: ldap
    options: NOLOGIN
- ldap:
    base: ou=people,dc=ldap,dc=ldap2pg,dc=docker
    filter: "(objectClass=organizationalRole)"
    attribute: cn
  role:
    name_attribute: cn
    options: LOGIN
    parent: ldap
$ ldap2pg --color --config docs/ldap2pg.minimal.yml --real
Starting ldap2pg 3.4.
Using /.../src/dalibo/ldap2pg/docs/ldap2pg.minimal.yml.
Running in real mode.
Inspecting Postgres...
Querying LDAP ou=people,dc=ldap,dc=ldap2pg,dc=docker...
Create albert.
Create alter.
Create didier.
Create ldap.
Add ldap members.
Update options of alan.
Update options of alice.
Reassign oscar objects and purge ACL on template1.
Reassign oscar objects and purge ACL on appdb.
Reassign oscar objects and purge ACL on postgres.
Drop oscar.
Synchronization complete.
$

See versionned ldap2pg.yml and documentation for further options.

Installation

Install it from PyPI tarball:

pip install ldap2pg

More details can be found in documentation.

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-4.2.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

ldap2pg-4.2-py2.py3-none-any.whl (29.1 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