@@ -383,10 +383,8 @@ bundle agent inventory_fwupd_hsi(security_src)
383383# compute the rolled-up HSI level.
384384#
385385# Emits:
386- # - Per-attribute PASS/FAIL strings named "Firmware HSI L<n>: <Name>"
387- # for use in compliance report conditions.
388- # - An slist of detailed results formatted "Name (HSI L<level>):
389- # <result> [PASS|FAIL]" for inventory drill-down.
386+ # - "Firmware HSI failing" and "Firmware HSI passing", slists of
387+ # "L<level>: <name>" check names split by outcome.
390388# - A count of failing attributes.
391389# - The rolled-up HSI level (e.g. "HSI:3").
392390#
@@ -419,6 +417,13 @@ bundle agent inventory_fwupd_hsi(security_src)
419417 "_level[$(_idxes)]"
420418 string => "$(_sec[SecurityAttributes][$(_idxes)][HsiLevel])";
421419
420+ # fwupd omits HsiLevel on runtime-issue checks (Linux kernel, UEFI db,
421+ # ...). Default those to L0, otherwise the unresolved level skips
422+ # every promise that builds on it and the check vanishes entirely.
423+ "_level[$(_idxes)]"
424+ string => "0",
425+ unless => isvariable("_level[$(_idxes)]");
426+
422427 "_result[$(_idxes)]"
423428 string => "$(_sec[SecurityAttributes][$(_idxes)][HsiResult])";
424429
@@ -444,10 +449,9 @@ bundle agent inventory_fwupd_hsi(security_src)
444449 "$(_name[$(_idxes)])"
445450 );
446451
447- # Normalized level for per-attribute inventory: fwupd marks some
448- # attributes as HsiLevel 0 with a "runtime-issue" flag even though
449- # they contribute to scored HSI levels. Map them to their HSI spec
450- # level so inventory attribute names match compliance conditions.
452+ # Normalized level: fwupd marks some attributes as HsiLevel 0 with a
453+ # "runtime-issue" flag even though they contribute to scored HSI
454+ # levels. Map them to their HSI spec level so list items are stable.
451455 # UEFI secure boot (org.fwupd.hsi.Uefi.SecureBoot) → HSI:1
452456 # CET OS Support (org.fwupd.hsi.IntelCet.Active) → HSI:3
453457 "_inv_level[$(_idxes)]"
@@ -459,19 +463,35 @@ bundle agent inventory_fwupd_hsi(security_src)
459463 "$(_level[$(_idxes)])"
460464 );
461465
462- # Per-attribute inventory: one string variable per HSI check,
463- # named "Firmware HSI L<level>: <name>" with value PASS or FAIL.
464- # This enables per-check compliance report conditions.
465- "fwupd_hsi_check[$(_idxes)]"
466- string => "$(_status[$(_idxes)])",
467- meta => {
468- "inventory",
469- "attribute_name=Firmware HSI L$(_inv_level[$(_idxes)]): $(_inv_name[$(_idxes)])",
470- };
471-
472- "fwupd_hsi_attr[$(_idxes)]"
473- string => "$(_name[$(_idxes)]) (HSI L$(_level[$(_idxes)])): $(_result[$(_idxes)]) [$(_status[$(_idxes)])]",
474- meta => { "inventory", "attribute_name=Firmware HSI attributes" };
466+ # Check names split by outcome into two lists, rather than one
467+ # inventory attribute per check.
468+ #
469+ # Inventory attribute names are fleet wide: an attribute any host
470+ # defines is offered as a column for every host. fwupd's check set
471+ # is hardware dependent, so one attribute per check grew that list
472+ # with every distinct chipset in the fleet while each host filled in
473+ # only its own subset. Two lists keep this module at two stable
474+ # attribute names regardless of the hardware, and carry the same
475+ # information: a check in neither list is not applicable to this
476+ # host.
477+ #
478+ # The level prefix disambiguates fwupd's two distinct checks both
479+ # named "Platform debugging" (L1 Intel DCI, L2 debug locked).
480+ "_failing_name[$(_idxes)]"
481+ string => "L$(_inv_level[$(_idxes)]): $(_inv_name[$(_idxes)])",
482+ if => strcmp("$(_status[$(_idxes)])", "FAIL");
483+
484+ "_passing_name[$(_idxes)]"
485+ string => "L$(_inv_level[$(_idxes)]): $(_inv_name[$(_idxes)])",
486+ if => strcmp("$(_status[$(_idxes)])", "PASS");
487+
488+ "fwupd_hsi_failing"
489+ slist => getvalues("_failing_name"),
490+ meta => { "inventory", "attribute_name=Firmware HSI failing" };
491+
492+ "fwupd_hsi_passing"
493+ slist => getvalues("_passing_name"),
494+ meta => { "inventory", "attribute_name=Firmware HSI passing" };
475495
476496 "fwupd_hsi_failing_count"
477497 int => countclassesmatching("inventory_fwupd_hsi_failing_[0-9]+");
0 commit comments