Преглед на файлове

Security Technical Implementation Guide tests based upon RHEL/hardenedlinux

Bob Mottram преди 8 години
родител
ревизия
1f0ac1f3ce
променени са 54 файла, в които са добавени 4899 реда и са изтрити 0 реда
  1. 1358
    0
      src/freedombone-tests
  2. 27
    0
      tests/check-aide-baseline.sh
  3. 5
    0
      tests/check-aide-cron.sh
  4. 5
    0
      tests/check-apt-gpg.sh
  5. 100
    0
      tests/check-apt-key.sh
  6. 9
    0
      tests/check-audisp.sh
  7. 112
    0
      tests/check-auditd-package.sh
  8. 153
    0
      tests/check-auditd.sh
  9. 9
    0
      tests/check-bluetooth.sh
  10. 62
    0
      tests/check-cmd-mode.sh
  11. 62
    0
      tests/check-cmd-owner.sh
  12. 21
    0
      tests/check-consoles.sh
  13. 9
    0
      tests/check-ctrl-alt-del.sh
  14. 11
    0
      tests/check-default-account.sh
  15. 30
    0
      tests/check-depends.sh
  16. 5
    0
      tests/check-gids.sh
  17. 98
    0
      tests/check-grub-mode.sh
  18. 9
    0
      tests/check-inactive.sh
  19. 6
    0
      tests/check-ipv6-enable.sh
  20. 42
    0
      tests/check-libs-mode.sh
  21. 43
    0
      tests/check-libs-owner.sh
  22. 21
    0
      tests/check-limits.sh
  23. 21
    0
      tests/check-login-defs.sh
  24. 5
    0
      tests/check-logrotate.sh
  25. 16
    0
      tests/check-mode.sh
  26. 17
    0
      tests/check-netrc.sh
  27. 5
    0
      tests/check-nfs-all-squash.sh
  28. 5
    0
      tests/check-nfs-insecure.sh
  29. 14
    0
      tests/check-nfs.sh
  30. 9
    0
      tests/check-ntp-sources.sh
  31. 19
    0
      tests/check-package-up2date.sh
  32. 44
    0
      tests/check-packages.sh
  33. 15
    0
      tests/check-password-max-day.sh
  34. 15
    0
      tests/check-password-min-day.sh
  35. 15
    0
      tests/check-password-min-len.sh
  36. 15
    0
      tests/check-password-warn-age.sh
  37. 30
    0
      tests/check-password.sh
  38. 5
    0
      tests/check-postfix.sh
  39. 5
    0
      tests/check-public-dir-owned.sh
  40. 15
    0
      tests/check-removable.sh
  41. 23
    0
      tests/check-rhosts.sh
  42. 11
    0
      tests/check-root-uid.sh
  43. 37
    0
      tests/check-rsyslog.sh
  44. 79
    0
      tests/check-services.sh
  45. 12
    0
      tests/check-ssh-ciphers.sh
  46. 33
    0
      tests/check-ssh.sh
  47. 5
    0
      tests/check-sticky-bit.sh
  48. 7
    0
      tests/check-sudo.sh
  49. 8
    0
      tests/check-sysctl.sh
  50. 5
    0
      tests/check-uniq-names.sh
  51. 5
    0
      tests/check-world-writable.sh
  52. 2016
    0
      tests/output.sh
  53. 164
    0
      tests/porting_log
  54. 27
    0
      tests/undone_log

+ 1358
- 0
src/freedombone-tests
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 27
- 0
tests/check-aide-baseline.sh Целия файл

@@ -0,0 +1,27 @@
1
+#!/bin/bash
2
+#Tested on Aide 0.16a2-19-g16ed855
3
+
4
+CHECKDATABASE=$(grep "database=" /etc/aide/aide.conf  2>/dev/null )
5
+if [ $? -eq 0 ];then
6
+        :
7
+else 
8
+        echo "couldn""'""t found aide.conf"
9
+        exit 1
10
+fi
11
+
12
+DATABASE=$(echo $CHECKDATABASE | awk -F ':' '{printf $2}' 2>/dev/null)
13
+
14
+if [ $? -eq 0 ];then
15
+        :
16
+else 
17
+        echo "couldn""'""t found database location at aide.conf"
18
+        exit 1
19
+fi
20
+
21
+if [ -f "$DATABASE" ];then
22
+        echo "There is a baseline for aide."
23
+	exit 0
24
+else
25
+        echo "Can""'""t find aide baseline"
26
+	exit 1
27
+fi

+ 5
- 0
tests/check-aide-cron.sh Целия файл

