A Python module to generate IPTables and IPSet rules from LDAP records
Перейти к файлу
Greg Cox 067d8d2562 py3 fixes around LDAP return values 2022-07-08 16:49:49 +00:00
examples Sample code to generate a tree of iptables rules for users and groups 2014-06-06 13:41:14 -04:00
src/libnfldap py3 fixes around LDAP return values 2022-07-08 16:49:49 +00:00
AUTHORS.rst Pypification 2014-06-06 13:43:05 -04:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct (#4) 2019-03-30 16:47:48 +00:00
LICENSE Pypification 2014-06-06 13:43:05 -04:00
MANIFEST MANIFEST update 2014-06-07 12:00:45 -04:00
MANIFEST.in pypi fix 2014-06-07 11:58:46 -04:00
Makefile Packaging corrections 2022-07-08 14:50:04 +00:00
README.rst Have bdist_rpm build the python-ldap dependency into the RPM 2017-12-08 22:41:31 +00:00
__init__.py Pypification 2014-06-06 13:43:05 -04:00
requirements.txt re is part of base / not a pip module 2018-01-30 06:57:12 +00:00
setup.cfg Packaging corrections 2022-07-08 14:50:04 +00:00
setup.py Update for py3 2022-07-08 14:13:35 +00:00

README.rst

=========
libnfldap
=========

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

Installation
------------

Use PyPi:

.. code:: bash

	$ sudo pip install libnfldap

Or build a RPM using:

.. code:: bash

	$ 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.

.. code:: bash

	$ 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).

.. code:: bash

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

Authors
-------
Julien Vehent & Guillaume Destuynder (@ mozilla)