Skip to content

Commit

Permalink
Guard against /sys/hypervisor/uuid not being readable
Browse files Browse the repository at this point in the history
On a centos-6 PV instance in Amazon EC2 I see /sys/hypervisor/uuid exists

-r--r--r-- 1 root root 4096 Sep  1 14:30 /sys/hypervisor/uuid

but is not readable even though permissions seem to be ok.

cat: /sys/hypervisor/uuid: No such file or directory

While SELinux is enforced it doesn't seem to be involved since this is a special sysfs filesystem and there are no entries for the failure in the audit log.

Ticket: ENT-9931
Changelog: title
  • Loading branch information
craigcomstock committed Sep 1, 2023
1 parent 089ac93 commit 90f0c8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inventory/any.cf
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,10 @@ bundle common cfe_autorun_inventory_aws
scope => "namespace",
if => isvariable("cfe_autorun_inventory_dmidecode.dmi[bios-vendor]");

"sys_hypervisor_uuid_readable" -> { "ENT-9931" }
expression => returnszero("${paths.cat} /sys/hypervisor/uuid 2>/dev/null", "useshell");

!disable_inventory_aws.sys_hypervisor_uuid_readable::
"ec2_instance" -> { "CFE-2924" }
expression => regline( "^ec2.*", "/sys/hypervisor/uuid" ),
scope => "namespace",
Expand Down

0 comments on commit 90f0c8c

Please sign in to comment.