@@ -0,0 +1,5 @@
1
+#1/bin/bash
2
+
3
+if [ $(grep aide /etc/crontab /etc/cron.*/* | wc -l) -ne 0 ];then
4
+        exit 1
5
+fi

+ 5
- 0
tests/check-apt-gpg.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if grep -i "gpg" /etc/apt/apt.conf.d/* | sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' | grep -i "gpg.*check.*false";then
4
+        exit 1
5
+fi

+ 100
- 0
tests/check-apt-key.sh Целия файл

@@ -0,0 +1,100 @@
1
+#!/bin/bash
2
+#Verify with the key fatch from https://ftp-master.debian.org/keys.html
3
+
4
+#---------------------------------------------------------------------------
5
+#"Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>"
6
+
7
+JESSIEARCHIVEKEY=" 126C 0D24 BD8A 2942 CC7D  F8AC 7638 D044 2B90 D010"
8
+CHECKTMP=$(apt-key finger | grep -B 1 "Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
9
+
10
+if [ "$CHECKTMP" == "$JESSIEARCHIVEKEY" ];then
11
+       echo Good
12
+       :
13
+else
14
+       echo bad
15
+       exit 1
16
+fi
17
+
18
+#---------------------------------------------------------------------------
19
+#"Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>"
20
+
21
+JESSIESECURITYKEY=" D211 6914 1CEC D440 F2EB  8DDA 9D6D 8F6B C857 C906"
22
+CHECKTMP=$(apt-key finger | grep -B 1 "Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
23
+
24
+if [ "$CHECKTMP" == "$JESSIESECURITYKEY" ];then
25
+       echo Good
26
+       :
27
+else
28
+       echo bad
29
+       exit 1
30
+fi
31
+
32
+#---------------------------------------------------------------------------
33
+#"Jessie Stable Release Key <debian-release@lists.debian.org>"
34
+
35
+JESSIESTABLEKEY=" 75DD C3C4 A499 F1A1 8CB5  F3C8 CBF8 D6FD 518E 17E1"
36
+CHECKTMP=$(apt-key finger | grep -B 1 "Jessie Stable Release Key <debian-release@lists.debian.org>" | head -n1 | awk -F '=' '{printf $2}')
37
+
38
+if [ "$CHECKTMP" == "$JESSIESTABLEKEY" ];then
39
+       echo Good
40
+       :
41
+else
42
+       echo bad
43
+       exit 1
44
+fi
45
+
46
+#---------------------------------------------------------------------------
47
+#"Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>"
48
+
49
+SQUEEZEARCHIVEKEY=" 9FED 2BCB DCD2 9CDF 7626  78CB AED4 B06F 4730 41FA"
50
+CHECKTMP=$(apt-key finger | grep -B 1 "Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
51
+
52
+if [ "$CHECKTMP" == "$SQUEEZEARCHIVEKEY" ];then
53
+       echo Good
54
+       :
55
+else
56
+       echo bad
57
+       exit 1
58
+fi
59
+
60
+#---------------------------------------------------------------------------
61
+#"Squeeze Stable Release Key <debian-release@lists.debian.org>"
62
+
63
+SQUEEZESTABLEKEY=" 0E4E DE2C 7F3E 1FC0 D033  800E 6448 1591 B983 21F9"
64
+CHECKTMP=$(apt-key finger | grep -B 1 "Squeeze Stable Release Key <debian-release@lists.debian.org>" | head -n1 | awk -F '=' '{printf $2}')
65
+
66
+if [ "$CHECKTMP" == "$SQUEEZESTABLEKEY" ];then
67
+       echo Good
68
+       :
69
+else
70
+       echo bad
71
+       exit 1
72
+fi
73
+
74
+#---------------------------------------------------------------------------
75
+#"Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>"
76
+
77
+WHEEZYARCHIVEKEY=" A1BD 8E9D 78F7 FE5C 3E65  D8AF 8B48 AD62 4692 5553"
78
+CHECKTMP=$(apt-key finger | grep -B 1 "Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>" | head -n1 | awk -F '=' '{printf $2}')
79
+
80
+if [ "$CHECKTMP" == "$WHEEZYARCHIVEKEY" ];then
81
+       echo Good
82
+       :
83
+else
84
+       echo bad
85
+       exit 1
86
+fi
87
+
88
+#---------------------------------------------------------------------------
89
+#"Wheezy Stable Release Key <debian-release@lists.debian.org>"
90
+
91
+WHEEZYSTABLEKEY=" ED6D 6527 1AAC F0FF 15D1  2303 6FB2 A1C2 65FF B764"
92
+CHECKTMP=$(apt-key finger | grep -B 1 "Wheezy Stable Release Key <debian-release@lists.debian.org>" | head -n1 | awk -F '=' '{printf $2}')
93
+
94
+if [ "$CHECKTMP" == "$WHEEZYSTABLEKEY" ];then
95
+       echo Good
96
+       :
97
+else
98
+       echo bad
99
+       exit 1
100
+fi

+ 9
- 0
tests/check-audisp.sh Целия файл

@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
+
3
+if dpkg -s audispd-plugins > /dev/null 2>&1;then
4
+        if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audisp/plugins.d/syslog.conf | grep -i "active.*yes";then
5
+                exit 1
6
+        fi       
7
+else
8
+        exit 1
9
+fi

+ 112
- 0
tests/check-auditd-package.sh Целия файл

@@ -0,0 +1,112 @@
1
+#!/bin/bash
2
+#The hole idea of how to get the origin files' permission is learned from http://sysadminnotebook.blogspot.com/2012/06/how-to-reset-folder-permissions-to.html
3
+
4
+TDIR=`mktemp -d`
5
+cd $TDIR
6
+aptitude download auditd
7
+FILES=`dpkg -c auditd*.deb | sed -e '/^d/d' | \
8
+       sed '/audit.rules$/p;s/\/etc\/audit\/rules.d\/audit.rules$/\/etc\/audit\/audit.rules/'`
9
+DIRECTORY=`dpkg -c auditd*.deb | sed -n '/^d/p' | \
10
+          sed -e '/\/usr\/share\/man/d'`
11
+case $1 in
12
+        permission)
13
+                echo "$FILES" | while read FILE;
14
+                do
15
+                        echo "$FILE" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
16
+                        do
17
+                                ORIGIN=$(echo "$FILE" | awk '{print $1}')
18
+                                CURRENT=$(ls -l "$line" | awk '{print $1}')
19
+                                if [ "$CURRENT" != "$ORIGIN" ];then
20
+                                        echo "ORIGIN:$FILE"
21
+                                        echo "CURRENT:$(ls -l $line)"
22
+                                        exit 1
23
+                                fi
24
+                        done
25
+                done
26
+                echo "$DIRECTORY" | while read DIR;
27
+                do
28
+                        echo "$DIR" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
29
+                        do
30
+                                ORIGIN=$(echo "$DIR" | awk '{print $1}' )
31
+                                CURRENT=$(ls -dl "$line" | awk '{print $1}' )
32
+                                if [ "$CURRENT" != "$ORIGIN" ];then
33
+                                        echo "$ORIGIN:$DIR"
34
+                                        echo "$CURRENT:$(ls -dl $line)"
35
+                                        exit 1
36
+                                fi
37
+                        done
38
+                done
39
+        ;;
40
+        owner)
41
+                echo "$FILES" | while read FILE;
42
+                do
43
+                        echo "$FILE" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
44
+                        do
45
+                                ORIGIN=$(echo "$FILE" | awk '{print $2}' | awk -F '/' '{print $1}')
46
+                                CURRENT=$(ls -l "$line" | awk '{print $3}')
47
+                                if [ "$CURRENT" != "$ORIGIN" ];then
48
+                                        echo "ORIGIN:$FILE"
49
+                                        echo "CURRENT:$(ls -l $line)"
50
+                                        exit 1
51
+                                fi
52
+                        done
53
+                done
54
+                echo "$DIRECTORY" | while read DIR;
55
+                do
56
+                        echo "$DIR" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
57
+                        do
58
+                                ORIGIN=$(echo "$DIR" | awk '{print $2}' | awk -F '/' '{print $1}' )
59
+                                CURRENT=$(ls -dl "$line" | awk '{print $3}' )
60
+                                if [ "$CURRENT" != "$ORIGIN" ];then
61
+                                        echo "$ORIGIN:$DIR"
62
+                                        echo "$CURRENT:$(ls -dl $line)"
63
+                                        exit 1
64
+                                fi
65
+                        done
66
+                done
67
+        ;;
68
+        group-owner)
69
+                echo "$FILES" | while read FILE;
70
+                do
71
+                        echo "$FILE" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
72
+                        do
73
+                                ORIGIN=$(echo "$FILE" | awk '{print $2}' | awk -F '/' '{print $2}')
74
+                                CURRENT=$(ls -l "$line" | awk '{print $4}')
75
+                                if [ "$CURRENT" != "$ORIGIN" ];then
76
+                                        echo "ORIGIN:$FILE"
77
+                                        echo "CURRENT:$(ls -l $line)"
78
+                                        exit 1
79
+                                fi
80
+                        done
81
+                done
82
+                echo "$DIRECTORY" | while read DIR;
83
+                do
84
+                        echo "$DIR" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
85
+                        do
86
+                                ORIGIN=$(echo "$DIR" | awk '{print $2}' | awk -F '/' '{print $2}' )
87
+                                CURRENT=$(ls -dl "$line" | awk '{print $4}' )
88
+                                if [ "$CURRENT" != "$ORIGIN" ];then
89
+                                        echo "$ORIGIN:$DIR"
90
+                                        echo "$CURRENT:$(ls -dl $line)"
91
+                                        exit 1
92
+                                fi
93
+                        done
94
+                done
95
+        ;;
96
+        file-hashes)
97
+                dpkg-deb -R audit*.deb .
98
+                echo "$FILES" | grep "bin/" | while read FILE;
99
+                do
100
+                        echo "$FILE" | awk '{print $6}' | sed -e 's/^.//g' | while read line;
101
+                        do
102
+                                ORIGIN=$(sha512sum "$(echo "$line" | sed -e 's/^.\///g')" | awk '{print $1}')
103
+                                CURRENT=$(sha512sum "$line" | awk '{print $1}')
104
+                                if [ "$CURRENT" != "$ORIGIN" ];then
105
+                                        echo "ORIGIN:$FILE"
106
+                                        echo "CURRENT:$(ls -l $line)"
107
+                                        exit 1
108
+                                fi
109
+                        done
110
+                done
111
+        ;;
112
+esac

+ 153
- 0
tests/check-auditd.sh Целия файл

@@ -0,0 +1,153 @@
1
+#!/bin/bash
2
+
3
+case $1 in
4
+        space_left_action)
5
+                EXIST=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1)
6
+                if [ $? -eq 0 ];then
7
+                        ACTION=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1 | awk -F '=' '{print $2}')
8
+                        if [ "${ACTION,,}" != "email" ];then
9
+                            exit 1
10
+                        fi
11
+                else
12
+                        exit 1
13
+                fi
14
+        ;;
15
+        num_logs)
16
+                EXIST=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1)
17
+                if [ $? -eq 0 ];then
18
+                        if [ $(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1 | awk -F '=' '{print $2}') -$2 $3 ];then
19
+                            exit 1
20
+                        fi
21
+                else
22
+                        exit 1
23
+                fi
24
+        ;;
25
+        max_log_file)
26
+                EXIST=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1=)
27
+                if [ $? -eq 0 ];then
28
+                        if [ $(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1= | awk -F '=' '{print $2}') -$2 $3 ];then
29
+                            exit 1
30
+                        fi
31
+                else
32
+                        exit 1
33
+                fi
34
+        ;;
35
+        max_log_file_action)
36
+                EXIST=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1)
37
+                if [ $? -eq 0 ];then
38
+                        ACTION=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1 | awk -F '=' '{print $2}')
39
+                        if [ "${ACTION,,}" != "rotate" ];then
40
+                            exit 1
41
+                        fi
42
+                else
43
+                        exit 1
44
+                fi
45
+        ;;
46
+        admin_space_left_action)
47
+                EXIST=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1)
48
+                if [ $? -eq 0 ];then
49
+                        ACTION=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1 | awk -F '=' '{print $2}')
50
+                        if [ "${ACTION,,}" != "single" ];then
51
+                            exit 1
52
+                        fi
53
+                else
54
+                        exit 1
55
+                fi
56
+        ;;
57
+        account)
58
+                if ! auditctl -l | grep "/etc/passwd" ;then
59
+                        exit 1
60
+                elif ! auditctl -l | grep "/etc/shadow";then
61
+                        exit 1
62
+                elif ! auditctl -l | grep "/etc/group";then
63
+                        exit 1
64
+                elif ! auditctl -l | grep "/etc/gshadow";then
65
+                        exit 1
66
+                elif ! auditctl -l | grep "/etc/security/opasswd";then
67
+                        exit 1
68
+                fi
69
+        ;;
70
+        network)
71
+                if ! auditctl -l | grep "sethostname" ;then
72
+                        exit 1
73
+                elif ! auditctl -l | grep "setdomainname";then
74
+                        exit 1
75
+                elif ! auditctl -l | grep "/etc/issue.net";then
76
+                        exit 1
77
+                elif ! auditctl -l | grep "/etc/hosts";then
78
+                        exit 1
79
+                elif ! auditctl -l | grep "/etc/sysconfig";then
80
+                        exit 1
81
+                elif ! auditctl -l | grep "network";then
82
+                        exit 1
83
+                fi
84
+        ;;
85
+        apparmor-config)
86
+                if ! auditctl -l | grep "/etc/apparmor/" ;then
87
+                        exit 1
88
+                elif ! auditctl -l | grep "/etc/apparmor.d/";then
89
+                        exit 1
90
+                fi
91
+        ;;
92
+        failed-access-files-programs)
93
+                if ! auditctl -l | grep "EACCES" ;then
94
+                        exit 1
95
+                elif ! auditctl -l | grep "EPERM";then
96
+                        exit 1
97
+                fi
98
+        ;;
99
+        setuid-setgid)
100
+                find / -xdev -type f -perm /6000 2>/dev/null | while read line;do
101
+                        if ! auditctl -l | grep "$line" ;then
102
+                                exit 1
103
+                        fi
104
+                done
105
+        ;;
106
+        deletions)
107
+                if ! auditctl -l | grep "rmdir" ;then
108
+                        exit 1
109
+                elif ! auditctl -l | grep "unlink";then
110
+                        exit 1
111
+                elif ! auditctl -l | grep "unlinkat";then
112
+                        exit 1
113
+                elif ! auditctl -l | grep "rename";then
114
+                        exit 1
115
+                elif ! auditctl -l | grep "renameat";then
116
+                        exit 1
117
+                fi
118
+        ;;
119
+        kernel-modules)
120
+                if ! auditctl -l | egrep -e "(-w |-F path=)/sbin/insmod";then
121
+                        exit 1
122
+                elif ! auditctl -l | egrep -e "(-w |-F path=)/sbin/rmmod";then
123
+                        exit 1
124
+                elif ! auditctl -l | egrep -e "(-w |-F path=)/sbin/modprobe";then
125
+                        exit 1
126
+                elif ! auditctl -l | grep -w "init_module";then
127
+                        exit 1
128
+                elif ! auditctl -l | grep -w "delete_module";then
129
+                        exit 1
130
+                fi
131
+        ;;
132
+        action_mail_acct)
133
+                EXIST=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1)
134
+                if [ $? -eq 0 ];then
135
+                        ACCOUNT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/audit/auditd.conf | sed -e 's/\ //'g | grep $1 | awk -F '=' '{print $2}')
136
+                        if [ "${ACCOUNT,,}" != "root" ];then
137
+                            exit 1
138
+                        fi
139
+                else
140
+                        exit 1
141
+                fi
142
+        ;;
143
+        disk_full_action)
144
+                if grep -i "disk_full_action.*ignore\|disk_full_action.*suspend" /etc/audit/auditd.conf;then
145
+                        exit 1
146
+                fi
147
+        ;;
148
+        disk_error_action)
149
+                if grep -i "disk_error_action.*ignore\|disk_error_action.*suspend" /etc/audit/auditd.conf;then
150
+                        exit 1
151
+                fi
152
+        ;;
153
+esac

+ 9
- 0
tests/check-bluetooth.sh Целия файл

@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
+
3
+if grep -r bluetooth /etc/modprobe.d;then
4
+        if ! grep -r net-pf-31 /etc/modprobe.d;then
5
+                exit 1
6
+        fi
7
+else
8
+        exit 1
9
+fi

+ 62
- 0
tests/check-cmd-mode.sh Целия файл

@@ -0,0 +1,62 @@
1
+#!/bin/bash
2
+
3
+if [ -d "/bin" ];then
4
+
5
+        COUNT=$(find -L /bin  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
6
+
7
+        if [ $COUNT -eq 0 ];then
8
+                :
9
+        else
10
+                exit 1
11
+        fi
12
+fi
13
+if [ -d "/usr/bin" ];then
14
+
15
+        COUNT=$(find -L /usr/bin  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
16
+
17
+        if [ $COUNT -eq 0 ];then
18
+                :
19
+        else
20
+                exit 1
21
+        fi
22
+fi
23
+if [ -d "/usr/local/bin" ];then
24
+
25
+        COUNT=$(find -L /usr/local/bin  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
26
+
27
+        if [ $COUNT -eq 0 ];then
28
+                :
29
+        else
30
+                exit 1
31
+        fi
32
+fi
33
+if [ -d "/sbin" ];then
34
+
35
+        COUNT=$(find -L /sbin  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
36
+
37
+        if [ $COUNT -eq 0 ];then
38
+                :
39
+        else
40
+                exit 1
41
+        fi
42
+fi
43
+if [ -d "/usr/sbin" ];then
44
+
45
+        COUNT=$(find -L /usr/sbin  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
46
+
47
+        if [ $COUNT -eq 0 ];then
48
+                :
49
+        else
50
+                exit 1
51
+        fi
52
+fi
53
+if [ -d "/usr/local/sbin" ];then
54
+
55
+        COUNT=$(find -L /usr/local/sbin  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
56
+
57
+        if [ $COUNT -eq 0 ];then
58
+                :
59
+        else
60
+                exit 1
61
+        fi
62
+fi

+ 62
- 0
tests/check-cmd-owner.sh Целия файл

@@ -0,0 +1,62 @@
1
+#!/bin/bash
2
+
3
+if [ -d "/bin" ];then
4
+
5
+        COUNT=$(find -L /bin  \! -user root  -exec ls -l {} \; |wc -l)
6
+
7
+        if [ $COUNT -eq 0 ];then
8
+                :
9
+        else
10
+                exit 1
11
+        fi
12
+fi
13
+if [ -d "/usr/bin" ];then
14
+
15
+        COUNT=$(find -L /usr/bin  \! -user root  -exec ls -l {} \; |wc -l)
16
+
17
+        if [ $COUNT -eq 0 ];then
18
+                :
19
+        else
20
+                exit 1
21
+        fi
22
+fi
23
+if [ -d "/usr/local/bin" ];then
24
+
25
+        COUNT=$(find -L /usr/local/bin  \! -user root  -exec ls -l {} \; |wc -l)
26
+
27
+        if [ $COUNT -eq 0 ];then
28
+                :
29
+        else
30
+                exit 1
31
+        fi
32
+fi
33
+if [ -d "/sbin" ];then
34
+
35
+        COUNT=$(find -L /sbin  \! -user root  -exec ls -l {} \; |wc -l)
36
+
37
+        if [ $COUNT -eq 0 ];then
38
+                :
39
+        else
40
+                exit 1
41
+        fi
42
+fi
43
+if [ -d "/usr/sbin" ];then
44
+
45
+        COUNT=$(find -L /usr/sbin  \! -user root  -exec ls -l {} \; |wc -l)
46
+
47
+        if [ $COUNT -eq 0 ];then
48
+                :
49
+        else
50
+                exit 1
51
+        fi
52
+fi
53
+if [ -d "/usr/local/sbin" ];then
54
+
55
+        COUNT=$(find -L /usr/local/sbin  \! -user root  -exec ls -l {} \; |wc -l)
56
+
57
+        if [ $COUNT -eq 0 ];then
58
+                :
59
+        else
60
+                exit 1
61
+        fi
62
+fi

+ 21
- 0
tests/check-consoles.sh Целия файл

@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+case $1 in
3
+        virtual)
4
+                if [ -f /etc/securetty ];then
5
+                        if grep '^vc/[0-9]' /etc/securetty;then
6
+                                exit 1
7
+                        fi
8
+                else
9
+                        exit 0
10
+                fi
11
+        ;;
12
+        serial)
13
+                if [ -f "/etc/securetty" ];then
14
+                        if grep '^ttyS[0-9]' /etc/securetty;then
15
+                                exit 1
16
+                        fi
17
+                else
18
+                        exit 0
19
+                fi
20
+        ;;
21
+esac

+ 9
- 0
tests/check-ctrl-alt-del.sh Целия файл

@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
+
3
+if [ -f /etc/systemd/system/ctrl-alt-del.target ];then
4
+        if ! ls -l /etc/systemd/system/ctrl-alt-del.target | grep "/dev/null";then
5
+                exit 1
6
+        fi
7
+else
8
+        exit 1
9
+fi

+ 11
- 0
tests/check-default-account.sh Целия файл

@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+echo $(awk -F: '$1 !~ /^root$/ && $2 !~ /^[!*]/ {print $1 ":" $2}' /etc/shadow | awk -F ':' '{printf $1}' )| while read ACCOUNT
3
+do      
4
+        awk -F':' '{ if ( $3 <= 500 ) print $1 }' /etc/passwd | sed '/^root$/d' | while read ACCOUNTLIST
5
+        do      
6
+                if [ "$ACCOUNT" == "$ACCOUNTLIST" ];then
7
+                        echo "There is at least one default account is using"
8
+                        exit 1
9
+                fi
10
+        done
11
+done

+ 30
- 0
tests/check-depends.sh Целия файл

@@ -0,0 +1,30 @@
1
+#!/bin/bash
2
+
3
+case $1 in
4
+        smb-signing)
5
+                if dpkg -s samba >/dev/null 2>&1;then
6
+                        if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' -e '/^;/d' /etc/samba/smb.conf | grep "client.*signing.*mandatory";then
7
+                                exit 1
8
+                        fi
9
+                fi
10
+        ;;
11
+        smb-sec)
12
+                if [ "$(grep "cifs.*sec=krb5a\|cifs.*sec=ntlmv2i" /etc/mtab /etc/fstab | wc -l)" != "$(grep "cifs" /etc/mtab /etc/fstab | wc -l)" ];then
13
+                        exit 1
14
+                fi
15
+        ;;
16
+        libuser)
17
+                if [ -f /etc/libuser.conf ];then
18
+                        if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/libuser.conf | grep "crypt_style.*sha512";then
19
+                                exit 1
20
+                        fi
21
+                fi 
22
+        ;;
23
+        icmpv6)
24
+                if [ -a /proc/net/if_inet6 ];then
25
+                        if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/libuser.conf | grep "crypt_style.*sha512";then
26
+                                exit 1
27
+                        fi
28
+                fi 
29
+        ;;
30
+esac

+ 5
- 0
tests/check-gids.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ $(pwck -r | grep "no group" | wc -l) -ne 0 ];then
4
+        exit 1
5
+fi

+ 98
- 0
tests/check-grub-mode.sh Целия файл

@@ -0,0 +1,98 @@
1
+#!/bin/bash
2
+MODE=$(ls -l /boot/grub/grub.cfg | awk '{print $1}')
3
+
4
+if [ "$(printf "%c" "$MODE")" == "-" ];then  #First char at MODE(----------)
5
+        :   
6
+else
7
+        exit 1
8
+fi
9
+
10
+TEMP=${MODE#?}                 #remove first char at MODE and save at $TEMP
11
+
12
+printf "%c" "$TEMP" | grep -w "^r$\|^-$"
13
+
14
+if [ $? -eq 0 ];then
15
+        :   
16
+else
17
+        exit 1
18
+fi
19
+
20
+TEMP=${TEMP#?}
21
+
22
+printf "%c" "$TEMP" | grep -w "^w$\|^-$"
23
+
24
+if [ $? -eq 0 ];then
25
+        :   
26
+else
27
+        exit 1
28
+fi
29
+
30
+TEMP=${TEMP#?}
31
+
32
+printf "%c" "$TEMP" | grep -w "^-$"
33
+
34
+if [ $? -eq 0 ];then
35
+        :   
36
+else
37
+        exit 1
38
+fi
39
+
40
+TEMP=${TEMP#?}
41
+
42
+printf "%c" "$TEMP" | grep -w "^-$"
43
+
44
+if [ $? -eq 0 ];then
45
+        :   
46
+else
47
+        exit 1
48
+fi
49
+
50
+TEMP=${TEMP#?}
51
+
52
+printf "%c" "$TEMP" | grep -w "^-$"
53
+if [ $? -eq 0 ];then
54
+        :
55
+else
56
+        exit 1
57
+fi
58
+
59
+TEMP=${TEMP#?}
60
+
61
+printf "%c" "$TEMP" | grep -w "^-$"
62
+
63
+if [ $? -eq 0 ];then
64
+        :
65
+else
66
+        exit 1
67
+fi
68
+
69
+TEMP=${TEMP#?}
70
+
71
+printf "%c" "$TEMP" | grep -w "^-$"
72
+
73
+if [ $? -eq 0 ];then
74
+        :
75
+else
76
+        exit 1
77
+fi
78
+
79
+TEMP=${TEMP#?}
80
+
81
+printf "%c" "$TEMP" | grep -w "^-$"
82
+
83
+if [ $? -eq 0 ];then
84
+        :
85
+else
86
+        exit 1
87
+fi
88
+
89
+TEMP=${TEMP#?}
90
+
91
+printf "%c" "$TEMP" | grep -w "^-$"
92
+
93
+if [ $? -eq 0 ];then
94
+        :
95
+else
96
+        exit 1
97
+fi
98
+

+ 9
- 0
tests/check-inactive.sh Целия файл

@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
+
3
+if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/default/useradd | grep INACTIVE;then
4
+        if [ $(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/default/useradd | grep INACTIVE | awk -F '=' '{printf $2}') -gt 35 ];then
5
+                exit 1
6
+        fi
7
+else
8
+        exit 1
9
+fi

+ 6
- 0
tests/check-ipv6-enable.sh Целия файл

@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+
3
+if [ -a /proc/net/if_inet6 ];then
4
+        echo bad
5
+        exit 1
6
+fi

+ 42
- 0
tests/check-libs-mode.sh Целия файл

@@ -0,0 +1,42 @@
1
+#!/bin/bash
2
+
3
+if [ -d "/lib" ];then
4
+
5
+        COUNT=$(find -L /lib  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
6
+
7
+        if [ $COUNT -eq 0 ];then
8
+                :
9
+        else
10
+                exit 1
11
+        fi
12
+fi
13
+if [ -d "/lib64" ];then
14
+
15
+        COUNT=$(find -L /lib64  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
16
+
17
+        if [ $COUNT -eq 0 ];then
18
+                :
19
+        else
20
+                exit 1
21
+        fi
22
+fi
23
+if [ -d "/usr/lib" ];then
24
+
25
+        COUNT=$(find -L /usr/lib  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
26
+
27
+        if [ $COUNT -eq 0 ];then
28
+                :
29
+        else
30
+                exit 1
31
+        fi
32
+fi
33
+if [ -d "/usr/lib64" ];then
34
+
35
+        COUNT=$(find -L /usr/lib64  -type f  -perm  /022  -exec ls -l {} \; |wc -l)
36
+
37
+        if [ $COUNT -eq 0 ];then
38
+                :
39
+        else
40
+                exit 1
41
+        fi
42
+fi

+ 43
- 0
tests/check-libs-owner.sh Целия файл

@@ -0,0 +1,43 @@
1
+#!/bin/bash
2
+
3
+if [ -d "/lib" ];then
4
+
5
+        COUNT=$(find -L /lib  \! -user root  -exec ls -l {} \; |wc -l)
6
+
7
+        if [ $COUNT -eq 0 ];then
8
+                :
9
+        else
10
+                exit 1
11
+        fi
12
+fi
13
+if [ -d "/lib64" ];then
14
+
15
+        COUNT=$(find -L /lib64  \! -user root  -exec ls -l {} \; |wc -l)
16
+
17
+        if [ $COUNT -eq 0 ];then
18
+                :
19
+        else
20
+                exit 1
21
+        fi
22
+fi
23
+if [ -d "/usr/lib" ];then
24
+
25
+        COUNT=$(find -L /usr/lib  \! -user root  -exec ls -l {} \; |wc -l)
26
+
27
+        if [ $COUNT -eq 0 ];then
28
+                :
29
+        else
30
+                exit 1
31
+        fi
32
+fi
33
+if [ -d "/usr/lib64" ];then
34
+
35
+        COUNT=$(find -L /usr/lib64  \! -user root  -exec ls -l {} \; |wc -l)
36
+
37
+        if [ $COUNT -eq 0 ];then
38
+                :
39
+        else
40
+                exit 1
41
+        fi
42
+fi
43
+

+ 21
- 0
tests/check-limits.sh Целия файл

@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+case $1 in
3
+        core-dumps)
4
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/security/limits.conf | grep "hard.*core";then
5
+                        if [ $(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/security/limits.conf | grep "hard.*core" | awk -F 'core' '{print $2}' | sed 's/\ *//g') -ne 0 ];then
6
+                                exit 1
7
+                        fi
8
+                else
9
+                        exit 1
10
+                fi
11
+        ;;
12
+        maxlogins)
13
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/security/limits.conf | grep "maxlogins";then
14
+                        if [ $(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/security/limits.conf | grep "maxlogins" | awk -F 'maxlogins' '{print $2}' | sed 's/\ *//g') -lt 10 ];then
15
+                                exit 1
16
+                        fi
17
+                else
18
+                        exit 1
19
+                fi
20
+        ;;
21
+esac

+ 21
- 0
tests/check-login-defs.sh Целия файл

@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+
3
+LOCATION=$1
4
+KEYWORD=$2
5
+OPTION=$3
6
+
7
+if [ -f "$LOCATION" ];then
8
+
9
+        RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' $LOCATION | grep "$KEYWORD.*$OPTION")
10
+        #above line is remove any comment in the configuration file and use grep to output a exit status
11
+        #if matched both $KEYWORD and $OPTION there is a success exit status: 0
12
+
13
+        if [ $? -eq 0 ];then
14
+                if [ "$(echo $RESULT | tr "\t" "\n" | tr " " "\n" | sed -n "/$OPTION/p"| awk -F "=" '{printf $2}')" -$(echo $COMPARE) "$CONDITION" ];then
15
+                        exit 1
16
+                fi
17
+        else
18
+                exit 1
19
+        fi 
20
+
21
+fi

+ 5
- 0
tests/check-logrotate.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ $(find /etc/cron.d*/ -name logrotate | wc -l) -eq 0 ];then
4
+        exit 1
5
+fi

