Compare commits
No commits in common. "copr-test" and "main" have entirely different histories.
@ -3,7 +3,7 @@
|
|||||||
Summary: ModSecurity Core Ruleset
|
Summary: ModSecurity Core Ruleset
|
||||||
Name: mod_security_crs
|
Name: mod_security_crs
|
||||||
Version: 4.2.0
|
Version: 4.2.0
|
||||||
Release: 10%{?dist}
|
Release: 2%{?dist}
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://coreruleset.org/
|
URL: https://coreruleset.org/
|
||||||
Source: https://github.com/coreruleset/coreruleset/archive/refs/tags/v%{version}.tar.gz
|
Source: https://github.com/coreruleset/coreruleset/archive/refs/tags/v%{version}.tar.gz
|
||||||
@ -40,28 +40,22 @@ This package provides the base rules for mod_security.
|
|||||||
%post
|
%post
|
||||||
if [ $1 == 1 ]; then
|
if [ $1 == 1 ]; then
|
||||||
# activate base_rules
|
# activate base_rules
|
||||||
echo "Activate base rules"
|
|
||||||
for f in `ls %{_datarootdir}/mod_modsecurity_crs/rules/` ; do
|
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;
|
%{__ln_s} %{_datarootdir}/mod_modsecurity_crs/rules/$f %{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
||||||
done
|
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 '/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 '/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 '/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
|
%{__sed} -i '/Include modsecurity\.d\/local_rules\/\*\.conf/a\ Include modsecurity.d\/plugins\/*-after.conf' %{_httpd_confdir}/mod_security.conf
|
||||||
echo "Done"
|
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 == 0 ]; then
|
if [ $1 == 0 ]; then
|
||||||
echo "Removing from conf"
|
|
||||||
%{__sed} -i -E '/Include(Optional)? modsecurity\.d\/plugins/d' %{_httpd_confdir}/mod_security.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
|
for f in `ls %{_datarootdir}/mod_modsecurity_crs/rules/` ; do
|
||||||
%{__rm} %{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
%{__rm} %{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
||||||
done
|
done
|
||||||
echo "Done"
|
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
BIN
v4.2.0.tar.gz
BIN
v4.2.0.tar.gz
Binary file not shown.
Loading…
Reference in New Issue
Block a user