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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

Details for the file ldap2pg-2.0.tar.gz.

File metadata

  • Download URL: ldap2pg-2.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ldap2pg-2.0.tar.gz
Algorithm Hash digest
SHA256 56ae8e7740c035845dcf0ea26e04b67f0615ee91b37668c12203781ab2645379
MD5 af2067ada52deab259633fa6635b22f4
BLAKE2b-256 cb00a7d5a6f0ff3805a430444898e0982dbb06fc8642241acab04f60e9c150e3

See more details on using hashes here.

File details

Details for the file ldap2pg-2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ldap2pg-2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0d435650ddb214e49d8b0e78e7753b596e5e7a85e6f9ff833c0602e75ccf296e
MD5 21b445a317b2440cb37134d093cd325e
BLAKE2b-256 4564482332b54415c294a13aa17be854b7283a7db9f265af21cdbb0bc2bca6d2

See more details on using hashes here.

Supported by

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