+ 16
- 0
tests/check-mode.sh Целия файл

@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+#In STIG there is only 5 kinds of permission : 0000, 0644, 0755, 0600, 0640
3
+LOCALTION=$1
4
+PERM=$2
5
+
6
+LEN=(stat $LOCALTION -c %a) 
7
+#if permisiion of the file or directory 
8
+
9
+
10
+if [ $LEN == 4 ];then
11
+       exit 1
12
+fi
13
+
14
+let FPERM=777-$PERM
15
+
16
+find $LOCALTION -perm /$(printf "%03d\n" $FPERM) | wc -l | awk -F: '($1 != "0") {print; err=1} END {exit err}'

+ 17
- 0
tests/check-netrc.sh Целия файл

@@ -0,0 +1,17 @@
1
+#!/bin/bash
2
+
3
+if [ -f ~/.netrc ];then
4
+        echo "Found .netrc in /root"
5
+        exit 1
6
+else
7
+        echo ".netrc no found in /root"
8
+fi
9
+for i in $(awk -F':' '{ if ( $3 >= 500 ) print $1 }' /etc/passwd);do
10
+        HOMEDIR=`eval "echo ~$i"`
11
+        if [ -f "$HOMEDIR/.netrc" ];then
12
+                echo "Found .netrc in $HOMEDIR"
13
+                exit 1
14
+        else
15
+                echo ".netrc no found in $HOMEDIR"
16
+        fi
17
+done

