HEX
Server: nginx/1.16.1
System: Linux ecs-04358622 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64
User: nginx (994)
PHP: 8.0.0
Disabled: NONE
Upload Files
File: //opt/BCLinux/bse/secure_check/c51_sshdLogLevel
#!/bin/sh

#=======================================================
InsertSection "check the ssh loglevel"


#-----------------Check the Loglevel to VERBOSE----------------
IS_EXIST=`egrep -v '^#|^$' /etc/ssh/sshd_config | grep 'LogLevel' | wc -l`
if [ ${IS_EXIST} -eq 0 ] ; then
    #echo "  " >> /etc/ssh/sshd_config
    #echo "Loglevel VERBOSE" >> /etc/ssh/sshd_config
    echo "c51" >> $RESULT_FILE
    echo "" >> $RESULT_FILE
    logtext "WRN_C51_01: $(loadtext TXT_WRN_C51_01)"
    logtext "Suggestion: $(loadtext TXT_SUG_C51)"
    Display --indent 2 --text "- No ssh loglevel config set... " --result WARNING --color RED
    AddHP 0 1
else
    if [  $(egrep -v '^#|^$' /etc/ssh/sshd_config | grep 'LogLevel' | grep -w 'VERBOSE' | wc -l) -eq 0 ];then
        echo "c51" >> $RESULT_FILE
        echo "" >> $RESULT_FILE
   	logtext "WRN_C51_02: $(loadtext TXT_WRN_C51_02)"
    	logtext "Suggestion: $(loadtext TXT_SUG_C51)"
    	Display --indent 2 --text "- Wrong ssh loglevel config set... " --result WARNING --color RED
    	AddHP 0 1
    else
        logtext "Has ssh loglevel set, checking ok"
        Display --indent 2 --text "- Check the ssh loglevel... " --result OK --color GREEN
        AddHP 1 1
    fi
fi