a034456
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
a034456
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
a034456
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
a034456
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
a034456
%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
a034456
%{!?_httpd_moddir:    %{expand: %%global _httpd_moddir    %%{_libdir}/httpd/modules}}
a034456
713661d
%global with_mlogc 0%{?fedora} || 0%{?rhel} <= 6
713661d
Michael Fleming 96023a0
Summary: Security module for the Apache HTTP Server
Michael Fleming 96023a0
Name: mod_security 
498f499
Version: 2.7.6
498f499
Release: 1%{?dist}
d206ef5
License: ASL 2.0
Michael Fleming 96023a0
URL: http://www.modsecurity.org/
Michael Fleming 96023a0
Group: System Environment/Daemons
498f499
Source: https://github.com/SpiderLabs/ModSecurity/archive/v%{version}.tar.gz
Michael Fleming 96023a0
Source1: mod_security.conf
712810b
Source2: 10-mod_security.conf
a034456
Requires: httpd httpd-mmn = %{_httpd_mmn}
Michael Fleming b23dd3a
BuildRequires: httpd-devel libxml2-devel pcre-devel curl-devel lua-devel
Michael Fleming 96023a0
Michael Fleming 96023a0
%description
Michael Fleming e4e1b11
ModSecurity is an open source intrusion detection and prevention engine
Michael Fleming e4e1b11
for web applications. It operates embedded into the web server, acting
Michael Fleming e4e1b11
as a powerful umbrella - shielding web applications from attacks.
Michael Fleming 96023a0
713661d
%if %with_mlogc
d206ef5
%package -n     mlogc
d206ef5
Summary:        ModSecurity Audit Log Collector
d206ef5
Group:          System Environment/Daemons
d206ef5
Requires:       mod_security
d206ef5
d206ef5
%description -n mlogc
d206ef5
This package contains the ModSecurity Audit Log Collector.
713661d
%endif
Michael Fleming 96023a0
d206ef5
%prep
498f499
%setup -q -n ModSecurity-%{version}
Michael Fleming 96023a0
Michael Fleming 96023a0
%build
498f499
# Autogen issue reporte to upstream: 
498f499
# https://github.com/SpiderLabs/ModSecurity/issues/621
498f499
./autogen.sh
a034456
%configure --enable-pcre-match-limit=1000000 \
a034456
           --enable-pcre-match-limit-recursion=1000000 \
a034456
           --with-apxs=%{_httpd_apxs}
