freedombone-tests 38KB

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