|
|
@ -4,11 +4,22 @@ OWASP_DIR="${LSDIR}/conf/owasp"
|
|
|
|
RULE_FILE='modsec_includes.conf'
|
|
|
|
RULE_FILE='modsec_includes.conf'
|
|
|
|
LS_HTTPD_CONF="${LSDIR}/conf/httpd_config.xml"
|
|
|
|
LS_HTTPD_CONF="${LSDIR}/conf/httpd_config.xml"
|
|
|
|
OLS_HTTPD_CONF="${LSDIR}/conf/httpd_config.conf"
|
|
|
|
OLS_HTTPD_CONF="${LSDIR}/conf/httpd_config.conf"
|
|
|
|
|
|
|
|
EPACE=' '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echow(){
|
|
|
|
|
|
|
|
FLAG=${1}
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
echo -e "\033[1m${EPACE}${FLAG}\033[0m${@}"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
help_message(){
|
|
|
|
help_message(){
|
|
|
|
echo 'Command [-enable|-disable]'
|
|
|
|
echo -e "\033[1mOPTIONS\033[0m"
|
|
|
|
echo 'Example: owaspctl.sh -enable'
|
|
|
|
echow '-E, --enable'
|
|
|
|
echo 'Enable mod_secure module with latest OWASP version of rules'
|
|
|
|
echo "${EPACE}${EPACE}Will Enable mod_secure module with latest OWASP version of rules"
|
|
|
|
|
|
|
|
echow '-D, --disable'
|
|
|
|
|
|
|
|
echo "${EPACE}${EPACE}Will Disable mod_secure module with latest OWASP version of rules"
|
|
|
|
|
|
|
|
echow '-H, --help'
|
|
|
|
|
|
|
|
echo "${EPACE}${EPACE}Display help and exit."
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -118,6 +129,7 @@ disable_ls_modesec(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
disable_modsec(){
|
|
|
|
disable_modsec(){
|
|
|
|
|
|
|
|
check_lsv
|
|
|
|
if [ "${LSV}" = 'lsws' ]; then
|
|
|
|
if [ "${LSV}" = 'lsws' ]; then
|
|
|
|
disable_ls_modesec
|
|
|
|
disable_ls_modesec
|
|
|
|
elif [ "${LSV}" = 'openlitespeed' ]; then
|
|
|
|
elif [ "${LSV}" = 'openlitespeed' ]; then
|
|
|
@ -195,6 +207,8 @@ main_owasp(){
|
|
|
|
install_git
|
|
|
|
install_git
|
|
|
|
install_owasp
|
|
|
|
install_owasp
|
|
|
|
configure_owasp
|
|
|
|
configure_owasp
|
|
|
|
|
|
|
|
check_lsv
|
|
|
|
|
|
|
|
enable_modsec
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
check_input ${1}
|
|
|
|
check_input ${1}
|
|
|
@ -203,13 +217,10 @@ while [ ! -z "${1}" ]; do
|
|
|
|
-[hH] | -help | --help)
|
|
|
|
-[hH] | -help | --help)
|
|
|
|
help_message
|
|
|
|
help_message
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
-enable | -e | -E)
|
|
|
|
-[eE] | -enable | --enable)
|
|
|
|
main_owasp
|
|
|
|
main_owasp
|
|
|
|
check_lsv
|
|
|
|
|
|
|
|
enable_modsec
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
-disable | -d | -D)
|
|
|
|
-[dD] | -disable | --disable)
|
|
|
|
check_lsv
|
|
|
|
|
|
|
|
disable_modsec
|
|
|
|
disable_modsec
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
*)
|
|
|
|