d206ef5
# remove rpath
d206ef5
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
d206ef5
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
d206ef5
Michael Fleming b23dd3a
make %{_smp_mflags}
Michael Fleming 96023a0
Michael Fleming 96023a0
%install
Michael Fleming 96023a0
rm -rf %{buildroot}
d206ef5
d206ef5
install -d %{buildroot}%{_sbindir}
d206ef5
install -d %{buildroot}%{_bindir}
a034456
install -d %{buildroot}%{_httpd_moddir}
d206ef5
install -d %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/
d206ef5
install -d %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules
d206ef5
a034456
install -m0755 apache2/.libs/mod_security2.so %{buildroot}%{_httpd_moddir}/mod_security2.so
a034456
a034456
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
a034456
# 2.4-style
712810b
install -Dp -m0644 %{SOURCE2} %{buildroot}%{_httpd_modconfdir}/10-mod_security.conf
712810b
install -Dp -m0644 %{SOURCE1} %{buildroot}%{_httpd_confdir}/mod_security.conf
712810b
sed  -i 's/Include/IncludeOptional/'  %{buildroot}%{_httpd_confdir}/mod_security.conf
a034456
%else
a034456
# 2.2-style
712810b
install -d -m0755 %{buildroot}%{_httpd_confdir}
712810b
cat %{SOURCE2} %{SOURCE1} > %{buildroot}%{_httpd_confdir}/mod_security.conf
a034456
%endif
b4feb28
install -m 700 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
d206ef5
d206ef5
# mlogc
713661d
%if %with_mlogc
d206ef5
install -d %{buildroot}%{_localstatedir}/log/mlogc
d206ef5
install -d %{buildroot}%{_localstatedir}/log/mlogc/data
d206ef5
install -m0755 mlogc/mlogc %{buildroot}%{_bindir}/mlogc
d206ef5
install -m0755 mlogc/mlogc-batch-load.pl %{buildroot}%{_bindir}/mlogc-batch-load
d206ef5
install -m0644 mlogc/mlogc-default.conf %{buildroot}%{_sysconfdir}/mlogc.conf
713661d
%endif
b4feb28
Michael Fleming 96023a0
%clean
Michael Fleming 96023a0
rm -rf %{buildroot}
Michael Fleming 96023a0
Michael Fleming 96023a0
%files
a034456
%defattr (-,root,root)
d206ef5
%doc CHANGES LICENSE README.TXT NOTICE
a034456
%{_httpd_moddir}/mod_security2.so
a034456
%config(noreplace) %{_httpd_confdir}/*.conf
a034456
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
a034456
%config(noreplace) %{_httpd_modconfdir}/*.conf
a034456
%endif
Michael Fleming 522c01c
%dir %{_sysconfdir}/httpd/modsecurity.d
d206ef5
%dir %{_sysconfdir}/httpd/modsecurity.d/activated_rules
b4feb28
%attr(770,apache,root) %dir %{_localstatedir}/lib/%{name}
d206ef5
713661d
%if %with_mlogc
d206ef5
%files -n mlogc
a034456
%defattr (-,root,root)
d206ef5
%doc mlogc/INSTALL
d206ef5
%attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/mlogc.conf
d206ef5
%attr(0755,root,root) %dir %{_localstatedir}/log/mlogc
d206ef5
%attr(0770,root,apache) %dir %{_localstatedir}/log/mlogc/data
d206ef5
%attr(0755,root,root) %{_bindir}/mlogc
d206ef5
%attr(0755,root,root) %{_bindir}/mlogc-batch-load
713661d
%endif
Michael Fleming 522c01c
Michael Fleming 96023a0
%changelog
498f499
* Tue Dec 17 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.6-1
498f499
- Update to 2.7.6
498f499
- Fix spec since upstream will only provide tarball via Github
498f499
b5262fe
* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 2.7.5-2
b5262fe
- Perl 5.18 rebuild
b5262fe
79f6609
* Tue Jul 30 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.5-1
79f6609
- Update to 2.7.5
79f6609
c23755e
* Thu Jul 18 2013 Petr Pisar <ppisar@redhat.com> - 2.7.4-2
c23755e
- Perl 5.18 rebuild
c23755e
33636a6
* Tue May 28 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.4-1
33636a6
- Update to 2.7.4
33636a6
- Drop non required patch
33636a6
a1c20bc
* Tue May 28 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.3-2
a1c20bc
- Fix NULL pointer dereference (DoS, crash) (CVE-2013-2765) (RHBZ #967615)
a1c20bc
- Fix a possible memory leak.
a1c20bc
cef50fc
* Sat Mar 30 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.3-1
cef50fc
- Update to 2.7.3
cef50fc
4740edb
* Fri Jan 25 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.2-1
4740edb
- Update to 2.7.2
4740edb
- Update source url in the spec.
4740edb
712810b
* Thu Nov 22 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-5
712810b
- Use conditional for loading mod_unique_id (rhbz #879264)
712810b
- Fix syntax errors on httpd 2.4.x by using IncludeOptional (rhbz #879264, comment #2)
712810b
713661d
* Mon Nov 19 2012 Peter Vrabec <pvrabec@redhat.com> 2.7.1-4
713661d
- mlogc subpackage is not provided on RHEL7
713661d
b4feb28
* Thu Nov 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-3
b4feb28
- Add some missing directives RHBZ #569360
b4feb28
- Fix multipart/invalid part ruleset bypass issue (CVE-2012-4528)
b4feb28
  (RHBZ #867424, #867773, #867774)
b4feb28
7f15e7f
* Thu Nov 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-2
7f15e7f
- Fix mod_security.conf
7f15e7f
27a5435
* Thu Nov 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.1-1
27a5435
- Update to 2.7.1
27a5435
- Remove libxml2 build patch (upstreamed)
27a5435
- Update spec since upstream moved to github
27a5435
77b343a
* Thu Oct 18 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.0-2
77b343a
- Add a patch to fix failed build against libxml2 >= 2.9.0
77b343a
ea35d25
* Wed Oct 17 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.7.0-1
ea35d25
- Update to 2.7.0
ea35d25
6abd27e
* Fri Sep 28 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.8-1
6abd27e
- Update to 2.6.8
6abd27e
ea35d25
* Wed Sep 12 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.7-2
ea35d25
- Re-add mlogc sub-package for epel (#856525)
ea35d25
 
ea35d25
* Sat Aug 25 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.7-1
ea35d25
- Update to 2.6.7
ea35d25
bf0a9ae
* Sat Aug 25 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.6.7-1
bf0a9ae
- Update to 2.6.7
bf0a9ae
55d1760
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.6-3
55d1760
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
55d1760
0d2b8e6
* Fri Jun 22 2012 Peter Vrabec <pvrabec@redhat.com> - 2.6.6-2
0d2b8e6
- mlogc subpackage is not provided on RHEL
0d2b8e6
 
0692331
* Thu Jun 21 2012 Peter Vrabec <pvrabec@redhat.com> - 2.6.6-1
0692331
- upgrade
0692331
a034456
* Mon May  7 2012 Joe Orton <jorton@redhat.com> - 2.6.5-3
a034456
- packaging fixes
a034456
d206ef5
* Fri Apr 27 2012 Peter Vrabec <pvrabec@redhat.com> 2.6.5-2
d206ef5
- fix license tag
d206ef5
d206ef5
* Thu Apr 05 2012 Peter Vrabec <pvrabec@redhat.com> 2.6.5-1
d206ef5
- upgrade & move rules into new package mod_security_crs
d206ef5
8aa0522
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 2.5.13-3
8aa0522
- Rebuild against PCRE 8.30
b6be9fd
- Do not install non-existing files
8aa0522
8b99491
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.13-2
8b99491
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
8b99491
Michael Fleming 58fe94c
* Wed May 3 2011 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.13-1
Michael Fleming 58fe94c
- Newer upstream version
Michael Fleming 58fe94c
Michael Fleming ab897d3
* Wed Jun 30 2010 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.12-3
Michael Fleming ab897d3
- Fix log dirs and files ordering per bz#569360
Michael Fleming ab897d3
Michael Fleming c50316f
* Thu Apr 29 2010 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.12-2
Michael Fleming c50316f
- Fix SecDatadir and minimal config per bz #569360
Michael Fleming c50316f
Michael Fleming 7f3e577
* Sat Feb 13 2010 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.12-1
Michael Fleming 7f3e577
- Update to latest upstream release
Michael Fleming 7f3e577
- SECURITY: Fix potential rules bypass and denial of service (bz#563576)
Michael Fleming 7f3e577
Michael Fleming be88021
* Fri Nov 6 2009 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.10-2
Michael Fleming be88021
- Fix rules and Apache configuration (bz#533124)
Michael Fleming be88021
Michael Fleming 6955722
* Thu Oct 8 2009 Michael Fleming <mfleming+rpm@thatfleminggent.com> - 2.5.10-1
Michael Fleming 6955722
- Upgrade to 2.5.10 (with Core Rules v2)
Michael Fleming 6955722
676f48c
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.9-2
676f48c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
676f48c
Michael Fleming a65c977
* Thu Mar 12 2009 Michael Fleming <mfleming+rpm@thatfleminggent.com> 2.5.9-1
Michael Fleming a65c977
- Update to upstream release 2.5.9
Michael Fleming a65c977
- Fixes potential DoS' in multipart request and PDF XSS handling
Michael Fleming a65c977
06226ca
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.7-2
06226ca
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
06226ca
Michael Fleming 4f2a718
* Mon Dec 29 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.5.7-1
Michael Fleming 4f2a718
- Update to upstream 2.5.7
Michael Fleming 4f2a718
- Reinstate mlogc
Michael Fleming 4f2a718
Michael Fleming b23dd3a
* Sat Aug 2 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.5.6-1
Michael Fleming b23dd3a
- Update to upstream 2.5.6
Michael Fleming b23dd3a
- Remove references to mlogc, it no longer ships in the main tarball.
Michael Fleming b23dd3a
- Link correctly vs. libxml2 and lua (bz# 445839)
Michael Fleming b23dd3a
- Remove bogus LoadFile directives as they're no longer needed.
Michael Fleming b23dd3a
Michael Fleming b74c4dc
* Sun Apr 13 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.7-1
Michael Fleming b74c4dc
- Update to upstream 2.1.7
Michael Fleming b74c4dc
Michael Fleming 72717da
* Sat Feb 23 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.6-1
Michael Fleming 72717da
- Update to upstream 2.1.6 (Extra features including SecUploadFileMode)
Michael Fleming 72717da
c8a7eb5
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.1.5-3
c8a7eb5
- Autorebuild for GCC 4.3
c8a7eb5
Michael Fleming 9d4ba1f
* Sat Jan 27 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.5-2
Michael Fleming d8bb41b
- Update to 2.1.5 (bz#425986)
Michael Fleming 9d4ba1f
- "blocking" -> "optional_rules" per tarball ;-)
Michael Fleming 9d4ba1f
Michael Fleming d8bb41b
Michael Fleming 485f3b1
* Thu Sep  13 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.3-1
Michael Fleming 485f3b1
- Update to 2.1.3
Michael Fleming 485f3b1
- Update License tag per guidelines.
Michael Fleming 485f3b1
38431c5
* Mon Sep  3 2007 Joe Orton <jorton@redhat.com> 2.1.1-3
38431c5
- rebuild for fixed 32-bit APR (#254241)
38431c5
2830a24
* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.1.1-2
2830a24
- Rebuild for selinux ppc32 issue.
2830a24
Michael Fleming dd43f1a
* Tue Jun 19 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.1-1
Michael Fleming dd43f1a
- New upstream release
Michael Fleming dd43f1a
- Drop ASCIIZ rule (fixed upstream)
Michael Fleming dd43f1a
- Re-enable protocol violation/anomalies rules now that REQUEST_FILENAME
Michael Fleming dd43f1a
  is fixed upstream.
Michael Fleming dd43f1a
Michael Fleming e91c721
* Sun Apr 1 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.0-3
Michael Fleming e91c721
- Automagically configure correct library path for libxml2 library.
Michael Fleming e91c721
- Add LoadModule for mod_unique_id as the logging wants this at runtime
Michael Fleming e91c721
Michael Fleming 421ee46
* Mon Mar 26 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.0-2
Michael Fleming 421ee46
- Fix DSO permissions (bz#233733)
Michael Fleming 421ee46
Michael Fleming 522c01c
* Tue Mar 13 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 2.1.0-1
Michael Fleming 522c01c
- New major release - 2.1.0
Michael Fleming 522c01c
- Fix CVE-2007-1359 with a local rule courtesy of Ivan Ristic
Michael Fleming 522c01c
- Addition of core ruleset
Michael Fleming 522c01c
- (Build)Requires libxml2 and pcre added.
Michael Fleming 522c01c
Michael Fleming 6ca7e79
* Sun Sep 3 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.4-2
Michael Fleming 6ca7e79
- Rebuild
Michael Fleming 6ca7e79
- Fix minor longstanding braino in included sample configuration (bz #203972)
Michael Fleming 6ca7e79
Michael Fleming 573ce0f
* Mon May 15 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.4-1
Michael Fleming 573ce0f
- New upstream release
Michael Fleming 573ce0f
Michael Fleming 572f234
* Tue Apr 11 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.3-1
Michael Fleming 572f234
- New upstream release
Michael Fleming 572f234
- Trivial spec tweaks
Michael Fleming 572f234
Michael Fleming 7b6fc8c
* Wed Mar 1 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.2-3
Michael Fleming 7b6fc8c
- Bump for FC5
Michael Fleming 7b6fc8c
Michael Fleming e4d95d4
* Fri Feb 10 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.2-2
Michael Fleming e4d95d4
- Bump for newer gcc/glibc
Michael Fleming e4d95d4
Michael Fleming ebef2fc
* Wed Jan 18 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.2-1
Michael Fleming ebef2fc
- New upstream release
Michael Fleming ebef2fc
Michael Fleming e25b694
* Fri Dec 16 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.1-2
Michael Fleming e25b694
- Bump for new httpd
Michael Fleming e25b694
Michael Fleming 905afd8
* Thu Dec 1 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9.1-1
Michael Fleming 905afd8
- New release 1.9.1 
Michael Fleming 905afd8
Michael Fleming 9cf96f5
* Wed Nov 9 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.9-1
Michael Fleming 9cf96f5
- New stable upstream release 1.9
Michael Fleming 9cf96f5
Michael Fleming ad8d19a
* Sat Jul 9 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-4
Michael Fleming ad8d19a
- Add Requires: httpd-mmn to get the appropriate "module magic" version
Michael Fleming 9cf96f5
  (thanks Ville Skytta)
Michael Fleming ad8d19a
- Disabled an overly-agressive rule or two..
Michael Fleming ad8d19a
Michael Fleming e4e1b11
* Sat Jul 9 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-3
Michael Fleming e4e1b11
- Correct Buildroot
Michael Fleming e4e1b11
- Some sensible and safe rules for common apps in mod_security.conf
Michael Fleming e4e1b11
Michael Fleming b2a0943
* Thu May 19 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-2
Michael Fleming b2a0943
- Don't strip the module (so we can get a useful debuginfo package)
Michael Fleming b2a0943
Michael Fleming 96023a0
* Thu May 19 2005 Michael Fleming <mfleming+rpm@enlartenment.com> 1.8.7-1
Michael Fleming 96023a0
- Initial spin for Extras