Browse Source

stig tests option to lockdown permissions

Bob Mottram 8 years ago
parent
commit
95702debd8
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      src/freedombone-tests

+ 11
- 2
src/freedombone-tests View File

32
 
32
 
33
 export TEXTDOMAIN=${PROJECT_NAME}-tests
33
 export TEXTDOMAIN=${PROJECT_NAME}-tests
34
 export TEXTDOMAINDIR="/usr/share/locale"
34
 export TEXTDOMAINDIR="/usr/share/locale"
35
+source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-setup
35
 
36
 
36
 # Whether to run STIG tests
37
 # Whether to run STIG tests
37
 RUN_STIG=
38
 RUN_STIG=
45
     echo ''
46
     echo ''
46
     echo $'Runs tests on the system'
47
     echo $'Runs tests on the system'
47
     echo ''
48
     echo ''
48
-    echo $'     --stig [yes|no]      Run STIG tests'
49
+    echo $'     --stig [yes|no|fix]  Run STIG tests'
49
     echo $'     --help               Show help'
50
     echo $'     --help               Show help'
50
     echo ''
51
     echo ''
51
     exit 0
52
     exit 0
130
     wait $1
131
     wait $1
131
 }
132
 }
132
 
133
 
134
+function fix_stig {
135
+    if [[ $RUN_STIG != 'fix' ]]; then
136
+        return
137
+    fi
138
+    lockdown_permissions
139
+}
140
+
133
 function test_stig {
141
 function test_stig {
134
     if [ ! $RUN_STIG ]; then
142
     if [ ! $RUN_STIG ]; then
135
         return
143
         return
1125
             if [[ "$1" == 'showall' ]]; then
1133
             if [[ "$1" == 'showall' ]]; then
1126
                 SHOW_ALL_TESTS=1
1134
                 SHOW_ALL_TESTS=1
1127
             fi
1135
             fi
1128
-            RUN_STIG=1
1136
+            RUN_STIG="$1"
1129
             ;;
1137
             ;;
1130
         *)
1138
         *)
1131
             # unknown option
1139
             # unknown option
1140
 
1148
 
1141
 test_app_functions
1149
 test_app_functions
1142
 test_unique_onion_ports
1150
 test_unique_onion_ports
1151
+fix_stig
1143
 test_stig
1152
 test_stig
1144
 
1153
 
1145
 if [ ! $RUN_STIG ]; then
1154
 if [ ! $RUN_STIG ]; then