Skip to content

feat(ecs): add stable host and agent identity to alerts - #734

Merged
Karib0u merged 1 commit into
mainfrom
feat/730-host-agent-identity
Oct 9, 2026
Merged

Karib0u merged 1 commit into
mainfrom
feat/730-host-agent-identity

Conversation

@Karib0u

@Karib0u Karib0u commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Closes #730

What

Live alerts (Sigma, YARA, IOC, correlation, dedup rollups) now carry host.id, host.name, agent.id, agent.type, agent.version, identically in the NDJSON file and webhook bodies.

How

  • New identity module, resolved once at startup and attached to AlertSink; write_ecs is the single serialization point, so there is no per-event lookup.
  • host.id: keyed one-way digest of the OS machine id (/etc/machine-id, macOS kern.uuid, Windows MachineGuid); raw id is never emitted. Empty/zero/uninitialized ids are omitted.
  • host.name: trimmed, lowercased hostname.
  • agent.id: random UUID persisted owner-only in <agent.directory>/agent-id (new [agent] directory option, managed layouts use a state dir). If it cannot be persisted it is omitted rather than invented.
  • Replay never attaches identity (recordings store none).
  • Docs: docs/output.md (including cloning/image guidance), generated docs/configuration.md.

Tests

Unit tests (id derivation, normalization, persistence, permissions, reinstall, corrupt file, unwritable dir), tests/alert_identity.rs (rollups, omission, stability), webhook/file parity, ECS contract for replay mapping.

Not verified

The Windows MachineGuid reader was not compiled locally (no Windows target installed on this Mac); worth a CI/lab-windows check. Heartbeat (#557) can reuse Identity.

Stamp host.id, host.name, agent.id, agent.type and agent.version on every
live alert in both the NDJSON file and webhook bodies. Identity resolves once
at startup; agent.id persists owner-only under the new agent.directory.
Undeterminable ids are omitted, and replay carries no identity.
@Karib0u
Karib0u merged commit 177faa5 into main Oct 9, 2026
18 checks passed
@Karib0u
Karib0u deleted the feat/730-host-agent-identity branch October 9, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ecs): add stable host and agent identity to alerts

1 participant