Skip to main content

Synchronize PostgreSQL roles from LDAP

Project description

ldap2pg: PostgreSQL role and ACL management

Continuous Integration report Code coverage report Code Health 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.

Here is a sample configuration and execution:

$ cat ldap2pg.minimal.yml
sync_map:
- 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 ldap2pg.minimal.yml --real 2>&1 | sed s,bersace,...,g
Starting ldap2pg 2.0a3.
Using /home/.../src/dalibo/ldap2pg/ldap2pg.minimal.yml.
Running in real mode.
Inspecting Postgres...
Querying LDAP ou=people,dc=ldap,dc=ldap2pg,dc=docker...
Create alan.
Create albert.
Create dave.
Create donald.
Create ldap.
Add ldap members.
Update options of alice.
Reassign oscar objects and purge ACL on frontend.
Reassign oscar objects and purge ACL on postgres.
Reassign oscar objects and purge ACL on template1.
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-3.0a2.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

ldap2pg-3.0a2-py2.py3-none-any.whl (22.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ldap2pg-3.0a2.tar.gz.

File metadata

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

File hashes

Hashes for ldap2pg-3.0a2.tar.gz
Algorithm Hash digest
SHA256 62396fea2797243036e45a5f625359e84cf68a096d35b418563a2fbde036ad30
MD5 393ace4e7c672f9b25436e71b98b02a3
BLAKE2b-256 eeda855ba253b077d9cc4bf50ebb917329f39420b233b9342cf05c4d7a5c90ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ldap2pg-3.0a2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1f0d8a1012fed614fa451e88914094c28a1024a8def5188220392153948298f1
MD5 1ab219f2578b5349f9cddcf20883c5a1
BLAKE2b-256 b14de41d981c7bbc3805a770332b51dc903dd97933d9cfa0965000b868554592

See more details on using hashes here.

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