diff --git a/mod_security_crs_plugin_nextcloud.spec b/mod_security_crs_plugin_nextcloud.spec new file mode 100644 index 0000000..0a5545a --- /dev/null +++ b/mod_security_crs_plugin_nextcloud.spec @@ -0,0 +1,52 @@ +%global plugin_id nextcloud +%global plugin_name %{plugin_id}-rule-exclusions + +Name: mod_security_crs_plugin_%{gsub %{plugin_id} - _} +Version: 1.2.0 +Release: 1%{?dist} +Summary: OWASP CRS Nextcloud Rule Exclusions Plugin + +License: Apache-2.0 +URL: https://github.com/coreruleset/%{plugin_name}-plugin/ +Source0: https://github.com/coreruleset/%{plugin_name}-plugin/archive/refs/tags/v%{version}.tar.gz +BuildArch: noarch +Requires: mod_security_crs > 4.2.0-2 + +%description +This plugin contains rule exclusions for Nextcloud, a productivity platform and file hosting service. +These rule exclusions are designed to resolve common false positives and allow for easier integration +with the OWASP CRS (CRS). + +%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 CONTRIBUTORS.md INSTALL +%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..c542fdb --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (v1.2.0.tar.gz) = e8fd2c347808946b5649f39b7fa4433a50e91e05dc54e6a13138407c5d75c1538dea9b38bfe0b7be9e95cc4b98969cec231524fcc860b5a5858e1b67a8e35488