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-09-19 03:55:55 +0400
committermboelen <michael@cisofy.com>2014-09-19 03:55:55 +0400
commitfb52ee923924fdf23f391c63467d91015b58a865 (patch)
treeef2eddb296a6cc93d29d6e354326bd6c2f8b67e3
parentfb53e586fe38fe4d4dfc615d4979e0d2077ac220 (diff)
Added more extensions for virtual machine detection
-rw-r--r--include/functions20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/functions b/include/functions
index e8808c14..2a18bde8 100644
--- a/include/functions
+++ b/include/functions
@@ -550,12 +550,27 @@
*) ReportException "IsVirtualMachine" "Unknown virtualization type received from systemctl" ;;
esac
fi
+
else
+
# Try common guest processes
logtext "Test: trying to guess virtual machine type by running processes"
- IsRunning vmware-guestd
- if [ ${RUNNING} -eq 1 ]; then ISVIRTUALMACHINE=1; VMTYPE="vmware"; VMFULLTYPE="VMware product"; fi
+
+ # VMware
+ IsRunning vmware-guestd
+ if [ ${RUNNING} -eq 1 ]; then ISVIRTUALMACHINE=1; VMTYPE="vmware"; VMFULLTYPE="VMware product"; fi
+
+ # VirtualBox based on guest services
+ IsRunning vboxguest-service
+ if [ ${RUNNING} -eq 1 ]; then ISVIRTUALMACHINE=1; VMTYPE="virtualbox"; VMFULLTYPE="Oracle VM VirtualBox"; fi
+ IsRunning VBoxClient
+ if [ ${RUNNING} -eq 1 ]; then ISVIRTUALMACHINE=1; VMTYPE="virtualbox"; VMFULLTYPE="Oracle VM VirtualBox"; fi
+
+ # 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
fi
+
+ # Check final status
if [ ${ISVIRTUALMACHINE} -eq 1 ]; then
logtext "Result: found virtual machine (type: ${VMTYPE}, ${VMFULLTYPE})"
report "vm=1"
@@ -566,7 +581,6 @@
fi
}
-
# Function IsWorldExecutable
IsWorldExecutable()
{