From 336d424d9c441c7bdcaa6b55a884f65d3bfad874 Mon Sep 17 00:00:00 2001 From: Daniel Demus Date: Mon, 15 Jul 2024 16:18:27 +0200 Subject: [PATCH] Debug --- mod_security_crs.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mod_security_crs.spec b/mod_security_crs.spec index cc82bd9..287ba62 100644 --- a/mod_security_crs.spec +++ b/mod_security_crs.spec @@ -3,7 +3,7 @@ Summary: ModSecurity Core Ruleset Name: mod_security_crs Version: 4.2.0 -Release: 2%{?dist} +Release: 10%{?dist} License: Apache-2.0 URL: https://coreruleset.org/ Source: https://github.com/coreruleset/coreruleset/archive/refs/tags/v%{version}.tar.gz @@ -40,22 +40,28 @@ This package provides the base rules for mod_security. %post if [ $1 == 1 ]; then # activate base_rules + echo "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 + echo "Adding to conf" %{__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 + echo "Done" fi exit 0 %preun if [ $1 == 0 ]; then + echo "Removing from conf" %{__sed} -i -E '/Include(Optional)? modsecurity\.d\/plugins/d' %{_httpd_confdir}/mod_security.conf + echo "Deactivate base rules" for f in `ls %{_datarootdir}/mod_modsecurity_crs/rules/` ; do %{__rm} %{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f; done + echo "Done" fi exit 0