From 59acacfdbb975ae8b2a1cad5998202d0cefe91b7 Mon Sep 17 00:00:00 2001 From: Daniel Demus Date: Sun, 14 Jul 2024 13:13:27 +0200 Subject: [PATCH] First release --- mod_security_crs_plugin_gitea_proxy.spec | 51 ++++++++++++++++++++++++ sources | 1 + 2 files changed, 52 insertions(+) create mode 100644 mod_security_crs_plugin_gitea_proxy.spec create mode 100644 sources diff --git a/mod_security_crs_plugin_gitea_proxy.spec b/mod_security_crs_plugin_gitea_proxy.spec new file mode 100644 index 0000000..f48cc6d --- /dev/null +++ b/mod_security_crs_plugin_gitea_proxy.spec @@ -0,0 +1,51 @@ +%global plugin_id gitea-proxy +%global plugin_name %{plugin_id}-rule-exclusions + +Name: mod_security_crs_plugin_%{gsub %{plugin_id} - _} +Version: 1.0.0 +Release: 1%{?dist} +Summary: CRS Gitea proxy rule exclusions plugin + +License: Apache-2.0 +URL: https://git.demus.dk/demus/%{plugin_name}-plugin/ +Source0: https://git.demus.dk/demus/%{plugin_name}-plugin/archive/%{version}.tar.gz +BuildArch: noarch +Requires: mod_security_crs > 4.2.0-2 + +%description +This CRS plugin contains rule exclusions for proxying an external address to a local +Gitea instance, a git devops platform, so it can be run together with OWASP CRS (CRS). + +%prep +%setup -q -n %{plugin_name}-plugin + +%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..125405e --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (1.0.0.tar.gz) = b38ccdb80b478670f6f0971fe0b6263305dd9f8e97476afdcacacf705766fa6b5465e977531b77319e4f0251f3e1487a9379d0629f5bfa0132380b2030747cfb