+ 5
- 0
tests/check-nfs-all-squash.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/exports | grep -i  "all_squash";then
4
+        exit 1
5
+fi

+ 5
- 0
tests/check-nfs-insecure.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/exports | grep insecure_locks;then
4
+        exit 1
5
+fi

+ 14
- 0
tests/check-nfs.sh Целия файл

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+case $1 in
4
+        nodev)
5
+                if [ "$(mount | grep nfs | wc -l)" != "$(mount | grep "nfs.*nodev" | wc -l)" ];then
6
+                        exit 1
7
+                fi
8
+	;;
9
+	nosuid)
10
+	        if [ "$(mount | grep nfs | wc -l)" != "$(mount | grep "nfs.*nosuid" | wc -l)" ];then
11
+		        exit 1
12
+		fi
13
+	;;
14
+esac

+ 9
- 0
tests/check-ntp-sources.sh Целия файл

@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
+
3
+if [ -f /etc/ntp.conf ];then
4
+        if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ntp.conf | grep server;then
5
+                exit 1
6
+        fi
7
+else
8
+        exit 1
9
+fi

+ 19
- 0
tests/check-package-up2date.sh Целия файл

@@ -0,0 +1,19 @@
1
+#!/bin/bash
2
+
3
+#Based on http://unix.stackexchange.com/questions/175146/apt-get-update-exit-status
4
+#And http://unix.stackexchange.com/questions/19470/list-available-updates-but-do-not-install-them
5
+
6
+if ! { apt-get update 2>&1 || echo E: update failed ;} | grep -q '^[WE]:';then
7
+        echo update success
8
+else
9
+        echo update failure
10
+        exit 1
11
+fi
12
+
13
+if [ $(aptitude search '~U' | wc -l) -gt 0 ];then
14
+        echo Need-to-update
15
+        exit 1
16
+else 
17
+        echo No-Need-to-update
18
+        exit 0
19
+fi

