cgoncalves / rpms / mod_security

Forked from rpms/mod_security 4 years ago
Clone
bb7e57
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
bb7e57
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
bb7e57
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
bb7e57
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
bb7e57
%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
bb7e57
%{!?_httpd_moddir:    %{expand: %%global _httpd_moddir    %%{_libdir}/httpd/modules}}
bb7e57
bb7e57
%global with_mlogc 1
bb7e57
bb7e57
Summary: Security module for the Apache HTTP Server
bb7e57
Name: mod_security 
bb7e57
Version: 2.9.2
bb7e57
Release: 1%{?dist}
bb7e57
License: ASL 2.0
bb7e57
URL: http://www.modsecurity.org/
bb7e57
Group: System Environment/Daemons
bb7e57
Source: https://www.modsecurity.org/tarball/%{version}/modsecurity-%{version}.tar.gz
bb7e57
Source1: mod_security.conf
bb7e57
Source2: 10-mod_security.conf
bb7e57
bb7e57
Requires: httpd httpd-mmn = %{_httpd_mmn}
bb7e57
BuildRequires: httpd-devel libxml2-devel pcre-devel curl-devel lua-devel
bb7e57
bb7e57
%description
bb7e57
ModSecurity is an open source intrusion detection and prevention engine
bb7e57
for web applications. It operates embedded into the web server, acting
bb7e57
as a powerful umbrella - shielding web applications from attacks.
bb7e57
bb7e57
%if %with_mlogc
bb7e57
%package	mlogc
bb7e57
Summary:        ModSecurity Audit Log Collector
bb7e57
Group:          System Environment/Daemons
bb7e57
Requires:       mod_security
bb7e57
bb7e57
%description	mlogc
bb7e57
This package contains the ModSecurity Audit Log Collector.
bb7e57
%endif
bb7e57
bb7e57
%prep
bb7e57
%setup -q -n modsecurity-%{version}
bb7e57
bb7e57
%build
bb7e57
%configure --enable-pcre-match-limit=1000000 \
bb7e57
           --enable-pcre-match-limit-recursion=1000000 \
bb7e57
           --with-apxs=%{_httpd_apxs} \
bb7e57
%if %with_mlogc
bb7e57
	   --enable-mlogc \
bb7e57
%else
bb7e57
	   --disable-mlogc \
bb7e57
%endif
bb7e57
	   --enable-collection-global-lock
