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.4.tar.gz (21.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-3.4-py2.py3-none-any.whl (27.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for ldap2pg-3.4.tar.gz
Algorithm Hash digest
SHA256 d97cc953a2ecdc6c243418a462fd6996c852acad3cae78d34c28973e0c5ef6ab
MD5 0ca5f5c0c175480564b1cd3778db2239
BLAKE2b-256 69f4ea30d2505f9ba6e8adaf582666246818390dce23d49e58007de4315f7e48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ldap2pg-3.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 162bdf8c01fa66704cc7dce4bd628c4e2dfb71a5748e2f14210c9c8195f96e9f
MD5 b43d8b0e10bc6f1280cab391a28bd8db
BLAKE2b-256 c1447a2ae467cc5a525794f386a111557dc84d5227a3bf884213bc12f292911d

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