+ 44
- 0
tests/check-packages.sh Целия файл

@@ -0,0 +1,44 @@
1
+#!/bin/bash
2
+
3
+case $1 in
4
+        xinetd)
5
+                if dpkg -s xinetd ;then
6
+                        exit 1
7
+                fi
8
+        ;;
9
+        telnetd)
10
+                if dpkg -s telnetd ;then
11
+                        exit 1
12
+                fi
13
+        ;;
14
+        rsh-server)
15
+                if dpkg -s rsh-server ;then
16
+                        exit 1
17
+                fi
18
+        ;;
19
+        nis)
20
+                if dpkg -s nis ;then
21
+                        exit 1
22
+                fi
23
+        ;;
24
+        tftpd)
25
+                if dpkg -s tftpd ;then
26
+                        exit 1
27
+                fi
28
+        ;;
29
+        sldap)
30
+                if dpkg -s sldap ;then
31
+                        exit 1
32
+                fi
33
+        ;;
34
+        sendmail)
35
+                if dpkg -s sendmail ;then
36
+                        exit 1
37
+                fi
38
+        ;;
39
+        x11-common)
40
+                if dpkg -s x11-common ;then
41
+                        exit 1
42
+                fi
43
+        ;;
44
+esac

+ 15
- 0
tests/check-password-max-day.sh Целия файл

@@ -0,0 +1,15 @@
1
+#!/bin/bash
2
+
3
+if [ -f "/etc/login.def" ];then
4
+
5
+        RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep PASS_MAX_DAYS)
6
+        if [ $? -eq 0 ];then
7
+                if [ "$(echo $RESULT | awk '{printf $2}')" -gt "60" ];then
8
+                        exit 1
9
+                fi  
10
+        else
11
+                exit 1
12
+        fi  
13
+else
14
+        exit 1
15
+fi

+ 15
- 0
tests/check-password-min-day.sh Целия файл

@@ -0,0 +1,15 @@
1
+#!/bin/bash
2
+
3
+if [ -f "/etc/login.def" ];then
4
+
5
+        RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep PASS_MIN_DAYS)
6
+        if [ $? -eq 0 ];then
7
+                if [ "$(echo $RESULT | awk '{printf $2}')" -lt "1" ];then
8
+                        exit 1
9
+                fi  
10
+        else
11
+                exit 1
12
+        fi  
13
+else
14
+        exit 1
15
+fi

+ 15
- 0
tests/check-password-min-len.sh Целия файл

@@ -0,0 +1,15 @@
1
+#!/bin/bash
2
+
3
+if [ -f "/etc/login.def" ];then
4
+
5
+        RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep PASS_MIN_LEN)
6
+        if [ $? -eq 0 ];then
7
+                if [ "$(echo $RESULT | awk '{printf $2}')" -lt "14" ];then
8
+                        exit 1
9
+                fi  
10
+        else
11
+                exit 1
12
+        fi  
13
+else
14
+        exit 1
15
+fi

+ 15
- 0
tests/check-password-warn-age.sh Целия файл

