Inventory and changes

The current state Structam keeps for each host, every change event kind with its category and severity, review, change rules and the per-host hash chain.

On this page

Structam keeps the current state of every host and records every difference between two observations as a change event. It does not keep a history of inventory rows: when an application is removed its row goes, and the removal is a change event. History lives in the change record and, for configuration files, in configuration history.

Current state

Host tabWhat it holds
Applicationsname, version, architecture, source, install path, vendor, running state
Executablespath, SHA-256, size, owner, mode, hash state, the application that owns it
Processesexecutable, user, service, container, instance count
Servicessystemd units, launchd jobs or Windows services with their state
Portslistening protocol, address and port with the owning process
Accountslocal users and groups, with administrator membership
Componentshardware from the agent, and from InfraDB when linked (kept apart by source)
PatchesWindows KBs and macOS OS updates (not collected on Linux)
FactsOS, kernel, CPU, memory, serial, boot time, addresses
  • Application sources: dpkg, rpm, apk, pacman, snap, flatpak, pkgutil, app, brew, msi, registry, appx, and binary (standalone running executables no package owns).
  • Several installed versions of one name (kernels, side-by-side MSI or Appx, Homebrew kegs) are separate rows.
  • An application is running when a running process's executable belongs to it. A running image that differs from the file on disk is flagged.
  • Executable hashes are SHA-256. Hash states: ok, pending (over the per-pass hashing budget), too_large, unreadable.
  • Processes are grouped: identical executable, user, service and container are reported once with an instance count, so process ids are not kept. Container processes are recorded with their container id but never become applications.
  • Freshness is tracked per host and section, not per row.

The first inventory of a host is a baseline: its current state is written and one inventory.baseline event records the counts, with no event per item.

Change event kinds

Every change event has a kind, a category and a default severity (info, low, medium or high). Change rules may set another severity.

KindCategorySeverity
app.installed, app.removed, app.version_changedsoftwaremedium
app.path_changedsoftwarelow
binary.hash_changed (same path, same package version)softwarehigh
binary.added, binary.removed (standalone binaries)softwaremedium
patch.installed, patch.removedsoftwarelow
app.started, app.stoppedruntimeinfo
service.added, service.removed, service.state_changedruntimelow
port.opened, port.closednetworkmedium
config.created, config.modified, config.deletedconfigmedium
config.metadata_changed (mode, owner, group)configmedium
config.redaction_changed (only the redaction rules changed; no review needed)configinfo
account.added, account.removed, account.changedaccountmedium
account.admin_grantedaccounthigh
facts.changed (one event per group: OS, kernel, CPU, memory, serial, addresses)systemlow; OS and kernel medium
hardware.added, hardware.removed, hardware.changed (serial or firmware)hardwaremedium
agent.enrolled, agent.revoked, agent.updated, agent.gap, agent.reenrolledagentmedium
agent.clone_suspectedagenthigh
inventory.baselinesysteminfo
host.identity_changed (NetBox name, site, tenant, role, status, tags, primary IP)identitylow; status medium
asset.changed (asset details edited in Structam)identitylow
host.merged, host.decommissionedsystemlow
infradb.<entity>.<action> (host changes from InfraDB's audit sink)externalas sent; review not required

Notes on a few of them:

  • app.version_changed pairs a removed and an added row of the same product in one diff, so an upgrade is one event, not a removal and an installation.
  • binary.hash_changed fires when an executable's SHA-256 changes while its owning application keeps its version: a file replaced behind the package manager's back. The first hash of a file is not a change, and a pass that cannot hash a file does not hide a replacement.
  • agent.gap means the agent's on-disk queue dropped messages before the server received them.

Review

Every event starts as pending unless a rule decides otherwise. Review states: pending, approved, rejected, auto_approved, not_required. Approve, reject, comment and bulk review by filter need changes.review within your scope, and are audited. The Changes page lists events in your scope, newest first and waiting for review by default, and filters by host, kind, category, severity, review state, time and text.

Change rules

Change rules (Policies, policies.manage) match events and act on them.

  • Match on kinds, categories, severities, host attributes (sites, tenants, roles, tags, platforms) and a subject glob. Lists match when any entry matches; fields match when all do.
  • Actions: auto_approve, not_required, set_severity, raise_infradb_alarm (an alarm in InfraDB until the change is approved) and notify_siem (marks the event for the SIEM forwarder).
  • Per action, the highest priority wins.
  • Built-in rules, editable and can be turned off: the runtime category is not_required; agent.updated is auto_approve.

The per-host hash chain

Each change event is written in the same transaction as the state it describes, and chained per host: its hash is SHA-256 over the previous event's hash and the canonical JSON of the event's stored fields. Review fields are not hashed, because they change by design. Verify a host's chain, including hosts merged into it:

structam audit verify -host 42

or GET /api/v1/hosts/{id}/changes/verify (permission audit.view).

Retention

STRUCTAM_CHANGE_RETENTION_DAYS (0, the default, keeps everything) drops whole monthly partitions, never before every enabled SIEM sink has received them. Before a partition is dropped, each host's chain gets an anchor, so it stays verifiable from there.

Questions the docs do not answer?

Ask the people who build Structam. Installation media and licences come from KazLabs.

Talk to us