freedombone-tests 37KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # Run tests on the system
  12. # License
  13. # =======
  14. #
  15. # Copyright (C) 2015-2018 Bob Mottram <bob@freedombone.net>
  16. #
  17. # This program is free software: you can redistribute it and/or modify
  18. # it under the terms of the GNU Affero General Public License as published by
  19. # the Free Software Foundation, either version 3 of the License, or
  20. # (at your option) any later version.
  21. #
  22. # This program is distributed in the hope that it will be useful,
  23. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. # GNU Affero General Public License for more details.
  26. #
  27. # You should have received a copy of the GNU Affero General Public License
  28. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. PROJECT_NAME='freedombone'
  30. export TEXTDOMAIN=${PROJECT_NAME}-tests
  31. export TEXTDOMAINDIR="/usr/share/locale"
  32. source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-setup
  33. # Whether to run STIG tests
  34. RUN_STIG=
  35. # Whether to show both passes and fails of STIG tests
  36. SHOW_ALL_TESTS=
  37. function show_help {
  38. echo ''
  39. echo $"${PROJECT_NAME}-tests"
  40. echo ''
  41. echo $'Runs tests on the system'
  42. echo ''
  43. echo $' --stig [yes|no|fix] Run STIG tests'
  44. echo $' --help Show help'
  45. echo ''
  46. exit 0
  47. }
  48. function test_app_function_type {
  49. filename=$1
  50. fn_type=$2
  51. app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
  52. app_function=$(grep "function ${fn_type}_${app_name} {" "${filename}" | awk -F "${fn_type}_" '{print $2}' | awk -F ' ' '{print $1}')
  53. if [ ! "${app_function}" ]; then
  54. echo $"Application ${app_name} does not contain a function called '${fn_type}_${app_name}'"
  55. echo ''
  56. echo "See ${filename}"
  57. exit 72852
  58. fi
  59. }
  60. function test_static_analysis {
  61. if [ ! -f /usr/bin/shellcheck ]; then
  62. apt-get -yq install shellcheck
  63. fi
  64. FILES="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-*"
  65. for filename in $FILES
  66. do
  67. if ! shellcheck --exclude SC2034,SC1090 "$filename"; then
  68. echo ''
  69. echo $"${filename} failed static analysis"
  70. exit 24687242
  71. fi
  72. done
  73. FILES="/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-*"
  74. for filename in $FILES
  75. do
  76. if ! shellcheck --exclude SC2034,SC1090 "$filename"; then
  77. echo ''
  78. echo $"${filename} failed static analysis"
  79. exit 3857395935
  80. fi
  81. done
  82. FILES="/usr/local/bin/${PROJECT_NAME}-*"
  83. for filename in $FILES
  84. do
  85. if ! shellcheck --exclude SC2034,SC1090 "$filename"; then
  86. echo ''
  87. echo $"${filename} failed static analysis"
  88. exit 784243468435
  89. fi
  90. done
  91. }
  92. function test_app_functions {
  93. if [ $RUN_STIG ]; then
  94. return
  95. fi
  96. FILES="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*"
  97. # check that these functions exist
  98. interface_functions=( install remove backup_local backup_remote restore_local restore_remote upgrade reconfigure )
  99. # for all the app scripts
  100. for filename in $FILES
  101. do
  102. # for each expected interface function
  103. for f in "${interface_functions[@]}"
  104. do
  105. test_app_function_type ${filename} "$f"
  106. done
  107. done
  108. }
  109. function test_unique_onion_ports {
  110. if [ $RUN_STIG ]; then
  111. return
  112. fi
  113. # test that some services are not assigned the same onion port
  114. FILES="src/${PROJECT_NAME}-app-*"
  115. ports=$(grep -r "_ONION_PORT=" "$FILES" | awk -F ':' '{print $2}' | uniq | awk -F '=' '{print $2}')
  116. unique_ports=$(grep -r "_ONION_PORT=" "$FILES" | awk -F ':' '{print $2}' | uniq | awk -F '=' '{print $2}' | uniq)
  117. if [[ "$ports" != "$unique_ports" ]]; then
  118. echo $'Some onion ports are clashing'
  119. grep -r "_ONION_PORT=" "$FILES" | awk -F ':' '{print $2}' | uniq
  120. exit 637252
  121. fi
  122. }
  123. function stig_log_msg {
  124. ESTATUS=$1
  125. RED=$(tput setaf 1)
  126. BOLD=$(tput bold)
  127. GREEN=$(tput setaf 2)
  128. NORMAL=$(tput sgr0)
  129. MSG="$2"
  130. if [ "$ESTATUS" -eq 0 ];then
  131. printf "%s %s" "$GREEN$BOLD[ PASS ]$NORMAL" "$MSG"
  132. echo
  133. else
  134. printf "%s %s" "$RED$BOLD[ FAIL ]$NORMAL" "$MSG"
  135. echo
  136. fi
  137. }
  138. function stig_spinner {
  139. local pid=$1
  140. local delay=0.1
  141. # shellcheck disable=SC2143
  142. while [ "$(ps -a | awk '{print $1}' | grep "$pid")" ];
  143. do
  144. sleep $delay
  145. done
  146. printf " \\b"
  147. wait "$1"
  148. }
  149. function disallow_package {
  150. package_name=$1
  151. if service --status-all | grep "+.*${package_name}";then
  152. apt-get -yq remove --purge "${package_name}"
  153. apt -yq autoremove
  154. fi
  155. }
  156. function fix_stig {
  157. if [[ $RUN_STIG != 'fix' ]]; then
  158. return
  159. fi
  160. disallow_package xinetd
  161. lockdown_permissions
  162. }
  163. function test_stig {
  164. if [ ! $RUN_STIG ]; then
  165. return
  166. fi
  167. STIG_TESTS_DIR=tests
  168. if [ ! -d $STIG_TESTS_DIR ]; then
  169. STIG_TESTS_DIR=~/${PROJECT_NAME}/tests
  170. if [ ! -d $STIG_TESTS_DIR ]; then
  171. echo $'No tests were found'
  172. exit 62725
  173. fi
  174. fi
  175. CATCOLOR=1
  176. SETLANG="en"
  177. source "$STIG_TESTS_DIR/output.sh"
  178. ##RHEL-06-000001
  179. ##The system must use a separate file system for /tmp.
  180. mount | grep "on /tmp " >/dev/null 2>&1 &
  181. stig_spinner $!
  182. output "V-38455" $? ${SETLANG}
  183. ################
  184. ##RHEL-06-000008
  185. ##Vendor-provided cryptographic certificates must be installed to verify the integrity of system software.
  186. bash $STIG_TESTS_DIR/check-apt-key.sh >/dev/null 2>&1 &
  187. stig_spinner $!
  188. output "V-38476" $? ${SETLANG}
  189. ################
  190. ##RHEL-06-000016
  191. ##A file integrity tool must be installed.
  192. dpkg -s tripwire >/dev/null 2>&1 &
  193. stig_spinner $!
  194. output "V-38489" $? ${SETLANG}
  195. ################
  196. ##RHEL-06-000019
  197. ##There must be no .rhosts or hosts.equiv files on the system.
  198. bash $STIG_TESTS_DIR/check-rhosts.sh > /dev/null 2>&1 &
  199. stig_spinner $!
  200. output "V-38491" $? ${SETLANG}
  201. ################
  202. ##RHEL-06-000027
  203. ##The system must prevent the root account from logging in from virtual consoles.
  204. bash $STIG_TESTS_DIR/check-consoles.sh virtual > /dev/null 2>&1 &
  205. stig_spinner $!
  206. output "V-38492" $? ${SETLANG}
  207. ################
  208. ##RHEL-06-000028
  209. ##The system must prevent the root account from logging in from serial consoles.
  210. bash $STIG_TESTS_DIR/check-consoles.sh serial > /dev/null 2>&1 &
  211. stig_spinner $!
  212. output "V-38494" $? ${SETLANG}
  213. ################
  214. ##RHEL-06-000029
  215. ##Default operating system accounts, other than root, must be locked.
  216. bash $STIG_TESTS_DIR/check-default-account.sh > /dev/null 2>&1 &
  217. stig_spinner $!
  218. output "V-38496" $? ${SETLANG}
  219. ################
  220. ##RHEL-06-000031
  221. ##The /etc/passwd file must not contain password hashes.
  222. awk -F: '($2 != "x") {print; err=1} END {exit err}' /etc/passwd > /dev/null 2>&1 &
  223. stig_spinner $!
  224. output "V-38499" $? ${SETLANG}
  225. ################
  226. ##RHEL-06-000032
  227. ##The root account must be the only account having a UID of 0.
  228. bash $STIG_TESTS_DIR/check-root-uid.sh > /dev/null 2>&1 &
  229. stig_spinner $!
  230. output "V-38500" $? ${SETLANG}
  231. ################
  232. ##RHEL-06-000033
  233. ##The /etc/shadow file must be owned by root.
  234. # shellcheck disable=SC2012
  235. ls -l /etc/shadow | awk '{print $3}' | grep "^root$" > /dev/null 2>&1 &
  236. stig_spinner $!
  237. output "V-38502" $? ${SETLANG}
  238. ################
  239. ##RHEL-06-000034
  240. ##The /etc/shadow file must be group-owned by root.
  241. # shellcheck disable=SC2012
  242. ls -l /etc/shadow | awk '{print $4}' | grep "^root$" > /dev/null 2>&1 &
  243. stig_spinner $!
  244. output "V-38503" $? ${SETLANG}
  245. ################
  246. ##RHEL-06-000035
  247. ##The /etc/shadow file must have mode 0000.
  248. # shellcheck disable=SC2012
  249. ls -l /etc/shadow | awk '{print $1}' | grep "^----------$" > /dev/null 2>&1 &
  250. stig_spinner $!
  251. output "V-38504" $? ${SETLANG}
  252. ################
  253. ##RHEL-06-000036
  254. ##The /etc/gshadow file must be owned by root.
  255. # shellcheck disable=SC2012
  256. ls -l /etc/gshadow | awk '{print $3}' | grep "^root$" > /dev/null 2>&1 &
  257. stig_spinner $!
  258. output "V-38443" $? ${SETLANG}
  259. ################
  260. ##RHEL-06-000037
  261. ##The /etc/gshadow file must be group-owned by root.
  262. # shellcheck disable=SC2012
  263. ls -l /etc/gshadow | awk '{print $4}' | grep "^root$" > /dev/null 2>&1 &
  264. stig_spinner $!
  265. output "V-38448" $? ${SETLANG}
  266. ################
  267. ##RHEL-06-000038
  268. ##The /etc/gshadow file must have mode 0000.
  269. # shellcheck disable=SC2012
  270. ls -l /etc/gshadow | awk '{print $1}' | grep "^----------$" > /dev/null 2>&1 &
  271. stig_spinner $!
  272. output "V-38449" $? ${SETLANG}
  273. ################
  274. ##RHEL-06-000039
  275. ##The /etc/passwd file must be owned by root.
  276. # shellcheck disable=SC2012
  277. ls -l /etc/passwd | awk '{print $3}' | grep "^root$" > /dev/null 2>&1 &
  278. stig_spinner $!
  279. output "V-38450" $? ${SETLANG}
  280. ################
  281. ##RHEL-06-000040
  282. ##The /etc/passwd file must be group-owned by root.
  283. # shellcheck disable=SC2012
  284. ls -l /etc/passwd | awk '{print $4}' | grep "^root$" > /dev/null 2>&1 &
  285. stig_spinner $!
  286. output "V-38451" $? ${SETLANG}
  287. ################
  288. ##RHEL-06-000041
  289. ##The /etc/passwd file must have mode 0644 or less permissive.
  290. bash $STIG_TESTS_DIR/check-mode.sh /etc/passwd 644 > /dev/null 2>&1 &
  291. stig_spinner $!
  292. output "V-38457" $? ${SETLANG}
  293. ################
  294. ##RHEL-06-000042
  295. ##The /etc/group file must be owned by root.
  296. # shellcheck disable=SC2012
  297. ls -l /etc/group | awk '{print $3}' | grep "^root$" > /dev/null 2>&1 &
  298. stig_spinner $!
  299. output "V-38458" $? ${SETLANG}
  300. ################
  301. ##RHEL-06-000043
  302. ##The /etc/group file must be group-owned by root.
  303. # shellcheck disable=SC2012
  304. ls -l /etc/group | awk '{print $4}' | grep "^root$" > /dev/null 2>&1 &
  305. stig_spinner $!
  306. output "V-38459" $? ${SETLANG}
  307. ################
  308. ##RHEL-06-000044
  309. ##The /etc/group file must have mode 0644 or less permissive.
  310. bash $STIG_TESTS_DIR/check-mode.sh "/etc/group" 644 > /dev/null 2>&1 &
  311. stig_spinner $!
  312. output "V-38461" $? ${SETLANG}
  313. ################
  314. ##RHEL-06-000045
  315. ##Library files must have mode 0755 or less permissive.
  316. bash $STIG_TESTS_DIR/check-libs-mode.sh > /dev/null 2>&1 &
  317. stig_spinner $!
  318. output "V-38465" $? ${SETLANG}
  319. ################
  320. ##RHEL-06-000046
  321. ##Library files must be owned by root.
  322. bash $STIG_TESTS_DIR/check-libs-owner.sh > /dev/null 2>&1 &
  323. stig_spinner $!
  324. output "V-38466" $? ${SETLANG}
  325. ################
  326. ##RHEL-06-000047
  327. ##All system command files must have mode 755 or less permissive.
  328. bash $STIG_TESTS_DIR/check-cmd-mode.sh > /dev/null 2>&1 &
  329. stig_spinner $!
  330. output "V-38469" $? ${SETLANG}
  331. ################
  332. ##RHEL-06-000048
  333. ##All system command files must be owned by root.
  334. bash $STIG_TESTS_DIR/check-cmd-owner.sh > /dev/null 2>&1 &
  335. stig_spinner $!
  336. output "V-38472" $? ${SETLANG}
  337. ################
  338. ##RHEL-06-000061
  339. ##The system must disable accounts after ten consecutive unsuccessful logon attempts.
  340. bash $STIG_TESTS_DIR/check-password.sh /etc/pam.d/common-auth pam_tally deny gt 10 > /dev/null 2>&1 &
  341. stig_spinner $!
  342. output "V-38573" $? ${SETLANG}
  343. ################
  344. ##RHEL-06-000062
  345. ##The system must use a FIPS 140-2 approved cryptographic hashing algorithm for generating account password hashes (system-auth).
  346. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/pam.d/* | grep password | grep pam_unix.so | grep sha512 > /dev/null 2>&1 &
  347. stig_spinner $!
  348. output "V-38574" $? ${SETLANG}
  349. ################
  350. ##RHEL-06-000063
  351. ##The system must use a FIPS 140-2 approved cryptographic hashing algorithm for generating account password hashes (login.defs).
  352. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep "ENCRYPT_METHOD.*SHA512" > /dev/null 2>&1 &
  353. stig_spinner $!
  354. output "V-38576" $? ${SETLANG}
  355. ################
  356. ##RHEL-06-000064
  357. ##The system must use a FIPS 140-2 approved cryptographic hashing algorithm for generating account password hashes (libuser.conf).
  358. bash $STIG_TESTS_DIR/check-depends.sh > /dev/null 2>&1 &
  359. stig_spinner $!
  360. output "V-38577" $? ${SETLANG}
  361. ################
  362. ##RHEL-06-000071
  363. ##The system must allow locking of the console screen in text mode.
  364. dpkg -s screen >/dev/null 2>&1 &
  365. stig_spinner $!
  366. output "V-38590" $? ${SETLANG}
  367. ################
  368. ##RHEL-06-000078
  369. ##The system must implement virtual address space randomization.
  370. bash $STIG_TESTS_DIR/check-sysctl.sh kernel.randomize_va_space ne 2 >/dev/null 2>&1 &
  371. stig_spinner $!
  372. output "V-38596" $? ${SETLANG}
  373. ################
  374. ##RHEL-06-000080
  375. ##The system must not send ICMPv4 redirects by default.
  376. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.default.send_redirects ne 0 >/dev/null 2>&1 &
  377. stig_spinner $!
  378. output "V-38600" $? ${SETLANG}
  379. ################
  380. ##RHEL-06-000081
  381. ##The system must not send ICMPv4 redirects from any interface.
  382. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.all.send_redirects ne 0 >/dev/null 2>&1 &
  383. stig_spinner $!
  384. output "V-38601" $? ${SETLANG}
  385. ################
  386. ##RHEL-06-000082
  387. ##IP forwarding for IPv4 must not be enabled, unless the system is a router.
  388. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.ip_forward ne 0 >/dev/null 2>&1 &
  389. stig_spinner $!
  390. output "V-38511" $? ${SETLANG}
  391. ################
  392. ##RHEL-06-000083
  393. ##The system must not accept IPv4 source-routed packets on any interface.
  394. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.all.accept_source_route ne 0 >/dev/null 2>&1 &
  395. stig_spinner $!
  396. output "V-38523" $? ${SETLANG}
  397. ################
  398. ##RHEL-06-000084
  399. ##The system must not accept ICMPv4 redirect packets on any interface.
  400. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.all.accept_redirects ne 0 >/dev/null 2>&1 &
  401. stig_spinner $!
  402. output "V-38524" $? ${SETLANG}
  403. ################
  404. ##RHEL-06-000086
  405. ##The system must not accept ICMPv4 secure redirect packets on any interface.
  406. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.all.secure_redirects ne 0 >/dev/null 2>&1 &
  407. stig_spinner $!
  408. output "V-38526" $? ${SETLANG}
  409. ################
  410. ##RHEL-06-000089
  411. ##The system must not accept IPv4 source-routed packets by default.
  412. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.default.accept_source_route ne 0 >/dev/null 2>&1 &
  413. stig_spinner $!
  414. output "V-38529" $? ${SETLANG}
  415. ################
  416. ##RHEL-06-000090
  417. ##The system must not accept ICMPv4 secure redirect packets by default.
  418. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.default.secure_redirects ne 0 >/dev/null 2>&1 &
  419. stig_spinner $!
  420. output "V-38532" $? ${SETLANG}
  421. ################
  422. ##RHEL-06-000091
  423. ##The system must ignore ICMPv4 redirect messages by default.
  424. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.default.accept_redirects ne 0 >/dev/null 2>&1 &
  425. stig_spinner $!
  426. output "V-38533" $? ${SETLANG}
  427. ################
  428. ##RHEL-06-000092
  429. ##The system must not respond to ICMPv4 sent to a broadcast address.
  430. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.icmp_echo_ignore_broadcasts ne 1 >/dev/null 2>&1 &
  431. stig_spinner $!
  432. output "V-38535" $? ${SETLANG}
  433. ################
  434. ##RHEL-06-000093
  435. ##The system must ignore ICMPv4 bogus error responses.
  436. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.icmp_ignore_bogus_error_responses ne 1 >/dev/null 2>&1 &
  437. stig_spinner $!
  438. output "V-38537" $? ${SETLANG}
  439. ################
  440. ##RHEL-06-000095
  441. ##The system must be configured to use TCP syncookies when experiencing a TCP SYN flood.
  442. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.tcp_syncookies ne 1 >/dev/null 2>&1 &
  443. stig_spinner $!
  444. output "V-38539" $? ${SETLANG}
  445. ################
  446. ##RHEL-06-000096
  447. ##The system must use a reverse-path filter for IPv4 network traffic when possible on all interfaces.
  448. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.all.rp_filter ne 1 >/dev/null 2>&1 &
  449. stig_spinner $!
  450. output "V-38542" $? ${SETLANG}
  451. ################
  452. ##RHEL-06-000097
  453. ##The system must use a reverse-path filter for IPv4 network traffic when possible by default.
  454. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv4.conf.default.rp_filter ne 1 >/dev/null 2>&1 &
  455. stig_spinner $!
  456. output "V-38544" $? ${SETLANG}
  457. ################
  458. ##RHEL-06-000099
  459. ##The system must ignore ICMPv6 redirects by default.
  460. ##If IPv6 is disabled, this is not applicable.
  461. if [ -a /proc/net/if_inet6 ];then
  462. bash $STIG_TESTS_DIR/check-sysctl.sh net.ipv6.conf.default.accept_redirects ne 1 >/dev/null 2>&1 &
  463. stig_spinner $!
  464. output "V-38548" $? ${SETLANG}
  465. fi
  466. ################
  467. ##RHEL-06-000120
  468. ##The systems local IPv4 firewall must implement a deny-all, allow-by-exception policy for inbound
  469. iptables -L INPUT | head -n1 | grep "INPUT.*DROP" >/dev/null 2>&1 &
  470. stig_spinner $!
  471. output "V-38513" $? ${SETLANG}
  472. ################
  473. ##RHEL-06-000138
  474. ##System logs must be rotated daily.
  475. bash $STIG_TESTS_DIR/check-logrotate.sh >/dev/null 2>&1 &
  476. stig_spinner $!
  477. output "V-38624" $? ${SETLANG}
  478. ################
  479. ##RHEL-06-000203
  480. ##The xinetd service must be disabled if no network services utilizing it are enabled.
  481. bash $STIG_TESTS_DIR/check-services.sh xinetd >/dev/null 2>&1 &
  482. stig_spinner $!
  483. output "V-38582" $? ${SETLANG}
  484. ################
  485. ##RHEL-06-000204
  486. ##The xinetd service must be uninstalled if no network services utilizing it are enabled.
  487. bash $STIG_TESTS_DIR/check-packages.sh xinetd >/dev/null 2>&1 &
  488. stig_spinner $!
  489. output "V-38584" $? ${SETLANG}
  490. ################
  491. ##RHEL-06-000206
  492. ##The telnet-server package must not be installed.
  493. bash $STIG_TESTS_DIR/check-packages.sh telnetd >/dev/null 2>&1 &
  494. stig_spinner $!
  495. output "V-38587" $? ${SETLANG}
  496. ################
  497. ##RHEL-06-000211
  498. ##The telnet daemon must not be running.
  499. bash $STIG_TESTS_DIR/check-services.sh telnetd >/dev/null 2>&1 &
  500. stig_spinner $!
  501. output "V-38589" $? ${SETLANG}
  502. ################
  503. ##RHEL-06-000213
  504. ##The rsh-server package must not be installed.
  505. bash $STIG_TESTS_DIR/check-packages.sh rsh-server >/dev/null 2>&1 &
  506. stig_spinner $!
  507. output "V-38591" $? ${SETLANG}
  508. ################
  509. ##RHEL-06-000214
  510. ##The rshd service must not be running.
  511. bash $STIG_TESTS_DIR/check-services.sh rshd >/dev/null 2>&1 &
  512. stig_spinner $!
  513. output "V-38594" $? ${SETLANG}
  514. ################
  515. ##RHEL-06-000216
  516. ##The rexecd service must not be running.
  517. bash $STIG_TESTS_DIR/check-services.sh rexecd >/dev/null 2>&1 &
  518. stig_spinner $!
  519. output "V-38598" $? ${SETLANG}
  520. ################
  521. ##RHEL-06-000218
  522. ##The rlogind service must not be running.
  523. bash $STIG_TESTS_DIR/check-services.sh rlogind >/dev/null 2>&1 &
  524. stig_spinner $!
  525. output "V-38602" $? ${SETLANG}
  526. ################
  527. ##RHEL-06-000220
  528. ##The NIS(ypserv) package must not be installed.
  529. bash $STIG_TESTS_DIR/check-packages.sh nis >/dev/null 2>&1 &
  530. stig_spinner $!
  531. output "V-38603" $? ${SETLANG}
  532. ################
  533. ##RHEL-06-000221
  534. ##The nis(ypbind) service must not be running.
  535. bash $STIG_TESTS_DIR/check-services.sh nis >/dev/null 2>&1 &
  536. stig_spinner $!
  537. output "V-38604" $? ${SETLANG}
  538. ################
  539. ##RHEL-06-000224
  540. ##The cron service must be running.
  541. bash $STIG_TESTS_DIR/check-services.sh cron >/dev/null 2>&1 &
  542. stig_spinner $!
  543. output "V-38605" $? ${SETLANG}
  544. ################
  545. ##RHEL-06-000227
  546. ##The SSH daemon must be configured to use only the SSHv2 protocol.
  547. bash $STIG_TESTS_DIR/check-ssh.sh Protocol >/dev/null 2>&1 &
  548. stig_spinner $!
  549. output "V-38607" $? ${SETLANG}
  550. ################
  551. ##RHEL-06-000230
  552. ##The SSH daemon must set a timeout interval on idle sessions.
  553. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep "ClientAliveInterval" >/dev/null 2>&1 &
  554. stig_spinner $!
  555. output "V-38608" $? ${SETLANG}
  556. ################
  557. ##RHEL-06-000231
  558. ##The SSH daemon must set a timeout count on idle sessions.
  559. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep "ClientAliveCountMax" >/dev/null 2>&1 &
  560. stig_spinner $!
  561. output "V-38610" $? ${SETLANG}
  562. ################
  563. ##RHEL-06-000234
  564. ##The SSH daemon must ignore .rhosts files.
  565. bash $STIG_TESTS_DIR/check-ssh.sh rhosts >/dev/null 2>&1 &
  566. stig_spinner $!
  567. output "V-38611" $? ${SETLANG}
  568. ################
  569. ##RHEL-06-000236
  570. ##The SSH daemon must not allow host-based authentication.
  571. bash $STIG_TESTS_DIR/check-ssh.sh hostauth >/dev/null 2>&1 &
  572. stig_spinner $!
  573. output "V-38612" $? ${SETLANG}
  574. ################
  575. ##RHEL-06-000237
  576. ##The system must not permit root logins using remote access programs such as ssh.
  577. bash $STIG_TESTS_DIR/check-ssh.sh permitroot >/dev/null 2>&1 &
  578. stig_spinner $!
  579. output "V-38613" $? ${SETLANG}
  580. ################
  581. ##RHEL-06-000239
  582. ##The SSH daemon must not allow authentication using an empty password.
  583. bash $STIG_TESTS_DIR/check-ssh.sh emptypassword >/dev/null 2>&1 &
  584. stig_spinner $!
  585. output "V-38615" $? ${SETLANG}
  586. ################
  587. ##RHEL-06-000241
  588. ##The SSH daemon must not permit user environment settings.
  589. bash $STIG_TESTS_DIR/check-ssh.sh emptypasswordenvironment >/dev/null 2>&1 &
  590. stig_spinner $!
  591. output "V-38616" $? ${SETLANG}
  592. ################
  593. ##A FIPS 140-2 approved cryptographic algorithm must be used for SSH communications.
  594. bash $STIG_TESTS_DIR/check-ssh.sh ciphers >/dev/null 2>&1 &
  595. stig_spinner $!
  596. output "SV-86845r2_rule" $? ${SETLANG}
  597. ################
  598. ##The Standard Notice must be displayed immediately prior to, or as part of, remote access logon prompts.
  599. bash $STIG_TESTS_DIR/check-ssh.sh banner >/dev/null 2>&1 &
  600. stig_spinner $!
  601. output "SV-86849r2_rule" $? ${SETLANG}
  602. ################
  603. ##All networked systems must use SSH for confidentiality and integrity of transmitted and received information as well as information during preparation for transmission.
  604. bash $STIG_TESTS_DIR/check-ssh.sh sshd_status >/dev/null 2>&1 &
  605. stig_spinner $!
  606. output "SV-86859r2_rule" $? ${SETLANG}
  607. ################
  608. ##All network connections associated with SSH traffic must terminate at the end of the session or after 10 minutes of inactivity, except to fulfill documented and validated mission requirements.
  609. bash $STIG_TESTS_DIR/check-ssh.sh ClientAliveInterval >/dev/null 2>&1 &
  610. stig_spinner $!
  611. output "SV-86861r2_rule" $? ${SETLANG}
  612. ################
  613. ##The SSH daemon must not allow authentication using RSA rhosts authentication.
  614. bash $STIG_TESTS_DIR/check-ssh.sh RhostsRSAAuthentication >/dev/null 2>&1 &
  615. stig_spinner $!
  616. output "SV-86863r2_rule" $? ${SETLANG}
  617. ################
  618. ##All network connections associated with SSH traffic must terminate after a period of inactivity.
  619. bash $STIG_TESTS_DIR/check-ssh.sh ClientAliveCountMax >/dev/null 2>&1 &
  620. stig_spinner $!
  621. output "SV-86865r2_rule" $? ${SETLANG}
  622. ################
  623. ##The SSH daemon must not allow authentication using rhosts authentication.
  624. bash $STIG_TESTS_DIR/check-ssh.sh IgnoreRhosts >/dev/null 2>&1 &
  625. stig_spinner $!
  626. output "SV-86867r2_rule" $? ${SETLANG}
  627. ################
  628. ##The system must display the date and time of the last successful account logon upon an SSH logon.
  629. bash $STIG_TESTS_DIR/check-ssh.sh PrintLastLog >/dev/null 2>&1 &
  630. stig_spinner $!
  631. output "SV-86869r2_rule" $? ${SETLANG}
  632. ################
  633. ##The system must not permit direct logons to the root account using remote access via SSH.
  634. bash $STIG_TESTS_DIR/check-ssh.sh permitroot >/dev/null 2>&1 &
  635. stig_spinner $!
  636. output "SV-86871r2_rule" $? ${SETLANG}
  637. ################
  638. ##The SSH daemon must not allow authentication using known hosts authentication.
  639. bash $STIG_TESTS_DIR/check-ssh.sh IgnoreUserKnownHosts >/dev/null 2>&1 &
  640. stig_spinner $!
  641. output "SV-86873r2_rule" $? ${SETLANG}
  642. ################
  643. ##The SSH daemon must be configured to only use the SSHv2 protocol.
  644. bash $STIG_TESTS_DIR/check-ssh.sh Protocol >/dev/null 2>&1 &
  645. stig_spinner $!
  646. output "SV-86875r2_rule" $? ${SETLANG}
  647. ################
  648. ##The SSH daemon must be configured to only use Message Authentication Codes (MACs) employing FIPS 140-2 approved cryptographic hash algorithms.
  649. bash $STIG_TESTS_DIR/check-ssh.sh macs >/dev/null 2>&1 &
  650. stig_spinner $!
  651. output "SV-86877r2_rule" $? ${SETLANG}
  652. ################
  653. ##The SSH public host key files must have mode 0644 or less permissive.
  654. bash $STIG_TESTS_DIR/check-ssh.sh pubkeypermissive >/dev/null 2>&1 &
  655. stig_spinner $!
  656. output "SV-86879r1_rule" $? ${SETLANG}
  657. ################
  658. ##The SSH private host key files must have mode 0600 or less permissive.
  659. bash $STIG_TESTS_DIR/check-ssh.sh hostkeypermissive >/dev/null 2>&1 &
  660. stig_spinner $!
  661. output "SV-86881r1_rule" $? ${SETLANG}
  662. ################
  663. ##The SSH daemon must not permit Generic Security Service Application Program Interface (GSSAPI) authentication unless needed.
  664. bash $STIG_TESTS_DIR/check-ssh.sh GSSAPIAuthentication >/dev/null 2>&1 &
  665. stig_spinner $!
  666. output "SV-86883r2_rule" $? ${SETLANG}
  667. ################
  668. ##The SSH daemon must not permit Kerberos authentication unless needed.
  669. bash $STIG_TESTS_DIR/check-ssh.sh KerberosAuthentication >/dev/null 2>&1 &
  670. stig_spinner $!
  671. output "SV-86885r2_rule" $? ${SETLANG}
  672. ################
  673. ##The SSH daemon must perform strict mode checking of home directory configuration files.
  674. bash $STIG_TESTS_DIR/check-ssh.sh StrictModes >/dev/null 2>&1 &
  675. stig_spinner $!
  676. output "SV-86887r2_rule" $? ${SETLANG}
  677. ################
  678. ##The SSH daemon must use privilege separation.
  679. bash $STIG_TESTS_DIR/check-ssh.sh UsePrivilegeSeparation >/dev/null 2>&1 &
  680. stig_spinner $!
  681. output "SV-86889r2_rule" $? ${SETLANG}
  682. ################
  683. ##The SSH daemon must not allow compression or must only allow compression after successful authentication.
  684. bash $STIG_TESTS_DIR/check-ssh.sh Compression >/dev/null 2>&1 &
  685. stig_spinner $!
  686. output "SV-86891r2_rule" $? ${SETLANG}
  687. ################
  688. ##Dont allow remote X connections.
  689. bash $STIG_TESTS_DIR/check-ssh.sh X11Forwarding >/dev/null 2>&1 &
  690. stig_spinner $!
  691. output "SV-86927r2_rule" $? ${SETLANG}
  692. ################
  693. ##Check that pam_python is not installed
  694. bash $STIG_TESTS_DIR/check-ssh.sh pam_python >/dev/null 2>&1 &
  695. stig_spinner $!
  696. output "SV-86724r2_rule" $? ${SETLANG}
  697. ################
  698. ##RHEL-06-000247
  699. ##The system clock must be synchronized continuously, or at least daily.
  700. bash $STIG_TESTS_DIR/check-services.sh ntp >/dev/null 2>&1 &
  701. stig_spinner $!
  702. output "V-38620" $? ${SETLANG}
  703. ################
  704. ##RHEL-06-000248
  705. ##The system clock must be synchronized to an authoritative time source.
  706. bash $STIG_TESTS_DIR/check-ntp-sources.sh >/dev/null 2>&1 &
  707. stig_spinner $!
  708. output "V-38621" $? ${SETLANG}
  709. ################
  710. ##RHEL-06-000252
  711. ##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.
  712. #Waiting to figure out
  713. #stig_spinner $!
  714. #output "V-38625" $? ${SETLANG}
  715. ################
  716. ##RHEL-06-000253
  717. ##The LDAP client must use a TLS connection using trust certificates signed by the site CA.
  718. #Waiting to figure out
  719. #stig_spinner $!
  720. #output "V-38626" $? ${SETLANG}
  721. ################
  722. ##RHEL-06-000256
  723. ##The openldap-servers package must not be installed unless required.
  724. bash $STIG_TESTS_DIR/check-packages.sh sldap>/dev/null 2>&1 &
  725. stig_spinner $!
  726. output "V-38627" $? ${SETLANG}
  727. ################
  728. ##RHEL-06-000257
  729. ##The graphical desktop environment must set the idle timeout to no more than 15 minutes.
  730. #stig_spinner $!
  731. #output "V-38629" $? ${SETLANG}
  732. ################
  733. ##RHEL-06-000258
  734. ##The graphical desktop environment must automatically lock after 15 minutes of inactivity and the system must require user reauthentication to unlock the environment.
  735. #stig_spinner $!
  736. #output "V-38630" $? ${SETLANG}
  737. ################
  738. ##RHEL-06-000259
  739. ##The graphical desktop environment must have automatic lock enabled.
  740. #stig_spinner $!
  741. #output "V-38638" $? ${SETLANG}
  742. ################
  743. ##RHEL-06-000260
  744. ##The system must display a publicly-viewable pattern during a graphical desktop environment session lock.
  745. #stig_spinner $!
  746. #output "V-38639" $? ${SETLANG}
  747. ################
  748. ##RHEL-06-000262
  749. ##The atd service must be disabled.
  750. bash $STIG_TESTS_DIR/check-services.sh atd >/dev/null 2>&1 &
  751. stig_spinner $!
  752. output "V-38641" $? ${SETLANG}
  753. ################
  754. ##RHEL-06-000271
  755. ##The noexec option must be added to removable media partitions.
  756. if [ "$(grep -Hv ^0$ /sys/block/*/removable | sed s/removable:.*$/device\\/uevent/ | xargs grep -H ^DRIVER=sd | sed s/device.uevent.*$/size/ | xargs grep -Hv ^0$ | cut -d / -f 4 | wc -l)" -gt 0 ];then
  757. bash $STIG_TESTS_DIR/check-removable.sh >/dev/null 2>&1 &
  758. stig_spinner $!
  759. output "V-38655" $? ${SETLANG}
  760. fi
  761. ################
  762. ##RHEL-06-000272
  763. ##The system must use SMB client signing for connecting to samba servers using smbclient.
  764. bash $STIG_TESTS_DIR/check-depends.sh smb-signing >/dev/null 2>&1 &
  765. stig_spinner $!
  766. output "V-38656" $? ${SETLANG}
  767. ################
  768. ##RHEL-06-000273
  769. ##The system must use SMB client signing for connecting to samba servers using mount.cifs.
  770. bash $STIG_TESTS_DIR/check-depends.sh smb-sec >/dev/null 2>&1 &
  771. stig_spinner $!
  772. output "V-38657" $? ${SETLANG}
  773. ################
  774. ##RHEL-06-000282
  775. ##There must be no world-writable files on the system.
  776. bash $STIG_TESTS_DIR/check-world-writable.sh >/dev/null 2>&1 &
  777. stig_spinner $!
  778. output "V-38643" $? ${SETLANG}
  779. ################
  780. ##RHEL-06-000286
  781. ##The x86 Ctrl-Alt-Delete key sequence must be disabled.
  782. bash $STIG_TESTS_DIR/check-ctrl-alt-del.sh >/dev/null 2>&1 &
  783. stig_spinner $!
  784. output "V-38668" $? ${SETLANG}
  785. ################
  786. ##RHEL-06-000288
  787. ##The sendmail package must be removed.
  788. bash $STIG_TESTS_DIR/check-packages.sh sendmail >/dev/null 2>&1 &
  789. stig_spinner $!
  790. output "V-38671" $? ${SETLANG}
  791. ################
  792. ##RHEL-06-000290
  793. ##X Windows must not be enabled unless required.
  794. bash $STIG_TESTS_DIR/check-services.sh x11-common >/dev/null 2>&1 &
  795. stig_spinner $!
  796. output "V-38674" $? ${SETLANG}
  797. ################
  798. ##RHEL-06-000302
  799. ##A file integrity tool must be used at least weekly to check for unauthorized file changes, particularly the addition of unauthorized system libraries or binaries, or for unauthorized modification to authorized system libraries or binaries.
  800. bash $STIG_TESTS_DIR/check-tripwire-cron.sh > /dev/null 2>&1 &
  801. stig_spinner $!
  802. output "V-38695" $? ${SETLANG}
  803. ################
  804. ##RHEL-06-000018
  805. #For tripwire to be effective, an initial database of "known-good" information about files must be captured and it should be able to be verified against the installed files.
  806. bash $STIG_TESTS_DIR/check-tripwire-baseline.sh > /dev/null 2>&1 &
  807. stig_spinner $!
  808. output "V-51391" $? ${SETLANG}
  809. ################
  810. ##RHEL-06-000308
  811. ##Process core dumps must be disabled unless needed.
  812. bash $STIG_TESTS_DIR/check-limits.sh core-dumps > /dev/null 2>&1 &
  813. stig_spinner $!
  814. output "V-38675" $? ${SETLANG}
  815. ################
  816. ##RHEL-06-000319
  817. ##The system must limit users to 10 simultaneous system logins, or a site-defined number, in accordance with operational requirements.
  818. bash $STIG_TESTS_DIR/check-limits.sh maxlogins > /dev/null 2>&1 &
  819. stig_spinner $!
  820. output "V-38684" $? ${SETLANG}
  821. ################
  822. ##RHEL-06-000320
  823. ##The systems local firewall must implement a deny-all, allow-by-exception policy for forwarded packets.
  824. iptables -L FORWARD | head -n1 | grep "FORWARD.*DROP" >/dev/null 2>&1 &
  825. stig_spinner $!
  826. output "V-38686" $? ${SETLANG}
  827. ################
  828. ##RHEL-06-000331
  829. ##The Bluetooth service must be disabled.
  830. bash $STIG_TESTS_DIR/check-services.sh bluetooth >/dev/null 2>&1 &
  831. stig_spinner $!
  832. output "V-38691" $? ${SETLANG}
  833. ################
  834. ##RHEL-06-000336
  835. ##The sticky bit must be set on all public directories.
  836. bash $STIG_TESTS_DIR/check-sticky-bit.sh >/dev/null 2>&1 &
  837. stig_spinner $!
  838. output "V-38697" $? ${SETLANG}
  839. ################
  840. ##RHEL-06-000337
  841. ##All public directories must be owned by a system account.
  842. bash $STIG_TESTS_DIR/check-public-dir-owned.sh >/dev/null 2>&1 &
  843. stig_spinner $!
  844. output "V-38699" $? ${SETLANG}
  845. ################
  846. ##RHEL-06-000345
  847. ##The system default umask in /etc/login.defs must be 077.
  848. ##For more detial :http://stackoverflow.com/questions/10220531/how-to-set-system-wide-umask
  849. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep -i "umask.*077" >/dev/null 2>&1 &
  850. stig_spinner $!
  851. output "V-38645" $? ${SETLANG}
  852. ################
  853. ##RHEL-06-000347
  854. ##There must be no .netrc files on the system.
  855. bash $STIG_TESTS_DIR/check-netrc.sh >/dev/null 2>&1 &
  856. stig_spinner $!
  857. output "V-38619" $? ${SETLANG}
  858. ################
  859. ##RHEL-06-000372
  860. ##The operating system, upon successful logon/access, must display to the user the number of unsuccessful logon/access attempts since the last successful logon/access.
  861. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/pam.d/common-session | grep -i "pam_lastlog.so.*showfailed" > /dev/null 2>&1 &
  862. stig_spinner $!
  863. output "V-38501" $? ${SETLANG}
  864. ################
  865. ##RHEL-06-000507
  866. ##The operating system, upon successful logon, must display to the user the date and time of the last logon or access via ssh.
  867. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/ssh/sshd_config | grep -i "^PrintLastLog.*yes" > /dev/null 2>&1 &
  868. stig_spinner $!
  869. output "V-38484" $? ${SETLANG}
  870. ################
  871. ##RHEL-06-000514
  872. ##The package management tool must cryptographically verify the authenticity of all software packages during installation.
  873. bash $STIG_TESTS_DIR/check-apt-gpg.sh > /dev/null 2>&1 &
  874. stig_spinner $!
  875. output "V-38462" $? ${SETLANG}
  876. ################
  877. ##RHEL-06-000523
  878. ##The systems local IPv6 firewall must implement a deny-all, allow-by-exception policy for inbound packets.
  879. ip6tables -L INPUT | head -n1 | grep "INPUT.*DROP" > /dev/null 2>&1 &
  880. stig_spinner $!
  881. output "V-38444" $? ${SETLANG}
  882. ################
  883. ##RHEL-06-000526
  884. ##Automated file system mounting tools must not be enabled unless needed.
  885. bash $STIG_TESTS_DIR/check-services.sh autofs >/dev/null 2>&1 &
  886. stig_spinner $!
  887. output "V-38437" $? ${SETLANG}
  888. ################
  889. ##RHEL-06-000528
  890. ##The noexec option must be added to the /tmp partition.
  891. sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/fstab | grep "/tmp.*noexec" >/dev/null 2>&1 &
  892. stig_spinner $!
  893. output "V-57569" $? ${SETLANG}
  894. ################
  895. ##RHEL-06-000529
  896. ##The sudo command must require authentication.
  897. bash $STIG_TESTS_DIR/check-sudo.sh >/dev/null 2>&1 &
  898. stig_spinner $!
  899. output "V-58901" $? ${SETLANG}
  900. ################
  901. show_passes_fails=
  902. if [ $SHOW_ALL_TESTS ]; then
  903. show_passes_fails=1
  904. else
  905. if [ "$FAILS" -gt 0 ]; then
  906. show_passes_fails=1
  907. fi
  908. fi
  909. if [ $show_passes_fails ]; then
  910. echo ''
  911. echo $"Passes: $PASSES"
  912. echo $"Fails: $FAILS"
  913. if [ "$FAILS" -gt 0 ]; then
  914. exit 792353
  915. fi
  916. fi
  917. }
  918. while [ $# -gt 1 ]
  919. do
  920. key="$1"
  921. case $key in
  922. -h|--help)
  923. show_help
  924. ;;
  925. -s|--stig)
  926. shift
  927. if [[ "$1" == 'showall' ]]; then
  928. SHOW_ALL_TESTS=1
  929. fi
  930. RUN_STIG="$1"
  931. ;;
  932. *)
  933. # unknown option
  934. ;;
  935. esac
  936. shift
  937. done
  938. if [ ! "$RUN_STIG" ]; then
  939. echo $'Running tests'
  940. fi
  941. test_app_functions
  942. test_static_analysis
  943. test_unique_onion_ports
  944. remove_management_engine_interface
  945. freedombone-pass --test yes
  946. fix_stig
  947. test_stig
  948. if [ ! $RUN_STIG ]; then
  949. echo $'All tests passed'
  950. fi
  951. exit 0