{{tag>[centos7 linux ldap openldap security audit log]}} =====CentOS 7 - OpenLDAP 2.4 audit log===== Configure the steps below on the provider (master) or servers where changes to the directory can be made. Audit logging will be saved as LDIF format. ====Configure the audit module==== * Load the module:# ldapadd -H ldaps:// -x -D "cn=Manager,dc=domain,dc=tld" -W < * Create log directory:mkdir -p /var/log/slapd chmod 755 /var/log/slapd/ chown ldap. /var/log/slapd/ * Add overlay:# ldapadd -H ldaps:// -x -D "cn=Manager,dc=domain,dc=tld" -W < ====Configure log rotate==== * Configure log rotate, create the following file /etc/logrotate.d/slapd-audit:# vim /etc/logrotate.d/slapd-audit /var/log/slapd/auditlog.log { notifempty missingok monthly rotate 3 compress copytruncate } * Test log rotation:logrotate --force /etc/logrotate.d/slapd-audit