mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Add script to download OWASP CRS v4 to run benchmark
- Simplified clone & checkout of CRS repository - Removed no longer maintained OWASP Core Ruleset v2
This commit is contained in:
parent
6faf6d7ec0
commit
eb62cac7fa
@ -1,5 +1,3 @@
|
||||
|
||||
Include "../../modsecurity.conf-recommended"
|
||||
|
||||
Include "owasp-v3/crs-setup.conf.example"
|
||||
Include "owasp-v3/rules/*.conf"
|
||||
|
@ -1,56 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#
|
||||
|
||||
git clone https://github.com/coreruleset/coreruleset.git owasp-v2
|
||||
cd owasp-v2
|
||||
git checkout 2.2.9 -b tag2.2.9
|
||||
cd -
|
||||
|
||||
echo 'Include "owasp-v2/base_rules/*.conf"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v2/optional_rules/*.conf"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v2/experimental_rules/*.conf"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v2/slr_rules/modsecurity_crs_46_slr_et_xss_attacks.conf"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v2/slr_rules/modsecurity_crs_46_slr_et_sqli_attacks.conf"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v2/slr_rules/modsecurity_crs_46_slr_et_rfi_attacks.conf"' >> basic_rules.conf
|
||||
|
||||
|
||||
# Content injection not support in modsec v3
|
||||
rm owasp-v2/optional_rules/modsecurity_crs_43_csrf_protection.conf
|
||||
|
||||
|
||||
# Slow dos is not yet supported
|
||||
rm owasp-v2/experimental_rules/modsecurity_crs_11_slow_dos_protection.conf
|
||||
|
||||
|
||||
# WEBSERVER_ERROR_LOG is not supported in v3.
|
||||
cat owasp-v2/base_rules/modsecurity_crs_20_protocol_violations.conf | sed 's/SecRule WEBSERVER_ERROR_LOG/#SecRule WEBSERVER_ERROR_LOG/g' > owasp-v2/base_rules/modsecurity_crs_20_protocol_violations.conf.tmp
|
||||
mv owasp-v2/base_rules/modsecurity_crs_20_protocol_violations.conf.tmp owasp-v2/base_rules/modsecurity_crs_20_protocol_violations.conf
|
||||
|
||||
|
||||
# Apache specific configuration.
|
||||
cat owasp-v2/optional_rules/modsecurity_crs_49_header_tagging.conf | sed 's/RequestHeader/#RequestHeader/g' > owasp-v2/optional_rules/modsecurity_crs_49_header_tagging.conf.tmp
|
||||
mv owasp-v2/optional_rules/modsecurity_crs_49_header_tagging.conf.tmp owasp-v2/optional_rules/modsecurity_crs_49_header_tagging.conf
|
||||
|
||||
cat owasp-v2/optional_rules/modsecurity_crs_55_application_defects.conf | sed 's/Header edit/#Header edit/g' > owasp-v2/optional_rules/modsecurity_crs_55_application_defects.conf.tmp
|
||||
mv owasp-v2/optional_rules/modsecurity_crs_55_application_defects.conf.tmp owasp-v2/optional_rules/modsecurity_crs_55_application_defects.conf
|
||||
|
||||
cat owasp-v2/experimental_rules/modsecurity_crs_42_csp_enforcement.conf | sed 's/Header set/#Header set/g' > owasp-v2/experimental_rules/modsecurity_crs_42_csp_enforcement.conf.tmp
|
||||
mv owasp-v2/experimental_rules/modsecurity_crs_42_csp_enforcement.conf.tmp owasp-v2/experimental_rules/modsecurity_crs_42_csp_enforcement.conf
|
||||
|
||||
|
||||
# Disables SecGeoLookupDb
|
||||
cat owasp-v2/experimental_rules/modsecurity_crs_61_ip_forensics.conf | sed 's/SecGeoLookupDb/#SecGeoLookupDb/g' > owasp-v2/experimental_rules/modsecurity_crs_61_ip_forensics.conf.tmp
|
||||
mv owasp-v2/experimental_rules/modsecurity_crs_61_ip_forensics.conf.tmp owasp-v2/experimental_rules/modsecurity_crs_61_ip_forensics.conf
|
||||
|
||||
cat owasp-v2/experimental_rules/modsecurity_crs_11_proxy_abuse.conf | sed 's/SecGeoLookupDb/#SecGeoLookupDb/g' > owasp-v2/experimental_rules/modsecurity_crs_11_proxy_abuse.conf.tmp
|
||||
mv owasp-v2/experimental_rules/modsecurity_crs_11_proxy_abuse.conf.tmp owasp-v2/experimental_rules/modsecurity_crs_11_proxy_abuse.conf
|
||||
|
||||
|
||||
# STREAM_OUTPUT_BODY is not supported
|
||||
cat owasp-v2/experimental_rules/modsecurity_crs_40_appsensor_detection_point_2.9_honeytrap.conf | sed 's/SecRule STREAM_OUTPUT_BODY/#SecRule STREAM_OUTPUT_BODY/g' > owasp-v2/experimental_rules/modsecurity_crs_40_appsensor_detection_point_2.9_honeytrap.conf.tmp
|
||||
mv owasp-v2/experimental_rules/modsecurity_crs_40_appsensor_detection_point_2.9_honeytrap.conf.tmp owasp-v2/experimental_rules/modsecurity_crs_40_appsensor_detection_point_2.9_honeytrap.conf
|
||||
|
||||
|
||||
echo "Done."
|
||||
|
@ -1,10 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
git clone https://github.com/coreruleset/coreruleset.git owasp-v3
|
||||
cd owasp-v3
|
||||
git checkout v3.0.2 -b tag3.0.2
|
||||
cd -
|
||||
git clone -c advice.detachedHead=false --depth 1 --branch v3.0.2 https://github.com/coreruleset/coreruleset.git owasp-v3
|
||||
|
||||
echo 'Include "owasp-v3/crs-setup.conf.example"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v3/rules/*.conf"' >> basic_rules.conf
|
||||
|
9
test/benchmark/download-owasp-v4-rules.sh
Executable file
9
test/benchmark/download-owasp-v4-rules.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
git clone -c advice.detachedHead=false --depth 1 --branch v4.3.0 https://github.com/coreruleset/coreruleset.git owasp-v4
|
||||
|
||||
echo 'Include "owasp-v4/crs-setup.conf.example"' >> basic_rules.conf
|
||||
echo 'Include "owasp-v4/rules/*.conf"' >> basic_rules.conf
|
||||
|
||||
echo "Done."
|
||||
|
Loading…
x
Reference in New Issue
Block a user