mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-23 13:54:35 +02:00
Capture self-signed certificates during upload with cURL
This commit is contained in:
parent
0379bab6c1
commit
c153344240
@ -119,13 +119,20 @@ output "Settings file: ${SETTINGS_FILE}"
|
|||||||
# Try to connect
|
# Try to connect
|
||||||
output "Uploading data.."
|
output "Uploading data.."
|
||||||
logtext "Command used: ${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}"
|
logtext "Command used: ${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}"
|
||||||
UPLOAD=`${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL}`
|
UPLOAD=`${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL} 2> /dev/null`
|
||||||
if [ $? -gt 0 ]; then
|
EXITCODE=$?
|
||||||
|
if [ ${EXITCODE} -gt 0 ]; then
|
||||||
|
if [ ${EXITCODE} -eq 60 ]; then
|
||||||
|
output "${RED}Self-signed certificate used on Lynis Enterprise node${NORMAL}"
|
||||||
|
output "If you want to accept a self-signed certificate, use the -k option in the profile."
|
||||||
|
output "Example: ${WHITE}config:upload_options:-k:${NORMAL}"
|
||||||
|
else
|
||||||
#UPLOAD_CODE=`echo ${UPLOAD} | head -n 1 | awk '{ print $2 }'`
|
#UPLOAD_CODE=`echo ${UPLOAD} | head -n 1 | awk '{ print $2 }'`
|
||||||
#output "Output code from upload: ${UPLOAD_CODE}"
|
#output "Output code from upload: ${UPLOAD_CODE}"
|
||||||
output "${RED}Error occurred, please check documentation for code ${UPLOAD_CODE}.${NORMAL}"
|
output "${RED}Error occurred, please check documentation for code ${UPLOAD_CODE}.${NORMAL}"
|
||||||
output "Debug:"
|
output "Debug:"
|
||||||
output ${UPLOAD}
|
output ${UPLOAD}
|
||||||
|
fi
|
||||||
# Quit
|
# Quit
|
||||||
ExitClean
|
ExitClean
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user