Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2016-04-13 10:09:52 +0300
committermboelen <michael@cisofy.com>2016-04-13 10:09:52 +0300
commit0288c6df34b8f663ceb6da279e8fc427313b87db (patch)
tree1939fd07aa5feff7e25948f51a4f521bf9a9eddd /include/data_upload
parent3b3a852122be37ca986c9496f594e706dc3beaf0 (diff)
Enhanced error handling during license check
Diffstat (limited to 'include/data_upload')
-rw-r--r--include/data_upload57
1 files changed, 38 insertions, 19 deletions
diff --git a/include/data_upload b/include/data_upload
index aa21deb6..c90a3104 100644
--- a/include/data_upload
+++ b/include/data_upload
@@ -124,24 +124,43 @@ output "Settings file: ${SETTINGS_FILE}"
EXITCODE=$?
if [ ${EXITCODE} -gt 0 ]; then
LogText "Exit code: ${EXITCODE}"
- if [ ${EXITCODE} -eq 5 ]; then
- LogText "Result: could not resolve the defined proxy server (${UPLOAD_PROXY_SERVER})."
- LogText "Suggestion: check if the proxy is properly defined in the profile."
- echo "${RED}Error${NORMAL}: could not use the defined proxy (${UPLOAD_PROXY_SERVER}). See ${LOGFILE} for details."
- elif [ ${EXITCODE} -eq 7 ]; then
- LogText "Result: could not contact license server."
- LogText "Details: used URL ${LICENSE_SERVER_URL}"
- LogText "Suggestion: check if the upload host is correctly configured."
- echo "${RED}Error${NORMAL}: license server not available. See ${LOGFILE} for details."
- elif [ ${EXITCODE} -eq 60 ]; then
- echo "${RED}Self-signed certificate used on Lynis Enterprise node${NORMAL}"
- echo "If you want to accept a self-signed certificate, use the -k option in the profile."
- echo "Example: ${WHITE}config:upload_options:-k:${NORMAL}"
- LogText "Result: found self-signed certificate, however cURL -k option not used."
- else
- echo "${RED}Upload Error: ${NORMAL}cURL exited with code ${EXITCODE}. See ${LOGFILE} for details."
- LogText "Result: cURL exited with code ${EXITCODE}."
- fi
+
+ echo ""
+ echo "${RED}Upload Error${NORMAL}: License could not be checked. See ${LOGFILE} for details."
+ echo "Suggested command: tail -n 20 ${LOGFILE}"
+ echo ""
+
+ case ${EXITCODE} in
+ 5)
+ LogText "Result: could not resolve the defined proxy server (${UPLOAD_PROXY_SERVER})."
+ LogText "Suggestion: check if the proxy is properly defined in the profile."
+ echo "${RED}Error${NORMAL}: could not use the defined proxy (${UPLOAD_PROXY_SERVER}). See ${LOGFILE} for details."
+ ;;
+ 6)
+ echo "${YELLOW}Error (6): ${NORMAL}Could not resolve the hostname of central server."
+ ;;
+ 7)
+ LogText "Result: could not contact license server."
+ LogText "Details: used URL ${LICENSE_SERVER_URL}"
+ LogText "Suggestion: check if the upload host is correctly configured."
+ echo "${RED}Error${NORMAL}: license server not available. See ${LOGFILE} for details."
+ ;;
+ 59)
+ echo "${YELLOW}Error (59): ${NORMAL}Could not connect because of used SSL cipher."
+ LogText "Result: SSL cipher used is not understood or accepted."
+ ;;
+ 60)
+ echo "${RED}Self-signed certificate used on Lynis Enterprise node${NORMAL}"
+ echo "If you want to accept a self-signed certificate, use the -k option in the profile."
+ echo "Example: ${WHITE}config:upload_options:-k:${NORMAL}"
+ LogText "Result: found self-signed certificate, however cURL -k option not used."
+ ;;
+ 83) echo "${YELLOW}Error (83): ${NORMAL}Could not check used certificate of server." ;;
+ *)
+ echo "${RED}Upload Error: ${NORMAL}cURL exited with code ${EXITCODE}. See ${LOGFILE} for details."
+ LogText "Result: cURL exited with code ${EXITCODE}. See man page of cURL for the meaning of this code."
+ ;;
+ esac
LogText "Result: quitting, can't check license"
ExitFatal
fi
@@ -195,7 +214,7 @@ output "Settings file: ${SETTINGS_FILE}"
# Quit
ExitClean
else
- Display --indent 2 --text "Data upload status" --status OK --color GREEN
+ Display --indent 2 --text "Data upload status" --result OK --color GREEN
fi
else
echo "${RED}Error${NORMAL}: No hostid found in report file. Can not upload report file."