mirror of
https://github.com/CISOfy/lynis.git
synced 2025-09-25 02:47:48 +02:00
Add host identifier options and use manual configured setting in function
This commit is contained in:
parent
1f80c000cc
commit
5e9253e8f4
@ -417,6 +417,12 @@ ssl-certificate-paths=/etc/apache2:/etc/dovecot:/etc/httpd:/etc/letsencrypt:/etc
|
|||||||
# This is useful for ephemeral systems which are short-lived.
|
# This is useful for ephemeral systems which are short-lived.
|
||||||
#allow-auto-purge=yes
|
#allow-auto-purge=yes
|
||||||
|
|
||||||
|
# Sometimes it might be useful to override the host identifiers.
|
||||||
|
# Use only hexadecimal values (0-9, a-f), with 40 and 64 characters in length.
|
||||||
|
#
|
||||||
|
#hostid=40-char-hash
|
||||||
|
#hostid2=64-char-hash
|
||||||
|
|
||||||
# Proxy settings
|
# Proxy settings
|
||||||
# Protocol (http, https, socks5)
|
# Protocol (http, https, socks5)
|
||||||
#proxy-protocol=https
|
#proxy-protocol=https
|
||||||
|
@ -804,11 +804,17 @@
|
|||||||
# Name : GetHostID()
|
# Name : GetHostID()
|
||||||
# Description : Create an unique id for the system
|
# Description : Create an unique id for the system
|
||||||
#
|
#
|
||||||
# Returns : Nothing
|
# Returns : optional value
|
||||||
# Usage : GetHostID
|
# Usage : GetHostID
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
GetHostID() {
|
GetHostID() {
|
||||||
|
|
||||||
|
if [ ! -z "${HOSTID}" -a ! -z "${HOSTID2}" ]; then
|
||||||
|
Debug "Skipping creation of host identifiers, as they are already configured (via profile)"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
FIND=""
|
FIND=""
|
||||||
# Avoid some hashes (empty, only zeros)
|
# Avoid some hashes (empty, only zeros)
|
||||||
BLACKLISTED_HASHES="6ef1338f520d075957424741d7ed35ab5966ae97 adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"
|
BLACKLISTED_HASHES="6ef1338f520d075957424741d7ed35ab5966ae97 adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"
|
||||||
@ -1104,6 +1110,8 @@
|
|||||||
# Show an exception if no HostID could be created, to ensure each system (and scan) has one
|
# Show an exception if no HostID could be created, to ensure each system (and scan) has one
|
||||||
if [ "${HOSTID}" = "" ]; then
|
if [ "${HOSTID}" = "" ]; then
|
||||||
ReportException "GetHostID" "No unique host identifier could be created."
|
ReportException "GetHostID" "No unique host identifier could be created."
|
||||||
|
elif [ ! -z "${HOSTID2}" ]; then
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user