diff options
author | Kamil Boratyński <kamil.boratynski@icloud.com> | 2015-12-01 03:18:46 +0300 |
---|---|---|
committer | Kamil Boratyński <kamil.boratynski@icloud.com> | 2015-12-01 03:18:46 +0300 |
commit | c1c0d722d03eb7a1b69b97de6d3babae35e2d31d (patch) | |
tree | d5eb31ff55c824f870133738f1c420440d7ad249 /include/tests_storage | |
parent | c79a1ea3a42e31f9c0be3a538f4aadeb7c2546e3 (diff) |
Implemented ISSUE: #11
Test [STRG-1840] checks authorization.
Diffstat (limited to 'include/tests_storage')
-rw-r--r-- | include/tests_storage | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/tests_storage b/include/tests_storage index 5d84e118..2123c01f 100644 --- a/include/tests_storage +++ b/include/tests_storage @@ -60,6 +60,34 @@ Display --indent 2 --text "- Checking usb-storage driver (modprobe config)" --result "DISABLED" --color GREEN AddHP 3 3 fi + + + logtext "Test: Checking USB devices authorization to connect to the system" + FOUND=0 + USBDEVICESPATH="/sys/bus/usb/devices/usb" + for device in "${USBDEVICESPATH}"*; do + if [ -e "${device}/authorized" ] || [ -e "${device}/authorized_default" ]; then + if [ `cat "${device}/authorized_default"` -eq 1 ]; then + FOUND=1 + logtext "Test: ${device} is authorized by default" + elif [ `cat "${device}/authorized"` -eq 1 ]; then + FOUND=1 + logtext "Test: ${device} is authorized for now" + fi + fi + done + + if [ ${FOUND} -eq 1 ]; then + logtext "Result: Some USB devices are authorized by default or temporary to connect to the system" + Display --indent 2 --text "- Checking USB devices authorization" --result "ENABLED" --color RED + ReportSuggestion ${TEST_NO} "Disable USB devices authorization, to prevent unauthorized storage or data theft" + AddHP 0 3 + else + logtext "Result: None USB devices are authorized by default or temporary to connect to the system" + Display --indent 2 --text "- Checking USB devices authorization" --result "DISABLED" --color GREEN + AddHP 3 3 + fi + fi # ################################################################################# |