mirror of https://github.com/CISOfy/lynis.git
Added more extensions for virtual machine detection
This commit is contained in:
parent
fb53e586fe
commit
fb52ee9239
|
@ -550,12 +550,27 @@
|
||||||
*) ReportException "IsVirtualMachine" "Unknown virtualization type received from systemctl" ;;
|
*) ReportException "IsVirtualMachine" "Unknown virtualization type received from systemctl" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# Try common guest processes
|
# Try common guest processes
|
||||||
logtext "Test: trying to guess virtual machine type by running processes"
|
logtext "Test: trying to guess virtual machine type by running processes"
|
||||||
|
|
||||||
|
# VMware
|
||||||
IsRunning vmware-guestd
|
IsRunning vmware-guestd
|
||||||
if [ ${RUNNING} -eq 1 ]; then ISVIRTUALMACHINE=1; VMTYPE="vmware"; VMFULLTYPE="VMware product"; fi
|
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
|
fi
|
||||||
|
|
||||||
|
# Check final status
|
||||||
if [ ${ISVIRTUALMACHINE} -eq 1 ]; then
|
if [ ${ISVIRTUALMACHINE} -eq 1 ]; then
|
||||||
logtext "Result: found virtual machine (type: ${VMTYPE}, ${VMFULLTYPE})"
|
logtext "Result: found virtual machine (type: ${VMTYPE}, ${VMFULLTYPE})"
|
||||||
report "vm=1"
|
report "vm=1"
|
||||||
|
@ -566,7 +581,6 @@
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function IsWorldExecutable
|
# Function IsWorldExecutable
|
||||||
IsWorldExecutable()
|
IsWorldExecutable()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue