From cf9d2f5f356c72e7709e64564da1feed7341277c Mon Sep 17 00:00:00 2001 From: Daniel Demus Date: Sun, 14 Jul 2024 16:03:18 +0200 Subject: [PATCH] First release --- mod_security_crs_plugin_roundcube.spec | 51 ++++++++++++++++++++++++++ sources | 1 + 2 files changed, 52 insertions(+) create mode 100644 mod_security_crs_plugin_roundcube.spec create mode 100644 sources diff --git a/mod_security_crs_plugin_roundcube.spec b/mod_security_crs_plugin_roundcube.spec new file mode 100644 index 0000000..83e6807 --- /dev/null +++ b/mod_security_crs_plugin_roundcube.spec @@ -0,0 +1,51 @@ +%global plugin_id roundcube +%global plugin_name %{plugin_id}-rule-exclusions + +Name: mod_security_crs_plugin_%{gsub %{plugin_id} - _} +Version: 1.0.2 +Release: 1%{?dist} +Summary: CRS Roundcube rule exclusions plugin + +License: GPLv2 +URL: https://github.com/EsadCetiner/%{plugin_name}-plugin/ +Source0: https://github.com/EsadCetiner/%{plugin_name}-plugin//archive/refs/tags/v%{version}.tar.gz +BuildArch: noarch +Requires: mod_security_crs > 4.2.0-2 + +%description +This CRS plugin contains rule exclusions to fix false positives when using Roundcube Webmail +with the OWASP Core Rule Set. + +%prep +%setup -q -n %{plugin_name}-plugin-%{version} + +%build + +%install +%{__install} -Dm0644 plugins/%{plugin_name}-before.conf %{buildroot}%{_datarootdir}/mod_modsecurity_crs/plugins/%{plugin_id}/%{plugin_name}-before.conf +%{__install} -m0644 plugins/%{plugin_name}-config.conf %{buildroot}%{_datarootdir}/mod_modsecurity_crs/plugins/%{plugin_id}/%{plugin_name}-config.conf.example +%{__install} -Dm0644 plugins/%{plugin_name}-config.conf %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/plugins/%{plugin_name}-config.conf + +%post +if [ $1 == 1 ]; then + %{__ln_s} %{_datarootdir}/mod_modsecurity_crs/plugins/%{plugin_id}/%{plugin_name}-before.conf %{_sysconfdir}/httpd/modsecurity.d/plugins/%{plugin_name}-before.conf +fi +exit 0 + +%preun +if [ $1 == 0 ]; then + %{__rm} %{_sysconfdir}/httpd/modsecurity.d/plugins/%{plugin_name}-before.conf +fi +exit 0 + +%files +%license LICENSE +%doc README.md +%config(noreplace) %{_sysconfdir}/httpd/modsecurity.d/plugins/%{plugin_name}-config.conf +%ghost %config(noreplace) %{_sysconfdir}/httpd/modsecurity.d/plugins/%{plugin_name}-before.conf +%{_datarootdir}/mod_modsecurity_crs/plugins/%{plugin_id}/ + + +%changelog +* Sun Jul 14 2024 Daniel Demus +- First release diff --git a/sources b/sources new file mode 100644 index 0000000..cc37f8d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (v1.0.2.tar.gz) = 35457c80d954cc5d8cc61c827254f5a49c66d73fdde4e95825fa34377d0a9649d87bfececcb95b847d3d657c6217c3754e3c8982e9aefc5aa6116474aeda3b3b