EdgeGuard
This page is device attestation inside the Edgelet daemon. How often the Controller runs EdgeGuard on a fleet is Edgelet node EdgeGuard.
Edge Guard periodically fingerprints the host hardware and compares it to a baseline stored in SQLite. A mismatch triggers a controller warning, agent deprovision, and baseline reset.
Implementation: internal/edgeguard/
Persistence: agent_edgeguard_signature table. See Persistence
Configuration
| Key | Profile / YAML | Meaning |
|---|---|---|
edgeGuardFrequency | seconds | Attestation interval; 0 disables Edge Guard |
Example:
profiles:
production:
edgeGuardFrequency: 3600
Edge Guard requires a provisioned agent (iofogUuid + private key in SQLite). If unprovisioned, runtime forces edgeGuardFrequency to 0.
How attestation works
- Collect a stable hardware fingerprint (platform-specific; see below).
- Canonicalize JSON and compute a SHA-256 hash (base64).
- Sign the hash into an Edge Guard JWT (
hashclaim + standard time claims). - On first run, store the JWT in
agent_edgeguard_signature. - On later runs, compare the new hash to the
hashclaim in the stored JWT. - If hashes match, optionally refresh the JWT (time claims rotate); no deprovision.
- If hashes differ, treat as hardware change (see On mismatch).
Important: Comparison uses the stable hash claim, not the full JWT string. Each signing produces a new JWT (iat, exp, jti) even when hardware is unchanged.
Fingerprint sources (linux)
Collected in internal/edgeguard/fingerprint_linux.go:
| Category | Examples |
|---|---|
| System / DMI | product UUID, serial, vendor, model |
| BIOS | vendor, version |
| CPU | vendor, model, core count (gopsutil) |
| PCI devices | slot, class, vendor/device IDs |
| Root disk | device id |
| Primary NICs | name, MAC, link state |
| USB devices | bus path, vendor/product id |
| Optional | machine-id, TPM, secure boot, memory modules |
Darwin and Windows use platform-specific collectors (fingerprint_darwin.go, fingerprint_windows.go).
On mismatch
When the fingerprint hash changes:
- Supervisor status → WARNING,
warningMessage:HW signature changed - Status POST to controller (immediate)
- Agent deprovision (
Deprovision(false). Credentials cleared via normal deprovision path) - Stored baseline JWT deleted
Operators must investigate physical changes (NIC swap, disk change, USB devices that affect policy, VM identity drift) before reprovisioning.
On reprovision
When provisioning succeeds:
- Edge Guard baseline row is deleted (new private key / identity)
- Supervisor warning message cleared (
"") and daemon status restored from WARNING → RUNNING when applicable - Next attestation cycle creates a new baseline if
edgeGuardFrequency > 0
Ensure status reaches the controller after reprovision so the dashboard clears the warning.
Enable / disable
| Action | Behavior |
|---|---|
| Set frequency > 0 (provisioned) | Start ticker; establish baseline on first check |
| Set frequency 0 | Stop ticker; delete baseline from SQLite |
| Deprovision | Frequency forced to 0; delete baseline + credentials |
| Config change 0 → N | Reset baseline; new baseline on first check |
Development and VMs
- Use a reasonable interval in production (e.g. 3600s). Very short intervals (e.g. 10s) are for testing only.
- Lima / Apple Virtualization: virtual USB and PCI devices are part of the fingerprint; stable across reboots if the VM definition is unchanged.
- Embedded IT may set
edgeGuardFrequency: 0when attestation is not under test.
Validation checklist
After deploy or Edge Guard changes:
- Provision agent; confirm
agent_credentialsrow (id=1) with non-emptyprivate_key_b64. - Set
edgeGuardFrequency > 0; confirmagent_edgeguard_signaturerow after first attestation. - Wait two attestation intervals. Agent must remain provisioned if hardware unchanged.
- Set
edgeGuardFrequency: 0; confirm signature row deleted. - Unprovisioned agent +
edgeGuardFrequency > 0→ runtime normalizes to 0. - Reprovision after mismatch → warning cleared in local status; controller receives empty
warningMessageon next status POST. - Deprovision → frequency 0,
agent_credentialsandagent_edgeguard_signatureempty.
Related
- Deployment. Provisioning
- Persistence. SQLite tables
- Troubleshooting. Daemon and controller connectivity