Files
bee/audit/internal/collector/collector.go
Michael Chus f1e392a7fe 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>
2026-03-05 10:35:14 +03:00

38 lines
998 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Package collector runs all hardware collectors and merges results
// into a single HardwareSnapshot. Each sub-collector is independent:
// a failure in one does not abort the others.
package collector
import (
"bee/audit/internal/schema"
"log/slog"
"time"
)
// Run executes all collectors and returns the combined snapshot.
// Partial failures are logged as warnings; collection always completes.
func Run() schema.HardwareIngestRequest {
start := time.Now()
slog.Info("audit started")
snap := schema.HardwareSnapshot{}
board, biosFW := collectBoard()
snap.Board = board
snap.Firmware = append(snap.Firmware, biosFW...)
// remaining collectors added in steps 1.3 1.10
slog.Info("audit completed", "duration", time.Since(start).Round(time.Millisecond))
sourceType := "livcd"
protocol := "os-direct"
return schema.HardwareIngestRequest{
SourceType: &sourceType,
Protocol: &protocol,
CollectedAt: time.Now().UTC().Format(time.RFC3339),
Hardware: snap,
}
}