File: //opt/BCLinux/bse/secure_check/c10_sshBanner
#!/bin/sh
#=======================================================
InsertSection "check the ssh_banner"
if [ -f /etc/sshbanner ];then
#echo "exist /etc/sshbanner file, passing..."
TMP_V=`grep -w "Banner \{1,\}/etc/sshbanner" /etc/ssh/sshd_config | grep -Ev '^$|^#' | wc -l`
if [ $TMP_V -gt 0 ];then
logtext "Has sshbanner set, checking ok"
Display --indent 2 --text "- Check the sshbanner... " --result OK --color GREEN
AddHP 1 1
else
echo "c10" >> $RESULT_FILE
echo "" >> $RESULT_FILE
logtext "WRN_C10_01: $(loadtext TXT_WRN_C10_01)"
logtext "Suggestion: $(loadtext TXT_SUG_C10)"
Display --indent 2 --text "- No sshbanner config set... " --result WARNING --color RED
AddHP 0 1
fi
else
echo "c10" >> $RESULT_FILE
echo "" >> $RESULT_FILE
logtext "WRN_C10_02: The sshbanner is not set, please check the /etc/sshbanner and /etc/ssh/sshd_config"
logtext "Suggestion: $(loadtext TXT_SUG_C10)"
Display --indent 2 --text "- No sshbanner file... " --result WARNING --color RED
AddHP 0 1
fi