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>2014-12-03 16:10:52 +0300
committermboelen <michael@cisofy.com>2014-12-03 16:10:52 +0300
commit358ea148ca2be5fe7d4e3db2a097d140c38bf099 (patch)
tree1b9846021e5c572abf545dcaf658560f8429c81c /include
parent9a8ea8584acaea7e8289fc8d8fda9c164278f471 (diff)
Added additional virtualization detection for NetBSD and OpenBSD
Diffstat (limited to 'include')
-rw-r--r--include/functions25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/functions b/include/functions
index 840f7d4f..928f8042 100644
--- a/include/functions
+++ b/include/functions
@@ -601,8 +601,31 @@
# Amazon EC2 Instance
if [ -f /etc/ec2_version -a ! -z /etc/ec2_version ]; then ISVIRTUALMACHINE=1; VMTYPE="amazon-ec2"; VMFULLTYPE="Amazon AWS EC2 Instance"; fi
+
+
+ if [ ${ISVIRTUALMACHINE} -eq 2 ]; then
+ # Try common guest processes
+ logtext "Test: trying to guess virtual machine type by sysctl keys"
+
+ FIND=`sysctl -a | egrep "(hw.product|machdep.dmi.system-product)" | sed 's/ = /=/' | awk -F= '{ print $2 }'`
+ if [ ! "${FIND}" = "" ]; then
+ case ${FIND} in
+ "VirtualBox")
+ ISVIRTUALMACHINE=1
+ VMTYPE="virtualbox"
+ VMFULLTYPE="Oracle VM VirtualBox"
+ ;;
+ *)
+ logtext "Result: Found an unknown hardware type in hw.product sysctl key"
+ ;;
+ esac
+ fi
+
+ fi
+
fi
+
# Check final status
if [ ${ISVIRTUALMACHINE} -eq 1 ]; then
logtext "Result: found virtual machine (type: ${VMTYPE}, ${VMFULLTYPE})"
@@ -855,7 +878,7 @@
Progress()
{
if [ ${CRONJOB} -eq 0 ]; then
- ${ECHOCMD} -en "."
+ ${ECHOCMD} -n "."
fi
}