浏览代码

Detect potential ssh login attacks

Bob Mottram 7 年前
父节点
当前提交
2e72583677
共有 3 个文件被更改,包括 16 次插入0 次删除
  1. 6
    0
      src/freedombone-tests
  2. 5
    0
      tests/check-ssh.sh
  3. 5
    0
      tests/output.sh

+ 6
- 0
src/freedombone-tests 查看文件

892
     output "SV-86927r2_rule" $? ${SETLANG}
892
     output "SV-86927r2_rule" $? ${SETLANG}
893
     ################
893
     ################
894
 
894
 
895
+    ##Check that pam_python is not installed
896
+    bash $STIG_TESTS_DIR/check-ssh.sh pam_python >/dev/null 2>&1 &
897
+    stig_spinner $!
898
+    output "SV-86724r2_rule" $? ${SETLANG}
899
+    ################
900
+
895
     ##RHEL-06-000247
901
     ##RHEL-06-000247
896
     ##The system clock must be synchronized continuously, or at least daily.
902
     ##The system clock must be synchronized continuously, or at least daily.
897
 
903
 

+ 5
- 0
tests/check-ssh.sh 查看文件

194
             exit 1
194
             exit 1
195
         fi
195
         fi
196
         ;;
196
         ;;
197
+    pam_python)
198
+        if grep -q 'pam_python' /etc/pam.d/sshd; then
199
+            exit 1
200
+        fi
201
+        ;;
197
 esac
202
 esac

+ 5
- 0
tests/output.sh 查看文件

119
                   printf '\n######################\n\nThis system is not intended to support graphical output\n\n######################\n\n' >> $LOG
119
                   printf '\n######################\n\nThis system is not intended to support graphical output\n\n######################\n\n' >> $LOG
120
               fi
120
               fi
121
               ;;
121
               ;;
122
+    SV-86724r2_rule) log_msg $2 'Dont allow pam_python.'
123
+              if [ $2 -ne 0 ];then
124
+                  printf '\n######################\n\npam_python within /etc/pam.d/sshd could indicate a possible attack on ssh logins.\n\n######################\n\n' >> $LOG
125
+              fi
126
+              ;;
122
     V-38455)  if [ "$3" = "en" ]; then
127
     V-38455)  if [ "$3" = "en" ]; then
123
                   log_msg $2 'The system must use a separate file system for /tmp.'
128
                   log_msg $2 'The system must use a separate file system for /tmp.'
124
               else
129
               else