Skip to content

Commit df8b829

Browse files
committed
update: added debugs to is_hardened() logic
1 parent b767142 commit df8b829

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vmaware.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12697,6 +12697,7 @@ struct VM {
1269712697
// rule 1: if VM::FIRMWARE is detected, so should VM::HYPERVISOR_BIT or VM::HYPERVISOR_STR
1269812698
const enum brand_enum firmware_brand = detected_brand(VM::FIRMWARE);
1269912699
if (firmware_brand != brand_enum::NULL_BRAND && !hv_present) {
12700+
debug("is_hardened(): firmware and hypervisor bit/str are not detected together");
1270012701
return true;
1270112702
}
1270212703

@@ -12705,6 +12706,7 @@ struct VM {
1270512706
if (firmware_brand == brand_enum::QEMU || firmware_brand == brand_enum::VBOX) {
1270612707
const enum brand_enum cvendor_brand = detected_brand(VM::CVENDOR);
1270712708
if (firmware_brand != cvendor_brand) {
12709+
debug("is_hardened(): firmware and chassis vendor brands do not match");
1270812710
return true;
1270912711
}
1271012712
}
@@ -12714,11 +12716,13 @@ struct VM {
1271412716
// rule 3: if VM::ACPI_SIGNATURE (QEMU) is detected, so should VM::FIRMWARE (QEMU)
1271512717
const enum brand_enum acpi_brand = detected_brand(VM::ACPI_SIGNATURE);
1271612718
if (acpi_brand == brand_enum::QEMU && firmware_brand != brand_enum::QEMU) {
12719+
debug("is_hardened(): firmware and ACPI signature are not detected together");
1271712720
return true;
1271812721
}
1271912722

1272012723
// rule 4: if VM::TRAP or VM::NVRAM is detected, so should VM::HYPERVISOR_BIT or VM::HYPERVISOR_STR
1272112724
if ((check(VM::TRAP) || check(VM::NVRAM)) && !hv_present) {
12725+
debug("is_hardened(): trap/NVRAM and hypervisor bit/str are not detected together");
1272212726
return true;
1272312727
}
1272412728
#endif

0 commit comments

Comments
 (0)