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
- ldap:
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.0.
Using .../ldap2pg.yml.
Running in real mode.
Inspecting roles in Postgres cluster...
Querying LDAP ou=people,dc=ldap,dc=lda... (objectClass...
Create domitille.
Update options of albert.
Add missing ldap_roles members.
Delete spurious ldap_roles members.
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.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ldap2pg-5.2.tar.gz.
File metadata
- Download URL: ldap2pg-5.2.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fd76c8d43d67d0456127454ba44174210a2e58d6117211a67bae898c12871ce
|
|
| MD5 |
f2885d485add69bcee4c14180fd91989
|
|
| BLAKE2b-256 |
d28da037a3ae513ba1edd4c14e32a9ef07797b636e2c9e35112e7cc6f585975e
|
File details
Details for the file ldap2pg-5.2-py2.py3-none-any.whl.
File metadata
- Download URL: ldap2pg-5.2-py2.py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80fd9895e61677f1f3d3481e7e97828fc490211213dc18146950bcd4e5b6fdc6
|
|
| MD5 |
81c7a8fafe4dda5e95ac16df5ffdaac8
|
|
| BLAKE2b-256 |
eec100661bce9723a0779a3936a9f16ba543d5601d2864e603142425af52e162
|