2024-06-30 17:36:30 +02:00
%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir} /httpd/conf.d}}
2024-07-15 15:40:57 +02:00
Summary : ModSecurity Core Ruleset
2012-05-07 11:54:36 +02:00
Name : mod_security_crs
2024-05-02 12:47:39 +02:00
Version : 4.2.0
2024-06-30 17:36:30 +02:00
Release : 2%{?dist}
2023-06-06 16:33:17 +02:00
License : Apache-2.0
2023-03-20 12:02:29 +01:00
URL : https://coreruleset.org/
2021-03-26 04:02:06 +01:00
Source : https://github.com/coreruleset/coreruleset/archive/refs/tags/v%{version} .tar.gz
2012-05-07 11:54:36 +02:00
BuildArch : noarch
2022-10-01 00:26:13 +02:00
Requires : mod_security >= 2.9.6
2017-04-22 15:54:50 +02:00
Obsoletes : mod_security_crs-extras < 3.0.0
2012-05-07 11:54:36 +02:00
2024-05-02 12:47:39 +02:00
# Patch0: mod_security_crs-XXX.patch
2022-09-01 01:47:55 +02:00
2012-05-07 11:54:36 +02:00
%description
This package provides the base rules for mod_security.
%prep
2024-05-02 12:47:39 +02:00
%autosetup -p1 -S gendiff -n coreruleset-%{version}
2012-05-07 11:54:36 +02:00
%build
%install
2024-07-15 15:40:57 +02:00
%{__install} -d %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/
%{__install} -d %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/activated_rules
%{__install} -d %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/plugins
%{__install} -d %{buildroot} %{_datarootdir} /mod_modsecurity_crs/rules
%{__install} -d %{buildroot} %{_datarootdir} /mod_modsecurity_crs/plugins
2012-06-20 18:02:25 +02:00
2017-04-22 15:35:44 +02:00
# To exclude rules (pre/post)
2024-07-15 15:40:57 +02:00
%{__mv} rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/activated_rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
%{__mv} rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/activated_rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
2012-11-19 22:04:59 +01:00
2024-07-15 15:40:57 +02:00
%{__install} -m0644 rules/*.conf %{buildroot} %{_datarootdir} /mod_modsecurity_crs/rules/
%{__install} -m0644 rules/*.data %{buildroot} %{_datarootdir} /mod_modsecurity_crs/rules/
%{__install} -m0644 plugins/* %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/plugins/
%{__mv} crs-setup.conf.example %{buildroot} %{_sysconfdir} /httpd/modsecurity.d/crs-setup.conf
2012-05-07 11:54:36 +02:00
2024-07-14 19:57:37 +02:00
%post
2024-07-15 15:40:57 +02:00
if [ $1 == 1 ]; then
# activate base_rules
for f in `ls %{_datarootdir} /mod_modsecurity_crs/rules/` ; do
%{__ln_s} %{_datarootdir} /mod_modsecurity_crs/rules/$f %{_sysconfdir} /httpd/modsecurity.d/activated_rules/$f;
done
%{__sed} -i '/IncludeOptional modsecurity\.d\/\*\.conf/ a\ IncludeOptional modsecurity.d\/plugins\/*-config.conf\n IncludeOptional modsecurity.d\/plugins\/*-before.conf' %{_httpd_confdir} /mod_security.conf
%{__sed} -i '/Include modsecurity\.d\/\*\.conf/a\ Include modsecurity.d/plugins/*-config.conf\n Include modsecurity.d/plugins/*-before.conf' %{_httpd_confdir} /mod_security.conf
%{__sed} -i '/IncludeOptional modsecurity\.d\/local_rules\/\*\.conf/a\ IncludeOptional modsecurity.d\/plugins\/*-after.conf' %{_httpd_confdir} /mod_security.conf
%{__sed} -i '/Include modsecurity\.d\/local_rules\/\*\.conf/a\ Include modsecurity.d\/plugins\/*-after.conf' %{_httpd_confdir} /mod_security.conf
fi
exit 0
%preun
if [ $1 == 0 ]; then
%{__sed} -i -E '/Include(Optional)? modsecurity\.d\/plugins/d' %{_httpd_confdir} /mod_security.conf
for f in `ls %{_datarootdir} /mod_modsecurity_crs/rules/` ; do
%{__rm} %{_sysconfdir} /httpd/modsecurity.d/activated_rules/$f;
done
fi
exit 0
2012-05-07 11:54:36 +02:00
%files
2017-04-22 15:35:44 +02:00
%license LICENSE
2024-05-02 12:47:39 +02:00
%doc CHANGES.md README.md
2024-06-30 17:36:30 +02:00
%{_datarootdir} /mod_modsecurity_crs
%{_sysconfdir} /httpd/modsecurity.d/plugins
2012-05-07 11:54:36 +02:00
%config (noreplace) %{_sysconfdir} /httpd/modsecurity.d/activated_rules/*
2017-04-22 15:35:44 +02:00
%config (noreplace) %{_sysconfdir} /httpd/modsecurity.d/crs-setup.conf
2024-06-30 17:36:30 +02:00
%config (noreplace) %{_sysconfdir} /httpd/modsecurity.d/plugins/*
2012-05-07 11:54:36 +02:00
%changelog
2024-06-30 17:36:30 +02:00
* Tue Jul 9 2024 Daniel Demus <daniel-fedoauth@demus.dk> - 4.2.0-2
- Prepare for plugins (see https://coreruleset.org/20220112/crs-plugin-mechanism/)
2024-05-02 12:47:39 +02:00
* Thu May 02 2024 Luboš Uhliarik <luhliari@redhat.com> - 4.2.0-1
- new version 4.2.0
- switch to autosetup
2024-01-25 08:50:35 +01:00
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
2024-01-21 09:30:41 +01:00
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
2023-07-20 17:38:39 +02:00
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
2023-06-06 16:33:17 +02:00
* Tue Jun 06 2023 Luboš Uhliarik <luhliari@redhat.com> - 3.3.4-5
- SPDX migration
2023-03-20 12:02:29 +01:00
* Mon Mar 20 2023 Mikel Olasagasti Uranga <mikel@olasagasti.info> - 3.3.4-4
- Change URL to new official homepage
2023-01-19 21:34:42 +01:00
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
2022-12-05 18:44:24 +01:00
* Mon Dec 05 2022 Luboš Uhliarik <luhliari@redhat.com> - 3.3.4-2
- Add Early blocking feature patch again
2022-10-01 00:26:13 +02:00
* Fri Sep 30 2022 Luboš Uhliarik <luhliari@redhat.com> - 3.3.4-1
- new version 3.3.4
2022-09-07 17:46:13 +02:00
* Wed Sep 07 2022 Luboš Uhliarik <luhliari@redhat.com> - 3.3.0-6
- Fix application of early blocking patch
2022-09-01 01:47:55 +02:00
* Wed Aug 31 2022 Luboš Uhliarik <luhliari@redhat.com> - 3.3.0-5
- Backport early blocking feature
2022-07-22 01:35:43 +02:00
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
2022-01-20 21:16:57 +01:00
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
2021-07-22 17:14:57 +02:00
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
2021-03-05 16:16:22 +01:00
* Fri Mar 05 2021 Lubos Uhliarik <luhliari@redhat.com> - 3.2.0-1
- new version 3.2.0
2021-01-26 21:41:51 +01:00
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2020-07-28 10:18:40 +02:00
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
2020-01-29 14:52:26 +01:00
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2019-07-25 19:32:13 +02:00
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2019-02-01 12:18:15 +01:00
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2018-07-13 12:54:02 +02:00
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2018-02-08 04:01:57 +01:00
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2017-07-27 00:06:35 +02:00
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2017-04-22 16:16:56 +02:00
* Sat Apr 22 2017 Athmane Madjoudj <athmane@fedoraproject.org> - 3.0.0-4
- Exclude rule files should not be symlink
2017-04-22 15:54:50 +02:00
* Sat Apr 22 2017 Athmane Madjoudj <athmane@fedoraproject.org> - 3.0.0-3
- Use versioned obsoletes
- Move away from /lib since rules are data
2017-04-22 15:35:44 +02:00
* Sat Apr 22 2017 Athmane Madjoudj <athmane@fedoraproject.org> - 3.0.0-2
- Fix the install part since extra and experimental rules are not longer included in 3.x
- Remove EL5 bits since EL5/EPEL5 are OEL-ed
- Bump reqs
2017-04-22 11:29:16 +02:00
* Sat Apr 22 2017 Athmane Madjoudj <athmane@fedoraproject.org> - 3.0.0-1
- Update to 3.0.0
- Clean up the spec
2017-02-10 22:35:05 +01:00
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.9.20160414git-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2016-04-29 23:30:35 +02:00
* Fri Apr 29 2016 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.9.20160414git-1
- Update to 2.9.20160414git
2016-03-08 21:32:58 +01:00
* Tue Mar 08 2016 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.9.20160219git-1
- Update to 2.2.9
- Minor spec cleanup
2016-02-04 09:36:35 +01:00
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.8-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2015-06-17 22:53:51 +02:00
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2014-06-07 12:49:15 +02:00
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2013-08-03 13:33:37 +02:00
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2013-07-02 21:09:21 +02:00
* Tue Jul 02 2013 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.8-1
- Update to 2.2.8
- Adapt the spec file to new github tarball schema.
- Correct bugus date in the spec file.
2013-02-14 08:22:13 +01:00
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2012-11-19 22:04:59 +01:00
* Mon Nov 19 2012 Peter Vrabec <pvrabec@redhat.com> 2.2.6-4
- " e x t r a s " subpackage is not provided on RHEL7
2012-10-17 17:10:26 +02:00
* Wed Oct 17 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.6-3
- Remove the patch since we're requiring mod_security >= 2.7.0
- Require mod_security >= 2.7.0
2012-10-01 22:00:53 +02:00
* Mon Oct 01 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.6-2
- Add a patch to fix incompatible rules.
- Update to new git release
2012-09-15 17:52:33 +02:00
* Sat Sep 15 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.6-1
- Update to 2.2.6
- Update spec file since upstream moved to Github.
2012-09-13 11:31:59 +02:00
* Thu Sep 13 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.5-5
- Enable extra rules sub-package for EPEL.
2012-09-13 11:27:58 +02:00
* Tue Aug 28 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.5-4
- Fix spec for el5
* Tue Aug 28 2012 Athmane Madjoudj <athmane@fedoraproject.org> 2.2.5-3
- Add BuildRoot def for el5 compatibility
2012-07-20 04:27:40 +02:00
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2012-06-22 09:41:42 +02:00
* Fri Jun 22 2012 Peter Vrabec <pvrabec@redhat.com> 2.2.5-1
- upgrade
2012-06-20 18:02:25 +02:00
* Wed Jun 20 2012 Peter Vrabec <pvrabec@redhat.com> 2.2.4-3
- " e x t r a s " subpackage is not provided on RHEL
2013-07-02 21:09:21 +02:00
* Thu May 03 2012 Peter Vrabec <pvrabec@redhat.com> 2.2.4-2
2012-05-07 11:54:36 +02:00
- fix fedora-review issues (#816975)
* Thu Apr 19 2012 Peter Vrabec <pvrabec@redhat.com> 2.2.4-1
- initial package