Manage PostgreSQL roles and privileges from YAML or LDAP
Project description
Swiss-army knife to synchronize Postgres roles and privileges from YAML or LDAP.
Features
Creates, alters and drops PostgreSQL roles from LDAP queries.
Creates static roles from YAML to complete LDAP entries.
Manages role members (alias groups).
Grants or revokes privileges statically or from LDAP entries.
Dry run.
Logs LDAP queries as ldapsearch commands.
Logs every SQL query.
Reads settings from an expressive YAML config file.
Here is a sample configuration and execution:
$ cat ldap2pg.yml - role: name: ldap_roles options: NOLOGIN - ldapsearch: base: ou=people,dc=ldap,dc=ldap2pg,dc=docker filter: "(objectClass=organizationalPerson)" role: name: '{cn}' options: LOGIN parent: ldap_roles $ ldap2pg --real Starting ldap2pg 5.7. Using .../ldap2pg.yml. Running in real mode. Inspecting roles in Postgres cluster... Querying LDAP ou=people,dc=ldap,dc=lda... (objectClass... Create domitille. Add missing ldap_roles members. Delete spurious ldap_roles members. Update options of albert. 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 psycopg2-binary
More details can be found in documentation.
ldap2pg is licensed under PostgreSQL license. ldap2pg is available with the help of wonderful people, jump to contributors list to see them.
ldap2pg is reported to work with OpenLDAP, FreeIPA, Oracle Internet Directory and Microsoft Active Directory.
Support
If you need support and you didn’t found it in documentation, just drop a question in a GitHub issue! French accepted. Don’t miss the cookbook. You’re welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ldap2pg-5.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcf8bbe8dd04f3a08ed7a97a6d0708853a088a94d8825ec2c218ae7650ce5347 |
|
MD5 | e862d9170815e0950017895513f87c16 |
|
BLAKE2b-256 | 8db4b5b031be483ea2d7b6fac37a7ee8a471371ef35436e85fd89cb674f8fa7c |