diff --git a/bin/deltalogparse.py b/bin/deltalogparse.py new file mode 100755 index 0000000000000000000000000000000000000000..e46b6e868a1f2d03c0df8515891f336c429d011a --- /dev/null +++ b/bin/deltalogparse.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import lib_path +import lib +import ldap3 + +s = ldap3.Server('ldapi:///var/run/slapd/ldapi', get_info=[ldap3.ALL, ldap3.OFFLINE_SLAPD_2_4]) +c = ldap3.Connection(s, authentication=ldap3.SASL, sasl_mechanism=ldap3.EXTERNAL, sasl_credentials='', auto_bind='NONE', version=3, client_strategy='SYNC') +c.bind() + +search_base = 'cn=deltalog' +search_filter = '(objectClass=auditModify)' +search_scope = ldap3.SUBTREE +attributes = [ldap3.ALL_ATTRIBUTES, ldap3.ALL_OPERATIONAL_ATTRIBUTES] + +r = c.search(search_base=search_base, search_filter=search_filter, search_scope=search_scope, attributes=attributes) +if r == True: + for entry in c.response: + print(entry['dn'], entry['attributes'])