bb7e57
# remove rpath
bb7e57
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
bb7e57
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
bb7e57
bb7e57
make %{_smp_mflags}
bb7e57
bb7e57
%install
bb7e57
rm -rf %{buildroot}
bb7e57
bb7e57
install -d %{buildroot}%{_sbindir}
bb7e57
install -d %{buildroot}%{_bindir}
bb7e57
install -d %{buildroot}%{_httpd_moddir}
bb7e57
install -d %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/
bb7e57
install -d %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules
bb7e57
bb7e57
install -m0755 apache2/.libs/mod_security2.so %{buildroot}%{_httpd_moddir}/mod_security2.so
bb7e57
bb7e57
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
bb7e57
# 2.4-style
bb7e57
install -Dp -m0644 %{SOURCE2} %{buildroot}%{_httpd_modconfdir}/10-mod_security.conf
bb7e57
install -Dp -m0644 %{SOURCE1} %{buildroot}%{_httpd_confdir}/mod_security.conf
bb7e57
sed  -i 's/Include/IncludeOptional/'  %{buildroot}%{_httpd_confdir}/mod_security.conf
bb7e57
%else
bb7e57
# 2.2-style
bb7e57
install -d -m0755 %{buildroot}%{_httpd_confdir}
bb7e57
cat %{SOURCE2} %{SOURCE1} > %{buildroot}%{_httpd_confdir}/mod_security.conf
bb7e57
%endif
bb7e57
install -m 700 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
bb7e57
bb7e57
# mlogc
bb7e57
%if %with_mlogc
bb7e57
install -d %{buildroot}%{_localstatedir}/log/mlogc
bb7e57
install -d %{buildroot}%{_localstatedir}/log/mlogc/data
bb7e57
install -m0755 mlogc/mlogc %{buildroot}%{_bindir}/mlogc
bb7e57
install -m0755 mlogc/mlogc-batch-load.pl %{buildroot}%{_bindir}/mlogc-batch-load
bb7e57
install -m0644 mlogc/mlogc-default.conf %{buildroot}%{_sysconfdir}/mlogc.conf
bb7e57
%endif
bb7e57
bb7e57
%clean
bb7e57
rm -rf %{buildroot}
bb7e57
bb7e57
%files
bb7e57
%defattr (-,root,root)
bb7e57
%doc CHANGES LICENSE README.TXT NOTICE
bb7e57
%{_httpd_moddir}/mod_security2.so
bb7e57
%config(noreplace) %{_httpd_confdir}/*.conf
bb7e57
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
bb7e57
%config(noreplace) %{_httpd_modconfdir}/*.conf
bb7e57
%endif
bb7e57
%dir %{_sysconfdir}/httpd/modsecurity.d
bb7e57
%dir %{_sysconfdir}/httpd/modsecurity.d/activated_rules
bb7e57
%attr(770,apache,root) %dir %{_localstatedir}/lib/%{name}
bb7e57
bb7e57
%if %with_mlogc
bb7e57
%files mlogc
bb7e57
%defattr (-,root,root)
bb7e57
%doc mlogc/INSTALL
bb7e57
%attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/mlogc.conf
bb7e57
%attr(0755,root,root) %dir %{_localstatedir}/log/mlogc
bb7e57
%attr(0770,root,apache) %dir %{_localstatedir}/log/mlogc/data
bb7e57
%attr(0755,root,root) %{_bindir}/mlogc
bb7e57
%attr(0755,root,root) %{_bindir}/mlogc-batch-load
bb7e57
%endif
bb7e57
bb7e57
%changelog
bb7e57
* Wed Sep  6 2017 Daniel Kopecek <dkopecek@redhat.com> - 2.9.2-1
bb7e57
- RHEL-7.5 erratum
bb7e57
 - Update to 2.9.2
bb7e57
 - Fixed bogus dates in the spec file
bb7e57
 - Enabled mlogc subpackage
bb7e57
 - Enabled collection global lock to prevent collection
bb7e57
   removal failures
bb7e57
  Resolves: rhbz#1388656
bb7e57
  Resolves: rhbz#1139728
bb7e57
  Resolves: rhbz#1473420
bb7e57
bb7e57
* Thu Apr  3 2014 Daniel Kopecek <dkopecek@redhat.com> - 2.7.3-5
bb7e57
- Fix Chunked string case sensitive issue (CVE-2013-5705)
bb7e57
  Resolves: rhbz#1082907
bb7e57
bb7e57
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 2.7.3-4
bb7e57
- Mass rebuild 2014-01-24
bb7e57
bb7e57
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2.7.3-3
bb7e57
- Mass rebuild 2013-12-27
bb7e57
bb7e57
* Tue May 28 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.3-2
bb7e57
- Fix NULL pointer dereference (DoS, crash) (CVE-2013-2765) (RHBZ #967615)
bb7e57
- Fix a possible memory leak.
bb7e57
bb7e57
* Sat Mar 30 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.3-1
bb7e57
- Update to 2.7.3
bb7e57
bb7e57
* Fri Jan 25 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.2-1
bb7e57
- Update to 2.7.2
bb7e57
- Update source url in the spec.
bb7e57
bb7e57
* Thu Nov 22 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-5
bb7e57
- Use conditional for loading mod_unique_id (rhbz #879264)
bb7e57
- Fix syntax errors on httpd 2.4.x by using IncludeOptional (rhbz #879264, comment #2)
bb7e57
bb7e57
* Mon Nov 19 2012 Peter Vrabec <pvrabec@redhat.com> 2.7.1-4
bb7e57
- mlogc subpackage is not provided on RHEL7
bb7e57
bb7e57
* Thu Nov 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-3
bb7e57
- Add some missing directives RHBZ #569360
bb7e57
- Fix multipart/invalid part ruleset bypass issue (CVE-2012-4528)
bb7e57
  (RHBZ #867424, #867773, #867774)
bb7e57
bb7e57
* Thu Nov 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-2
bb7e57
- Fix mod_security.conf
bb7e57
bb7e57
* Thu Nov 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-1
bb7e57
- Update to 2.7.1
bb7e57
- Remove libxml2 build patch (upstreamed)
bb7e57
- Update spec since upstream moved to github
bb7e57
bb7e57
* Thu Oct 18 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.0-2
bb7e57
- Add a patch to fix failed build against libxml2 >= 2.9.0
bb7e57
bb7e57
* Wed Oct 17 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.0-1
bb7e57
- Update to 2.7.0
bb7e57
bb7e57
* Fri Sep 28 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.8-1
bb7e57
- Update to 2.6.8
bb7e57
bb7e57
* Wed Sep 12 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.7-2
bb7e57
- Re-add mlogc sub-package for epel (#856525)
bb7e57
 
bb7e57
* Sat Aug 25 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.7-1
bb7e57
- Update to 2.6.7
bb7e57
bb7e57
* Sat Aug 25 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.7-1
bb7e57
- Update to 2.6.7
bb7e57
bb7e57
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.6-3
bb7e57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
bb7e57
bb7e57
* Fri Jun 22 2012 Peter Vrabec <pvrabec@redhat.com> - 2.6.6-2
bb7e57
- mlogc subpackage is not provided on RHEL
bb7e57
 
bb7e57
* Thu Jun 21 2012 Peter Vrabec <pvrabec@redhat.com> - 2.6.6-1
bb7e57
- upgrade
bb7e57
bb7e57
* Mon May  7 2012 Joe Orton <jorton@redhat.com> - 2.6.5-3
bb7e57
- packaging fixes
bb7e57
bb7e57
* Fri Apr 27 2012 Peter Vrabec <pvrabec@redhat.com> 2.6.5-2
bb7e57
- fix license tag
bb7e57
bb7e57
* Thu Apr 05 2012 Peter Vrabec <pvrabec@redhat.com> 2.6.5-1
bb7e57
- upgrade & move rules into new package mod_security_crs
bb7e57
bb7e57
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 2.5.13-3
bb7e57
- Rebuild against PCRE 8.30
bb7e57
- Do not install non-existing files
bb7e57
bb7e57
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.13-2
bb7e57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
bb7e57
bb7e57
* Tue May 3 2011 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.13-1
bb7e57
- Newer upstream version
bb7e57
bb7e57
* Wed Jun 30 2010 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.12-3
bb7e57
- Fix log dirs and files ordering per bz#569360
bb7e57
bb7e57
* Thu Apr 29 2010 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.12-2
bb7e57
- Fix SecDatadir and minimal config per bz #569360
bb7e57
bb7e57
* Sat Feb 13 2010 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.12-1
bb7e57
- Update to latest upstream release
bb7e57
- SECURITY: Fix potential rules bypass and denial of service (bz#563576)
bb7e57
bb7e57
* Fri Nov 6 2009 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.10-2
bb7e57
- Fix rules and Apache configuration (bz#533124)
bb7e57
bb7e57
* Thu Oct 8 2009 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.10-1
bb7e57
- Upgrade to 2.5.10 (with Core Rules v2)
bb7e57
bb7e57
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.9-2
bb7e57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
bb7e57
bb7e57
* Thu Mar 12 2009 Michael Fleming <mfleming+rpm@thatfleminggent.com> 2.5.9-1
bb7e57
- Update to upstream release 2.5.9
bb7e57
- Fixes potential DoS' in multipart request and PDF XSS handling
bb7e57
bb7e57
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.7-2
bb7e57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
bb7e57
bb7e57
* Mon Dec 29 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.5.7-1
bb7e57
- Update to upstream 2.5.7
bb7e57
- Reinstate mlogc
bb7e57
bb7e57
* Sat Aug 2 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.5.6-1
bb7e57
- Update to upstream 2.5.6
bb7e57
- Remove references to mlogc, it no longer ships in the main tarball.
bb7e57
- Link correctly vs. libxml2 and lua (bz# 445839)
bb7e57
- Remove bogus LoadFile directives as they're no longer needed.
bb7e57
bb7e57
* Sun Apr 13 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.7-1
bb7e57
- Update to upstream 2.1.7
bb7e57
bb7e57
* Sat Feb 23 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.6-1
bb7e57
- Update to upstream 2.1.6 (Extra features including SecUploadFileMode)
bb7e57
bb7e57
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.1.5-3
bb7e57
- Autorebuild for GCC 4.3
bb7e57
bb7e57
* Sun Jan 27 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.5-2
bb7e57
- Update to 2.1.5 (bz#425986)
bb7e57
- "blocking" -> "optional_rules" per tarball ;-)
bb7e57
bb7e57
* Thu Sep  13 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.3-1
bb7e57
- Update to 2.1.3
bb7e57
- Update License tag per guidelines.
bb7e57
bb7e57
* Mon Sep  3 2007 Joe Orton <jorton@redhat.com> 2.1.1-3
bb7e57
- rebuild for fixed 32-bit APR (#254241)
bb7e57
bb7e57
* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.1.1-2
bb7e57
- Rebuild for selinux ppc32 issue.
bb7e57
bb7e57
* Tue Jun 19 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.1-1
bb7e57
- New upstream release
bb7e57
- Drop ASCIIZ rule (fixed upstream)
bb7e57
- Re-enable protocol violation/anomalies rules now that REQUEST_FILENAME
bb7e57
  is fixed upstream.
bb7e57
bb7e57
* Sun Apr 1 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.0-3
bb7e57
- Automagically configure correct library path for libxml2 library.
bb7e57
- Add LoadModule for mod_unique_id as the logging wants this at runtime
bb7e57
bb7e57
* Mon Mar 26 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.0-2
bb7e57
- Fix DSO permissions (bz#233733)
bb7e57
bb7e57
* Tue Mar 13 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.0-1
bb7e57
- New major release - 2.1.0
bb7e57
- Fix CVE-2007-1359 with a local rule courtesy of Ivan Ristic
bb7e57
- Addition of core ruleset
bb7e57
- (Build)Requires libxml2 and pcre added.
bb7e57
bb7e57
* Sun Sep 3 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.4-2
bb7e57
- Rebuild
bb7e57
- Fix minor longstanding braino in included sample configuration (bz #203972)
bb7e57
bb7e57
* Mon May 15 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.4-1
bb7e57
- New upstream release
bb7e57
bb7e57
* Tue Apr 11 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.3-1
bb7e57
- New upstream release
bb7e57
- Trivial spec tweaks
bb7e57
bb7e57
* Wed Mar 1 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.2-3
bb7e57
- Bump for FC5
bb7e57
bb7e57
* Fri Feb 10 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.2-2
bb7e57
- Bump for newer gcc/glibc
bb7e57
bb7e57
* Wed Jan 18 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.2-1
bb7e57
- New upstream release
bb7e57
bb7e57
* Fri Dec 16 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.1-2
bb7e57
- Bump for new httpd
bb7e57
bb7e57
* Thu Dec 1 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.1-1
bb7e57
- New release 1.9.1 
bb7e57
bb7e57
* Wed Nov 9 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9-1
bb7e57
- New stable upstream release 1.9
bb7e57
bb7e57
* Sat Jul 9 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-4
bb7e57
- Add Requires: httpd-mmn to get the appropriate "module magic" version
bb7e57
  (thanks Ville Skytta)
bb7e57
- Disabled an overly-agressive rule or two..
bb7e57
bb7e57
* Sat Jul 9 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-3
bb7e57
- Correct Buildroot
bb7e57
- Some sensible and safe rules for common apps in mod_security.conf
bb7e57
bb7e57
* Thu May 19 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-2
bb7e57
- Don't strip the module (so we can get a useful debuginfo package)
bb7e57
bb7e57
* Thu May 19 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-1
bb7e57
- Initial spin for Extras