Change text of AppArmor test and add more details to report

This commit is contained in:
Michael Boelen 2016-08-22 12:12:38 +02:00
parent 5debe001f1
commit c061d31bde
1 changed files with 11 additions and 6 deletions

View File

@ -61,20 +61,25 @@
MAC_FRAMEWORK_ACTIVE=1
LogText "Result: AppArmor is enabled and a policy is loaded"
Display --indent 4 --text "- Checking AppArmor status" --result "${STATUS_ENABLED}" --color GREEN
elif [ ${FIND} -eq 4 ]; then
Report "apparmor_enabled=1"
Report "apparmor_policy_loaded=1"
elif [ ${FIND} -eq 4 ]; then
LogText "Result: Can not determine status, most likely due to lacking permissions"
Display --indent 4 --text "- Checking AppArmor status" --result "${STATUS_UNKNOWN}" --color RED
elif [ ${FIND} -eq 3 ]; then
elif [ ${FIND} -eq 3 ]; then
LogText "Result: Can not check control files"
Display --indent 4 --text "- Checking AppArmor status" --result "${STATUS_UNKNOWN}" --color RED
elif [ ${FIND} -eq 2 ]; then
elif [ ${FIND} -eq 2 ]; then
LogText "Result: AppArmor is enabled, but no policy is loaded"
ReportSuggestion ${TEST_NO} "Disable AppArmor or load a policy"
ReportSuggestion ${TEST_NO} "Load AppArmor policies"
Display --indent 4 --text "- Checking AppArmor status" --result "NON-ACTIVE" --color GREEN
elif [ ${FIND} -eq 1 ]; then
Report "apparmor_enabled=1"
Report "apparmor_policy_loaded=0"
elif [ ${FIND} -eq 1 ]; then
LogText "Result: AppArmor is disabled"
Display --indent 4 --text "- Checking AppArmor status" --result "${STATUS_DISABLED}" --color YELLOW
else
Report "apparmor_enabled=0"
else
Display --indent 4 --text "- Checking AppArmor status" --result "${STATUS_UNKNOWN}" --color RED
ReportException "${TEST_NO}:1" "Invalid or unknown AppArmor status detected"
fi