feat(audit): 1.2 — board collector (dmidecode types 0, 1, 2)
- board.go: collectBoard(), parseBoard(), parseBIOSFirmware(), parseDMIFields(), cleanDMIValue() - Reads System Information (type 1): serial, manufacturer, product_name, uuid - Reads Base Board Information (type 2): part_number - Reads BIOS Information (type 0): firmware version record - cleanDMIValue strips vendor placeholders (O.E.M., Not Specified, Unknown, etc.) - board_test.go: 6 table/case tests with dmidecode fixtures in testdata/ - collector.go: wired board + BIOS firmware into snapshot Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
25
audit/internal/collector/testdata/dmidecode_type0.txt
vendored
Normal file
25
audit/internal/collector/testdata/dmidecode_type0.txt
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# dmidecode 3.5
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.1.1 present.
|
||||
|
||||
Handle 0x0000, DMI type 0, 26 bytes
|
||||
BIOS Information
|
||||
Vendor: American Megatrends Inc.
|
||||
Version: 06.08.05
|
||||
Release Date: 12/20/2023
|
||||
Address: 0xF0000
|
||||
Runtime Size: 64 kB
|
||||
ROM Size: 32 MB
|
||||
Characteristics:
|
||||
PCI is supported
|
||||
PCI Express is supported
|
||||
BIOS is upgradeable
|
||||
BIOS shadowing is allowed
|
||||
Selectable boot is supported
|
||||
ACPI is supported
|
||||
USB legacy is supported
|
||||
BIOS boot specification is supported
|
||||
Targeted content distribution is supported
|
||||
UEFI is supported
|
||||
BIOS Revision: 5.22
|
||||
Firmware Revision: 4.1
|
||||
14
audit/internal/collector/testdata/dmidecode_type1.txt
vendored
Normal file
14
audit/internal/collector/testdata/dmidecode_type1.txt
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# dmidecode 3.5
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.1.1 present.
|
||||
|
||||
Handle 0x0001, DMI type 1, 27 bytes
|
||||
System Information
|
||||
Manufacturer: Inspur
|
||||
Product Name: NF5468M7
|
||||
Version: To Be Filled By O.E.M.
|
||||
Serial Number: CAR315KA0803B90
|
||||
UUID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
||||
Wake-up Type: Power Switch
|
||||
SKU Number: To Be Filled By O.E.M.
|
||||
Family: To Be Filled By O.E.M.
|
||||
14
audit/internal/collector/testdata/dmidecode_type1_empty_serial.txt
vendored
Normal file
14
audit/internal/collector/testdata/dmidecode_type1_empty_serial.txt
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# dmidecode 3.5
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.1.1 present.
|
||||
|
||||
Handle 0x0001, DMI type 1, 27 bytes
|
||||
System Information
|
||||
Manufacturer: To Be Filled By O.E.M.
|
||||
Product Name: To Be Filled By O.E.M.
|
||||
Version: To Be Filled By O.E.M.
|
||||
Serial Number: To Be Filled By O.E.M.
|
||||
UUID: Not Settable
|
||||
Wake-up Type: Power Switch
|
||||
SKU Number: To Be Filled By O.E.M.
|
||||
Family: To Be Filled By O.E.M.
|
||||
15
audit/internal/collector/testdata/dmidecode_type2.txt
vendored
Normal file
15
audit/internal/collector/testdata/dmidecode_type2.txt
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# dmidecode 3.5
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.1.1 present.
|
||||
|
||||
Handle 0x0002, DMI type 2, 15 bytes
|
||||
Base Board Information
|
||||
Manufacturer: Inspur
|
||||
Product Name: YZCA-02758-105
|
||||
Version: To Be Filled By O.E.M.
|
||||
Serial Number: CAR315KA0803B90
|
||||
Asset Tag: To Be Filled By O.E.M.
|
||||
Features:
|
||||
Board is a hosting board
|
||||
Location In Chassis: To Be Filled By O.E.M.
|
||||
Type: Motherboard
|
||||
Reference in New Issue
Block a user