Build the on-host agent that pairs with fleet-hostapi and feeds the fleet-manager control plane (TODO #14 "STILL TO BUILD (a)"). Nothing on the workstation talked to the manager before this; Monitor + InfluxDB stayed empty. Scope: telemetry only. The agent reuses the host TPM identity for mTLS (read-only tpmkey.LoadSigner at 0x81000100 + cert from NV 0x01800100; the private key never leaves the TPM), opens the long-lived FleetAgent.Session bidi stream, sends Hello + periodic HealthSnapshot (load/cpu/temp/mem/tmpfs/nvme/auth/selinux/chrony/kiosk, probed read-only from /proc+/sys plus hostapi facts), and LOGS but does not act on the DesiredState/Command it receives. Reconcile actuators (kiosk URL, reboot, drain) are deferred until the telemetry half is bench-verified. - files/agent/: new module (go-tpm + grpc), static CGO_ENABLED=0 like enrol/hostapi. Copies the enrol tpmkey (+ read-only LoadSigner) and the generated fleet.agent.v1 proto so it stays self-contained without importing the initramfs enrol module. - files/agent/simtest/: proves the TPM-signed cert completes a real mTLS client-auth handshake (RequireAndVerifyClientCert) against the go-tpm software simulator. - files/etc/fleet-agent/agent.env: fleet-generic config (manager DNS name, fleet CA reused from radius-ca.pem, TPM handle/nvindex, interval). No per-host state. - fleet-agent.service: hardened unit (tss group for /dev/tpmrm0, INET egress). - CI builds fleet-agent out-of-VM + runs vet/test + the simulator handshake test. - Packer: enable_agent flag (default on) + 2b-agent provisioner + fapolicyd trust. Post-switch-root only, so no dracut/initramfs changes. - docs: TODO #14 + fleet-management-design as-built updated. Requires the host already enrolled (broker approve births the inventory row) — else the manager returns PermissionDenied, the correct "not enrolled yet" signal.
22 lines
801 B
AMPL
22 lines
801 B
AMPL
// fleet-agent-simtest — a SEPARATE module so the go-tpm software simulator (CGO +
|
|
// the MS TPM reference C) and go-tpm-tools stay OUT of the shipped fleet-agent
|
|
// module. Run from this dir:
|
|
// go test ./... (needs CGO + a C toolchain for the simulator)
|
|
// It proves the agent's reused TPM identity (tpmkey.LoadSigner) completes a real
|
|
// mTLS client-auth handshake against a server that RequireAndVerifyClientCert —
|
|
// exactly what the fleet-manager agent plane does — so the go-tpm signer is proven
|
|
// in the TLS path off-hardware without bloating the image build.
|
|
module fleet-agent-simtest
|
|
|
|
go 1.26
|
|
|
|
require (
|
|
fleet-agent v0.0.0
|
|
github.com/google/go-tpm v0.9.8
|
|
github.com/google/go-tpm-tools v0.4.9
|
|
)
|
|
|
|
require golang.org/x/sys v0.43.0 // indirect
|
|
|
|
replace fleet-agent => ../
|