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 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 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.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

ldap2pg-4.0-py2.py3-none-any.whl (28.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for ldap2pg-4.0.tar.gz
Algorithm Hash digest
SHA256 7f307ed5c77fb6cb3a94525f3a500c1a0e2807a2403a7b6a54ee427bdea060e3
MD5 f580dc1fca5f7bad09bbfc1c5a11d8c1
BLAKE2b-256 48e95d834c8c368cf6dad421acac14bc920ec9b05fb77d9e10a9f120284f460b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ldap2pg-4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bbcd112ef314de16fa79322faab88aa0e0e09f7249039d79c329a8b3793f8f8d
MD5 50ff0c7159bcd880b4bf89db68829f87
BLAKE2b-256 6a3944b4311476183af946f3a677d706119947ee78d70b6cc3c2928d1aad7c29

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