Skip to main content

A client library to generate ipset and iptables rules from LDAP records.

Project description

A Python module to generate IPTables and IPSet rules from LDAP records. See example.py for a demo.

Installation

Use PyPi:

$ sudo pip install libnfldap

Or build a RPM using:

$ python setup.py bdist_rpm

The latter will include an RPM dependency for python-ldap.

Example

The script at example_allusers.py will build iptables and ipset rules for all users in LDAP. You can provide the script an ldap filter as argv[1] to limit the scope.

$ time python example_allusers.py '(uid=jvehent)'
IPTables rules written in /tmp/tmpT7JgOW
IPSet rules written in /tmp/tmpJYtWM5

real    0m0.605s
user    0m0.061s
sys     0m0.014s

example.py does something similar but for a single user identified by its uidNumber (unix user ID).

$ python example.py 2297
#Generating rules for user ID 1664
#====== ACL details ======
jvehent has access to .....

Authors

Julien Vehent & Guillaume Destuynder (@ mozilla)

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

libnfldap-1.0.7.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file libnfldap-1.0.7.tar.gz.

File metadata

  • Download URL: libnfldap-1.0.7.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for libnfldap-1.0.7.tar.gz
Algorithm Hash digest
SHA256 4492ca7b0f5ce4ab6e2c23b8719e5c3a4597214c84a71f7e9bbd00d83e91b6c9
MD5 337961c0f75fc8cd53490e153a9955ef
BLAKE2b-256 a21ceff654b9680590f02f81884d230d6ed3af1fd065430b96215b3756d4f706

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page