@@ -0,0 +1,15 @@
1
+#!/bin/bash
2
+
3
+if [ -f "/etc/login.def" ];then
4
+
5
+        RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep PASS_WARN_AGE)
6
+        if [ $? -eq 0 ];then
7
+                if [ "$(echo $RESULT | awk '{printf $2}')" -lt "7" ];then
8
+                        exit 1
9
+                fi  
10
+        else
11
+                exit 1
12
+        fi  
13
+else
14
+        exit 1
15
+fi

+ 30
- 0
tests/check-password.sh Целия файл

@@ -0,0 +1,30 @@
1
+#!/bin/bash
2
+LOCATION=$1
3
+KEYWORD=$2
4
+OPTION=$3
5
+COMPARE=$4
6
+CONDITION=$5
7
+
8
+#Example:
9
+#LOCATION="/etc/pam.d/common-password"  
10
+        #For debian is common-password ,for Gentoo and Red hat the file is system-auth
11
+#KEYWORD="pam_cracklib.so"
12
+#OPTION="ocredit"
13
+#COMPARE="gt"
14
+#CONDITION="-1"
15
+
16
+if [ -f "$LOCATION" ];then
17
+
18
+        RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' $LOCATION | grep "$KEYWORD.*$OPTION")
19
+	#above line is remove any comment in the configuration file and use grep to output a exit status
20
+	#if matched both $KEYWORD and $OPTION there is a success exit status: 0
21
+
22
+        if [ $? -eq 0 ];then
23
+	        if [ "$(echo $RESULT | tr "\t" "\n" | tr " " "\n" | sed -n "/$OPTION/p"| awk -F "=" '{printf $2}')" -$(echo $COMPARE) "$CONDITION" ];then
24
+                        exit 1
25
+	        fi
26
+        else
27
+                exit 1
28
+	fi
29
+
30
+fi

+ 5
- 0
tests/check-postfix.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' -e 's/ //g' /etc/postfix/main.cf | grep inet_interfaces | awk -F '=' '{print $2}')" != "localhost" ];then
4
+        exit 1
5
+fi

+ 5
- 0
tests/check-public-dir-owned.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ $(find / -xdev -type d -perm -0002 -uid +499 -print | wc -l) -gt 0 ];then
4
+        exit 1
5
+fi

+ 15
- 0
tests/check-removable.sh Целия файл

