From 8574d1e9c8c6496412c116e77386be535b2f4e80 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Tue, 22 Dec 2020 12:04:44 +0100 Subject: [PATCH] New apache2 module to mask IP's in the logs --- centos/SPECS/mod_log_ipmask.spec | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 centos/SPECS/mod_log_ipmask.spec diff --git a/centos/SPECS/mod_log_ipmask.spec b/centos/SPECS/mod_log_ipmask.spec new file mode 100644 index 0000000..8ce605e --- /dev/null +++ b/centos/SPECS/mod_log_ipmask.spec @@ -0,0 +1,46 @@ +Name: mod_log_ipmask +Version: 1.0.0 +Release: 1%{?dist} +Summary: mod_log_ipmask module for the Apache HTTP Server + +License: ASL 2.0 +URL: https://github.com/openstreetmap/mod_tile +Source0: %{name}-%{version}.tar.gz +Source1: 10-log_ipmask.conf +Source2: log_ipmask.conf + +%define debug_package %{nil} + +BuildRequires: httpd-devel, apr + +%description +The mod_log_ipmask module is designed to work with version 2.4 of the Apache HTTP Server. +It extends the mod_log_config module by overriding the %a and %h format strings in +order to limit the number of IP address bits that are included in log files. +This is intended for applications where partial logging of IP addresses is desired, +but full IP addresses may not be logged due to privacy concerns. + +%prep +%setup -q -n %{name}-%{version} + +%build +apxs -c mod_log_ipmask.c + +%install +%{__install} -D .libs/%{name}.so %{buildroot}%{_libdir}/httpd/modules/%{name}.so +%{__install} -D %{S:1} %{buildroot}%{_sysconfdir}/httpd/conf.modules.d/10-log_ipmask.conf +%{__install} -D %{S:2} %{buildroot}%{_sysconfdir}/httpd/conf.d/log_ipmask.conf + +%clean +[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} +[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/* + +%files +%doc README.md LICENSE.txt +%config(noreplace) %{_sysconfdir}/httpd/conf.d/log_ipmask.conf +%config %{_sysconfdir}/httpd/conf.modules.d/10-log_ipmask.conf +%{_libdir}/httpd/modules/%{name}.so + +%changelog +* Tue Dec 22 2020 Daniel Steiner +- First build.