Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
336d424d9c | ||
|
ce33c379d1 |
@ -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
|
||||
|
||||
|
BIN
v4.2.0.tar.gz
Normal file
BIN
v4.2.0.tar.gz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user