@@ -0,0 +1,15 @@
1
+#!/bin/bash
2
+#for more detial to determine which sd is usb
3
+#http://unix.stackexchange.com/questions/60299/how-to-determine-which-sd-is-usb
4
+
5
+grep -Hv ^0$ /sys/block/*/removable | \
6
+sed s/removable:.*$/device\\/uevent/ | \
7
+xargs grep -H ^DRIVER=sd | \
8
+sed s/device.uevent.*$/size/ | \
9
+xargs grep -Hv ^0$ | \
10
+cut -d / -f 4 | \
11
+while read line ;do
12
+        if [ "$(mount | grep "$line" | wc -l)" != "$(mount | grep "$line.*noexec" | wc -l )" ];then
13
+                exit 1
14
+        fi
15
+done

+ 23
- 0
tests/check-rhosts.sh Целия файл

@@ -0,0 +1,23 @@
1
+HOSTS="/etc/hosts.equiv"
2
+
3
+if [ -f "$HOSTS" ];then
4
+        echo "Found hosts.equiv"
5
+        exit 1
6
+else
7
+        echo "hosts.equiv no found"
8
+fi
9
+if [ -f ~/.rhosts ];then
10
+        echo "Found .rhosts in /root"
11
+        exit 1
12
+else
13
+        echo ".rhosts no found in /root"
14
+fi
15
+for i in $(awk -F':' '{ if ( $3 >= 500 ) print $1 }' /etc/passwd);do
16
+        HOMEDIR=`eval "echo ~$i"`
17
+        if [ -f "$HOMEDIR/.rhosts" ];then
18
+                echo "Found .rhosts in $HOMEDIR"
19
+                exit 1
20
+        else
21
+                echo ".rhosts no found in $HOMEDIR"
22
+        fi 
23
+done

+ 11
- 0
tests/check-root-uid.sh Целия файл

@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+if [ $(awk -F: '($3 == 0) {print}' /etc/passwd | wc -l) -gt 1 ];then
4
+        exit 1
5
+else
6
+        if [ "$(awk -F: '($3 == 0) {print}' /etc/passwd | awk  -F ':' '{printf $1}')" == "root" ];then
7
+                exit 0
8
+	else 
9
+	        exit 1
10
+	fi
11
+fi

+ 37
- 0
tests/check-rsyslog.sh Целия файл

@@ -0,0 +1,37 @@
1
+#!/bin/bash
2
+
3
+case "$1" in
4
+
5
+        owned)
6
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/rsyslog.conf | grep FileOwner | awk '{print $2}')" != "root" ];then
7
+                        exit 1
8
+                fi
9
+                sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/rsyslog.conf | sed  -e '/\$/d' | awk '{print $2}' | sed -e '/^:/d' -e '/|/d' -e 's/^-//g' -e '/^$/d' | \
10
+                while read line;do
11
+                        if [ -f $line ] && [ "$(ls -alh $line | awk '{print $3}')" != "root" ];then
12
+                                        exit 1
13
+                        fi
14
+                done
15
+        ;;
16
+        group-owned)
17
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/rsyslog.conf | grep FileGroup | awk '{print $2}')" != "root" ];then
18
+                        exit 1
19
+                fi
20
+                sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/rsyslog.conf | sed  -e '/\$/d' | awk '{print $2}' | sed -e '/^:/d' -e '/|/d' -e 's/^-//g' -e '/^$/d' | \
21
+                while read line;do
22
+                        if [ -f $line ] && [ "$(ls -alh $line | awk '{print $4}')" != "root" ];then
23
+                                        exit 1
24
+                        fi
25
+                done
26
+        ;;
27
+        mode)
28
+                sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/rsyslog.conf | sed  -e '/\$/d' | awk '{print $2}' | sed -e '/^:/d' -e '/|/d' -e 's/^-//g' -e '/^$/d' | \
29
+                while read line;do
30
+                        bash check-mode.sh $line 600
31
+                        if [ $? -eq 1 ];then
32
+                                exit 1
33
+                        fi
34
+                done
35
+
36
+        ;;
37
+esac

+ 79
- 0
tests/check-services.sh Целия файл

@@ -0,0 +1,79 @@
1
+#!/bin/bash
2
+
3
+case $1 in
4
+        atd)
5
+                if service --status-all | grep "+.*atd";then
6
+                        exit 1
7
+                fi
8
+        ;;
9
+        avahi-daemon)
10
+                if service --status-all | grep "+.*avahi-daemon";then
11
+                        exit 1
12
+                fi
13
+        ;;
14
+        xinetd)
15
+                if service --status-all | grep "+.*xinetd";then
16
+                        exit 1
17
+                fi
18
+        ;;
19
+        telnetd)
20
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep telnet;then
21
+                        exit 1
22
+                fi
23
+        ;;
24
+        rshd)
25
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep rshd;then
26
+                        exit 1
27
+                fi
28
+        ;;
29
+        rexecd)
30
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep rexecd;then
31
+                        exit 1
32
+                fi
33
+        ;;
34
+        rlogind)
35
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep rlogind;then
36
+                        exit 1
37
+                fi
38
+        ;;
39
+        nis)
40
+                if service --status-all | grep "+.*\ nis$";then
41
+                        exit 1
42
+                fi
43
+        ;;
44
+        tftpd)
45
+                if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep tftpd;then
46
+                        exit 1
47
+                fi
48
+        ;;
49
+        cron)
50
+                if ! service --status-all | grep "+.*cron";then
51
+                        exit 1
52
+                fi
53
+        ;;
54
+        ntp)
55
+                if ! service --status-all | grep "+.*ntp";then
56
+                        exit 1
57
+                fi
58
+        ;;
59
+        postfix)
60
+                if ! service --status-all | grep "+.*postfix";then
61
+                        exit 1
62
+                fi
63
+        ;;
64
+        x11-common)
65
+                if service --status-all | grep "+.*x11-common";then
66
+                        exit 1
67
+                fi
68
+        ;;
69
+        bluetooth)
70
+                if service --status-all | grep "+.*bluetooth";then
71
+                        exit 1
72
+                fi
73
+        ;;
74
+        autofs)
75
+                if service --status-all | grep "+.*autofs";then
76
+                        exit 1
77
+                fi
78
+        ;;
79
+esac

+ 12
- 0
tests/check-ssh-ciphers.sh Целия файл

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+FIPS="aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc"
3
+cipher=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i "Ciphers")
4
+if [ $? -eq 0 ];then
5
+        echo $cipher | sed -e 's/Ciphers//' | tr "," "\n" | while read line;do
6
+                 if ! echo $FIPS | grep $line;then
7
+                         exit 1
8
+                 fi
9
+        done
10
+else
11
+        exit 1
12
+fi

+ 33
- 0
tests/check-ssh.sh Целия файл

@@ -0,0 +1,33 @@
1
+#!/bin/bash
2
+case $1 in
3
+        Protocol)
4
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -w "^Protocol" | awk '{print $2}')" -ne 2 ];then
5
+                        exit 1
6
+                fi
7
+        ;;
8
+        rhosts)
9
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i IgnoreRhosts | awk '{print $2}')" != "yes" ];then
10
+                        exit 1
11
+                fi
12
+        ;;
13
+        hostauth)
14
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i HostbasedAuthentication | awk '{print $2}')" != "no" ];then
15
+                        exit 1
16
+                fi
17
+        ;;
18
+        permitroot)
19
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i PermitRootLogin | awk '{print $2}')" != "no" ];then
20
+                        exit 1
21
+                fi
22
+        ;;
23
+        emptypassword)
24
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i PermitEmptyPasswords | awk '{print $2}')" != "no" ];then
25
+                        exit 1
26
+                fi
27
+        ;;
28
+        emptypasswordenvironment)
29
+                if [ "$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i PermitEmptyPasswords | awk '{print $2}')" != "no" ];then
30
+                        exit 1
31
+                fi
32
+        ;;
33
+esac

+ 5
- 0
tests/check-sticky-bit.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ $(find / -xdev -type d -perm -002 \! -perm -1000 | wc -l) -gt 0 ];then
4
+        exit 1
5
+fi

+ 7
- 0
tests/check-sudo.sh Целия файл

@@ -0,0 +1,7 @@
1
+#!/bin/bash
2
+
3
+if grep -i "NOPASSWD" /etc/sudoers /etc/sudoers.d/* | sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' | grep -i "NOPASSWD";then
4
+        exit 1
5
+elif grep -i '!authenticate' /etc/sudoers /etc/sudoers.d/* | sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' | grep -i '!authenticate';then
6
+        exit 1
7
+fi

+ 8
- 0
tests/check-sysctl.sh Целия файл

@@ -0,0 +1,8 @@
1
+#!/bin/bash
2
+OPTION=$1
3
+COMPARE=$2
4
+CONDITION=$3
5
+
6
+if [ "$(sysctl $OPTION | awk '{print $3}')" -$(echo $COMPARE) "$CONDITION" ];then
7
+        exit 1
8
+fi

+ 5
- 0
tests/check-uniq-names.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ $(pwck -rq | wc -l ) -ne 0 ];then
4
+        exit 1
5
+fi

+ 5
- 0
tests/check-world-writable.sh Целия файл

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+if [ "$(find / -xdev -type f -perm -002 | wc -l)" -ne 0 ];then
4
+        exit 1
5
+fi

+ 2016
- 0
tests/output.sh
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 164
- 0
tests/porting_log Целия файл

@@ -0,0 +1,164 @@
1
+
2
+######CHANGE#######
3
+
4
+#RHEL-06-000008: Vendor-provided cryptographic certificates must be installed to verify the integrity of system software.
5
+#Change corresponding gpg key check to Debian compatible.
6
+
7
+#RHEL-06-000011: System security patches and updates must be installed and up-to-date.
8
+#Change corresponding update utility to Debian compatible.
9
+
10
+#RHEL-06-000017: The system must use a Linux Security Module at boot time.
11
+#Change the SElinux to AppArmor
12
+
13
+#RHEL-06-000030: The system must not have accounts configured with blank or null passwords.
14
+#RHEL-06-000274: The system must prohibit the reuse of passwords within twenty-four iterations.
15
+#Change /etc/pam.d/system-auth - CentOS/RHEL/Fedora/Red Hat/Scientific Linux pam config file.
16
+#To /etc/pam.d/common-password - Debian / Ubuntu Linux pam config file.
17
+#For more Detial http://www.cyberciti.biz/tips/linux-or-unix-disable-null-passwords.html
18
+
19
+#RHEL-06-000061:The system must disable accounts after three consecutive unsuccessful logon attempts.
20
+#Change pam_faillock.so pam module to use pam_tally2.so
21
+
22
+#RHEL-06-000065:The system boot loader configuration file(s) must be owned by root.
23
+#RHEL-06-000066:The system boot loader configuration file(s) must be group-owned by root.
24
+#RHEL-06-000067:The system boot loader configuration file(s) must have mode 0600 or less permissive.
25
+#Change /etc/grub.conf to /boot/grub/grub.cfg
26
+
27
+#RHEL-06-000068:The system boot loader must require authentication.
28
+#Change grub-crypt --sha-512 to grub-mkpasswd-pbkdf2 
29
+
30
+#RHEL-06-000278:The system package management tool must verify permissions on all files and directories associated with the audit package.
31
+#RHEL-06-000279:The system package management tool must verify ownership on all files and directories associated with the audit package.
32
+#RHEL-06-000280:The system package management tool must verify group-ownership on all files and directories associated with the audit package.
33
+#RHEL-06-000281:The system package management tool must verify contents of all files associated with the audit package.
34
+#For auditd package, to do what we wanna do in Debian there's something different, if you wanna get the packages default permission or owner(group-owner), or the packages'contents. You should use the "aptitude download <package-name>" to download it and use "dpkg -c <package.deb>" to read.
35
+#There's one file is very special,if you issue the command "dpkg -c audit*.deb" you will found the audit rules file is "/etc/audit/rules.d/audit.rules", but when you extract the deb package and read the "DEBIAN/postinst" you will find the auditd package copy the "/etc/audit/audit.d/audit.rules" file to "/etc/audit/audit.rules", so we could'n only use the "dpkg -c audit*.deb | awk '{print $6}' | sed -e 's/^.//g'" to get "ALL" the files we want to check.We should manually add the "/etc/audit/audit.rules" to check
36
+#And the directory we check also have one thing special, the "/usr/share/man", in Debian that directory have permission 0775 by default. but the package show the 0755, so I decided to check without this directory.
37
+#I use the sha512sum to do the files' content checking
38
+
39
+#RHEL-06-000286:The x86 Ctrl-Alt-Delete key sequence must be disabled.
40
+#In Debian 8 use systemd by default, you could use "systemctl mask ctrl-alt-del.target" to disable it by link to /dev/null
41
+
42
+#RHEL-06-000514:The RPM package management tool must cryptographically verify the authenticity of all software packages during installation.
43
+
44
+
45
+####DEPRECATED#####
46
+#RHEL-06-000009:The Red Hat Network Service (rhnsd) service must not be running, unless using RHN or an RHN Satellite.
47
+#DEPRECATED
48
+
49
+#RHEL-06-000069:The system must require authentication upon booting into single-user and maintenance modes.
50
+#DEPRECATED.
51
+#Debian and therefore Ubuntu both require root password when booting into single user mode or recovery mode. RHEL and CentOS allows access from the console into single user mode without a password.
52
+
53
+#RHEL-06-000070:The system must not permit interactive boot.
54
+#DEPRECATED.Don't find any interactive boot option in debian yet.
55
+
56
+#RHEL-06-000073:The Department of Defense (DoD) login banner must be displayed immediately prior to, or as part of, console login prompts.
57
+#DEPRECATED
58
+
59
+#RHEL-06-000079:The system must limit the ability of processes to have simultaneous write and execute access to memory.
60
+#DEPRECATED
61
+#In debian 8 amd64, system enabled NX by default,and debian 8 i386 system use PAE by default
62
+
63
+#RHEL-06-000098:The IPv6 protocol handler must not be bound to the network stack unless needed.
64
+#Change ipv6 checking method and disable method.
65
+#Use /proc/net/if_inet6 to check if ipv6  is enabled
66
+#Use kernel boot option in Grub "ipv6.disable=1" to disable ipv6 permanently
67
+
68
+#RHEL-06-000103:The system must employ a local IPv6 firewall.
69
+#RHEL-06-000106:The operating system must connect to external networks or information systems only through managed IPv6 interfaces consisting of boundary protection devices arranged in accordance with an organizational security architecture.
70
+#RHEL-06-000107:The operating system must prevent public IPv6 access into an organizations internal networks,except as appropriately mediated by managed interfaces employing boundary protection devices.
71
+#RHEL-06-000113:The system must employ a local IPv4 firewall.
72
+#RHEL-06-000116:The operating system must connect to external networks or information systems only through managed IPv4 interfaces consisting of boundary protection devices arranged in accordance with an organizational security architecture.
73
+#RHEL-06-000117:The operating system must prevent public IPv4 access into an organizations internal networks, except as appropriately mediated by managed interfaces employing boundary protection devices.
74
+#DEPRECATED. Debian 8 enable iptables (both ipv4 and ipv6) by default
75
+
76
+#RHEL-06-000183:The audit system must be configured to audit modifications to the systems Mandatory Access Control (MAC) configuration (SELinux).
77
+#Change SELinux to Apparmor
78
+
79
+#RHEL-06-000203:The xinetd service must be disabled if no network services utilizing it are enabled.
80
+#Using 'service --status-all | grep "xinetd" ' instead of chkconfig
81
+
82
+#RHEL-06-000211:The telnet daemon must not be running.
83
+#In Debian telnet service using inetd. You could disable it by comment the telnet line in the /etc/inetd.conf
84
+
85
+#RHEL-06-000214:The rshd service must not be running.
86
+#In Debian rshd service using inetd. You could disable it by comment the rshd line in the /etc/inetd.conf
87
+
88
+#RHEL-06-000216:The rexecd service must not be running.
89
+#In Debian rexecd service using inetd. You could disable it by comment the rexecd line in the /etc/inetd.conf
90
+
91
+#RHEL-06-000218:The rlogind service must not be running.
92
+#In Debian rlogind service using inetd. You could disable it by comment the rlogind line in the /etc/inetd.conf
93
+
94
+#RHEL-06-000220:The ypserv package must not be installed.
95
+#In Debian using nis package instead of ypserv package.
96
+
97
+#RHEL-06-000221:The ypbind service must not be running.
98
+#In Debian using nis service instead of ypbind service.
99
+
100
+#RHEL-06-000240:The SSH daemon must be configured with the Department of Defense (DoD) login banner.
101
+#DEPRECATED
102
+
103
+#RHEL-06-000247:The system clock must be synchronized continuously, or at least daily.
104
+#In debian use ntp instead of ntpd
105
+
106
+#RHEL-06-000248:The system clock must be synchronized to an authoritative DoD time source.
107
+#Changing `DoD` time source to trusted time source 
108
+
109
+#RHEL-06-000261:The Automatic Bug Reporting Tool (abrtd) service must not be running.
110
+#DEPRECATED.
111
+#Didn't find abrtd-like  tool in debian yet
112
+
113
+#RHEL-06-000265:The ntpdate service must not be running.
114
+#DEPRECATED
115
+#In Debian there's no running service "ntpdate", some of ntpdate's function is include in "ntp" so  DEPRECATED.
116
+
117
+#RHEL-06-000266:The oddjobd service must not be running.
118
+#DEPRECATED.Debian don't have oddjob service or package
119
+
120
+#RHEL-06-000267:The qpidd service must not be running.
121
+#Debian don't have qpidd service by default, in RHEL this service is selected by "base" package.
122
+
123
+#RHEL-06-000268:The rdisc service must not be running.
124
+#Debian don't have rdisc service by default
125
+
126
+#RHEL-06-000303:The operating system must employ automated mechanisms, per organization defined frequency, to detect the addition of unauthorized components/devices into the operating system.
127
+#RHEL-06-000304:The operating system must employ automated mechanisms to detect the presence of unauthorized software on organizational information systems and notify designated organizational officials in accordance with the organization defined frequency.
128
+#RHEL-06-000305:The operating system must provide a near real-time alert when any of the organization defined list of compromise or potential compromise indicators occurs.
129
+#RHEL-06-000306:The operating system must detect unauthorized changes to software and information.
130
+#RHEL-06-000307:The operating system must ensure unauthorized, security-relevant configuration changes detected are tracked.
131
+#In aide package employ automated mechanisms by default.(cron.daily)
132
+
133
+#RHEL-06-000324:A login banner must be displayed immediately prior to, or as part of, graphical desktop environment login prompts.
134
+
135
+#RHEL-06-000326:The Department of Defense (DoD) login banner must be displayed immediately prior to, or as part of, graphical desktop environment login prompts.
136
+#RHEL-06-000344:The system default umask in /etc/profile must be 077.
137
+#RHEL-06-000343:The system default umask for the csh shell must be 077.
138
+#RHEL-06-000342:The system default umask for the bash shell must be 077.
139
+#RHEL-06-000348:The FTPS/FTP service on the system must be configured with the Department of Defense (DoD) login banner.
140
+
141
+#RHEL-06-000357:The system must disable accounts after excessive login failures within a 15-minute interval.
142
+
143
+
144
+
145
+
146
+
147
+#RHEL-06-000284:The system must use and update a DoD-approved virus scan program.
148
+#RHEL-06-000285:The system must have a host-based intrusion detection tool installed.
149
+
150
+
151
+
152
+####SHOULD-CHECK-ON-YOU-OWN####
153
+
154
+
155
+#RHEL-06-000289:The netconsole service must be disabled unless required.
156
+#Red Hat has netconsole init script. However, under Debian / Ubuntu Linux, you need to manually configure netconsole. Type the following command to start netconsole by loading kernel netconsole module
157
+#RHEL-06-000297:Temporary accounts must be provisioned with an expiration date.
158
+#RHEL-06-000298:Emergency accounts must be provisioned with an expiration date.
159
+#RHEL-06-000311:The audit system must provide a warning when allocated audit record storage volume reaches a documented percentage of maximum audit record storage capacity.
160
+#RHEL-06-000321:The system must provide VPN connectivity for communications over untrusted networks.
161
+#RHEL-06-000349:The system must be configured to require the use of a CAC, PIV compliant hardware token, or Alternate Logon Token (ALT) for authentication.
162
+#RHEL-06-000504:The operating system must conduct backups of user-level information contained in the operating system per organization defined frequency to conduct backups consistent with recovery time and recovery point objectives.
163
+#RHEL-06-000505:The operating system must conduct backups of system-level information contained in the information system per organization defined frequency to conduct backups that are consistent with recovery time and recovery point objectives.
164
+#RHEL-06-000524:The system must provide automated support for account management functions.

+ 27
- 0
tests/undone_log Целия файл

@@ -0,0 +1,27 @@
1
+RHEL-06-000013:The system package management tool must cryptographically verify the authenticity of system software packages during installation.
2
+RHEL-06-000015:The system package management tool must cryptographically verify the authenticity of all software packages during installation.
3
+RHEL-06-000020:The system must use a Linux Security Module configured to enforce limits on system services.
4
+RHEL-06-000023:The system must use a Linux Security Module configured to limit the privileges of system services.
5
+RHEL-06-000025:All device files must be monitored by the system Linux Security Module.
6
+
7
+RHEL-06-000252:If the system is using LDAP for authentication or account information, the system must use a TLS connection using FIPS 140-2 approved cryptographic algorithms.
8
+RHEL-06-000253:The LDAP client must use a TLS connection using trust certificates signed by the site CA.
9
+RHEL-06-000257:The graphical desktop environment must set the idle timeout to no more than 15 minutes.
10
+RHEL-06-000258:The graphical desktop environment must automatically lock after 15 minutes of inactivity and the system must require user reauthentication to unlock the environment.
11
+RHEL-06-000259:The graphical desktop environment must have automatic lock enabled.
12
+RHEL-06-000260:The system must display a publicly-viewable pattern during a graphical desktop environment session lock.
13
+RHEL-06-000292:The DHCP client must be disabled if not needed.
14
+RHEL-06-000324:A login banner must be displayed immediately prior to, or as part of, graphical desktop environment login prompts.
15
+RHEL-06-000527:The login user list must be disabled.
16
+
17
+
18
+RHEL-06-000340:The snmpd service must use only SNMP protocol version 3 or newer.
19
+RHEL-06-000341:The snmpd service must not use a default password.
20
+
21
+
22
+RHEL-06-000508:The system must allow locking of graphical desktop sessions.
23
+
24
+RHEL-06-000516:The system package management tool must verify ownership on all files and directories associated with packages.
25
+RHEL-06-000517:The system package management tool must verify group-ownership on all files and directories associated with packages.
26
+RHEL-06-000518:The system package management tool must verify permissions on all files and directories associated with packages.
27
+RHEL-06-000519:The system package management tool must verify contents of all files associated with packages.