Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MachineUUIDFromOS ¶
MachineUUIDFromOS returns a UUID derived from the host D-Bus/machine ID when available.
We do not use github.com/shirou/gopsutil/v4/host.HostID (see host_linux.go): that API tries /sys/class/dmi/id/product_uuid first, then /etc/machine-id, then /proc/sys/kernel/random/boot_id. For Ghostpsy we need (1) stable OS identity from /etc/machine-id (e.g. Docker audit entrypoint may seed it), not DMI product UUID, and (2) never boot_id, which changes every reboot and would create a new machine row after each boot. Linux writes 32 lowercase hex bytes to /etc/machine-id (or /var/lib/dbus/machine-id). The value is formatted as a standard UUID string for ingest (backend stores uuid.UUID).
Types ¶
type AgentState ¶
type AgentState struct {
MachineUUID string `json:"machine_uuid"`
ClaimCode string `json:"claim_code"`
ScanSeq int `json:"scan_seq"`
}
AgentState is persisted after the first successful `scan` setup (machine identity on this host).