mirror of https://github.com/CISOfy/lynis.git
Use the data from machine ID when no SSH keys are available
This commit is contained in:
parent
78c9761c60
commit
ed45fe7b29
|
@ -1029,15 +1029,15 @@
|
|||
if [ ! -z "${STRING_TO_HASH}" ]; then
|
||||
# Create hashes
|
||||
if [ ! "${SHA256SUMBINARY}" = "" ]; then
|
||||
HASH_SSH=$(echo ${DATA_SSH} | ${SHA256SUMBINARY} | awk '{ print $1 }')
|
||||
HASH2=$(echo ${STRING_TO_HASH} | ${SHA256SUMBINARY} | awk '{ print $1 }')
|
||||
HASH_HOSTNAME=$(echo ${HOSTNAME} | ${SHA256SUMBINARY} | awk '{ print $1 }')
|
||||
elif [ ! "${OPENSSLBINARY}" = "" ]; then
|
||||
HASH_SSH=$(echo ${DATA_SSH} | ${OPENSSLBINARY} sha -sha256 | awk '{ print $2 }')
|
||||
HASH2=$(echo ${STRING_TO_HASH} | ${OPENSSLBINARY} sha -sha256 | awk '{ print $2 }')
|
||||
HASH_HOSTNAME=$(echo ${HOSTNAME} | ${OPENSSLBINARY} sha -sha256 | awk '{ print $2 }')
|
||||
fi
|
||||
LogText "Hash (hostname): ${HASH_HOSTNAME}"
|
||||
LogText "Hash (ssh): ${HASH_SSH}"
|
||||
HOSTID2="${HASH_SSH}"
|
||||
LogText "Hash (ssh or machineid): ${HASH2}"
|
||||
HOSTID2="${HASH2}"
|
||||
Report "hostid2=${HOSTID2}"
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue