What Structam does, and where it stops
Everything on this page is in Structam 0.1.0. Each part lists its limits beside it, and a Status note says how far it has been tested, carried over from the documentation.
The current state of every host
structam-agent reports what is installed, running and listening on each host. Structam keeps the current state and records every difference as a change event, instead of keeping old rows.
What the agent collects
The agent registers 11 inventory sections on macOS and Windows and 10 on Linux. Collectors only read; external programs run from absolute paths, without a shell, with a 60 s timeout and a 64 MiB output cap.
| Section | Linux | macOS | Windows |
|---|---|---|---|
| Applications | dpkg, rpm, apk, pacman, snap, flatpak | pkgutil receipts, .app bundles, Homebrew | Uninstall registry keys, MSI, Appx |
| Executables | SHA-256 of running images and package-owned binaries | .app main executables, running images | Main executables, service binaries, running images |
| Processes | /proc, with container id | kern.proc | Toolhelp32 |
| Services | systemd units | launchd jobs | Service Control Manager |
| Listening ports | /proc/net, with owning process | lsof | TCP and UDP tables |
| Local accounts | /etc/passwd, /etc/group (never shadow) | Directory Services | Local users and groups |
| Configuration files | /etc/** by default | /etc/**, /Library/Preferences/*.plist | hosts file, *.conf, *.ini, *.xml, *.json under ProgramData |
| Network neighbours | ARP and NDP table | arp, ndp | Get-NetNeighbor |
| Hardware | SMBIOS (BIOS, CPU, memory modules), disks | system_profiler | SMBIOS, disks and NICs |
| Patches | not collected | Install history | Installed updates (KBs) |
| System facts | OS release, kernel, CPU, memory, DMI, interfaces, routes, DNS | sw_vers, sysctl | Registry, SMBIOS |
Applications and executables
- 13 application sources:
dpkg,rpm,apk,pacman,snap,flatpak,pkgutil,app,brew,msi,registry,appx, andbinaryfor running executables that no package owns. - Several installed versions of one name (kernels, side-by-side MSI or Appx packages, 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.
- Executables are hashed with SHA-256: files up to 256 MB, at most 2 048 MB per pass, with a hash cache keyed on file identity so unchanged files are not hashed again. Each hash is
ok,pending(over the pass budget),too_largeorunreadable.
Schedule
By default a full inventory pass runs every 300 s; processes, services and ports every 60 s; and a configuration scan every 60 s that reads a file's content only when it changed. Only sections whose canonical hash changed are sent. Freshness is tracked per host and section. The agent policy sets all of this.
Every difference is a change event
A change event is written in the same database transaction as the new state, hash-chained per host, and given a review state.
What becomes a change event
- Software: an application installed, removed, or changed in version or path; an executable added or removed;
binary.hash_changed, a new hash at the same path and package version (high severity). - Runtime and network: applications started and stopped, services, ports opened and closed.
- Configuration: files created, modified, deleted, their metadata, and redaction-only changes.
- Accounts, system and hardware: local accounts (an administrator grant is high), facts, patches, components.
- Agent and identity: enrolled, revoked, updated, re-enrolled, a gap in its data, a suspected clone; NetBox identity changes, asset detail changes, merges and decommissioning.
- External: InfraDB audit events about the host.
Severities are info, low, medium and high. A host's first inventory is one inventory.baseline event, not one event per item.
Review
Review states are pending, approved, rejected, auto_approved and not_required. Approve, reject and comment one event at a time, or review in bulk by filter. Reviewing needs changes.review on the host, and every review is audited.
Change rules
Rules match on kinds, categories, severities, host attributes (sites, tenants, roles, tags, platforms) and a subject glob. Their actions:
auto_approveandnot_requiredtake an event out of the review queue;set_severityraises or lowers it;raise_infradb_alarmraises an alarm in InfraDB that clears when the event is approved;notify_siemsends the event to every SIEM sink that carries change events, whatever the sink's own filters.
Two built-in rules, both editable: runtime changes need no review, and agent.updated is approved automatically.
The hash chain
Each event's hash is SHA-256 over the previous hash and the canonical JSON of the event's stored fields. Check a host's chain from a server, or with GET /api/v1/hosts/{id}/changes/verify:
structam audit verify -host 42Every version of every watched configuration file
Redacted on the host before upload, stored once per distinct content, encrypted at rest, with diffs, baselines, drift, variants across hosts and point-in-time export.
What is watched
The agent policy decides: /etc/** by default on Linux; on macOS also /Library/Preferences/*.plist; on Windows the hosts file and *.conf, *.ini, *.xml and *.json under ProgramData. Text files up to 1 024 KB, symlinks not followed. A deny list compiled into the agent always wins over the policy: shadow files, SSH host keys, *.key, keystores, WireGuard, NetworkManager, IPsec and PPP secrets, and the agent's own files.
Redaction happens on the host
Before hashing and upload the agent redacts PEM private keys, credentials in URLs, bearer and basic credentials, secret-looking key=value and key: value pairs, XML secret elements and known token shapes, plus the policy's own patterns. It also sends an HMAC of the raw bytes, keyed per agent, so a real change behind unchanged redacted text is still seen without the raw content leaving the host.
People without configs.content on a host see contents and diffs with a second, display redaction. Raw views and exports are audited.
Versions, diffs, baselines
- Versions are numbered from 1 per file and never reused:
created,modified,deleted,metadata(mode, owner, group) andrerendered(only the redaction rules changed; no review needed). A touch that changes only the time or size is not a version. - Diffs are unified with 3 lines of context, between any two versions, or between hosts with
viewon both. - Baselines per file or per host; drift is current content that differs from its baseline, shown on host and estate pages.
- Config variants: for a path or glob, the distinct contents across your hosts, such as "12 hosts share variant A, 2 differ".
- Fetch now: ask an agent for one file its policy allows (
agents.manageandconfigs.content).
Point-in-time export
A tar.gz of every file on a host as it was at a moment, with a structam-export.json index. It needs configs.content and is audited.
GET /api/v1/hosts/42/configs/export?at=2026-11-30T09:00:00ZApplications, hashes and assets across every host
Estate views count what the agents report across every host you may see, and the IT asset management pages add what NetBox does not hold.
Applications
The Applications page lists every application with its host count, installs, running hosts, versions and distinct executable hashes. Each application's page breaks that down by version, hash and host. Export it as CSV.
Hash search and hash anomalies
Look one SHA-256 up across executables, running processes and configuration files on the hosts in your scope. The anomalies view lists any application version, architecture and path seen with more than one hash.
IT asset management
- Asset details NetBox does not hold: owner, cost centre, purchase date, warranty, support contract and lifecycle, plus host notes.
- Software entitlements by product, vendor and version globs, with seats counted by installs, hosts or running hosts.
- An editable end-of-life table for operating systems.
- Six reports: licence compliance, warranty expiry, end-of-life OS, unknown binaries, hosts without agents and stale agents. Up to 10 000 rows each, as CSV with spreadsheet formulas escaped.
Ask AI
Questions about the estate, answered by a language model you configure through 14 fixed, read-only tools, with the asking user's permissions and scope. No model is bundled, and Ask AI is off until one is configured. What goes to the model and the limits are on the integrations page.
From a NetBox host to a reporting agent
The Add hosts page makes a join token and shows the install command. Discovery finds the addresses that still have no agent.
Join tokens
A join token (stj1.<id>.<secret>.<pin>) carries the server's identity pin. Its secret never reaches the server: the agent proves it by signing with a key derived from it, so a copy of the database cannot be used to enrol.
- By default a token is valid for 24 hours (at most 365 days) and for one use. Multi-use tokens serve golden images and configuration management.
- A token can carry a policy, a scope of sites, tenants and tags, a bound NetBox host and labels. Onboard this host on a host page makes a single-use token bound to that host.
- A scoped
agents.enrolholder can only make single-use tokens inside their scope, valid for at most 7 days. - The token is shown once, and is never accepted on a command line or in an environment variable.
Install scripts from your own server
The install scripts for Linux, macOS and Windows are served by your Structam server, and hosts never need internet access: the server serves the agent builds it carries. The script reads the token from the terminal without echo, checks the pin, verifies the release manifest's Ed25519 signature itself, checks the build's SHA-256 and size, installs the service, and reports success only when the server shows the agent connected (it waits up to 60 s). Options cover configuration management (--join-file), golden images (--image), upgrades, removal, a proxy and dry runs.
The agent service
- A system service: systemd on Linux, launchd on macOS, a Windows service. Linux, macOS and Windows on amd64 and arm64.
- Outbound only: one WebSocket over TLS to your server's public URL. Nothing connects to the agents.
- Store and forward: inventory goes to an on-disk queue first and is deleted only after the server has committed it. The queue holds 256 MiB or 7 days by default; past that the oldest data is dropped and an
agent.gapchange event records it. - On Linux the systemd unit caps the agent with
MemoryMax=512MandCPUQuota=50%, and runs it atNice=10with idle I/O scheduling. How the agent is confined and how its channel is protected is on the security page.
Discovery
Structam finds hosts three ways: NetBox sync, the agents' neighbour tables, and TCP connect sweeps of ranges an administrator added. Sweeps probe ports 22, 80, 443, 445, 3389, 5985, 5986 and 8443, look up reverse DNS and, on open ports only and without credentials, read the first line, the TLS leaf certificate and the SSH host key fingerprint. Found addresses are new, matched, onboarded or ignored; one that no NetBox host holds is also reported as NetBox drift ip.not_in_netbox. NetBox prefixes tagged structam-discover are proposed as targets, never swept on their own.
Stateless nodes over one PostgreSQL database
Structam nodes are active-active. They coordinate only through PostgreSQL rows and LISTEN/NOTIFY wake-ups; there is no node-to-node protocol and no node to elect.
Roles
One binary, with the role as its first argument: structam serve (API, web UI, agent gateway, event stream), structam worker (worker pools only), structam all (both, for a single node) and structam migrate. The server writes nothing to disk: everything is in PostgreSQL.
How nodes share the work
- Each background task (NetBox sync, InfraDB, SIEM forwarding, the audit chain, retention, discovery scheduling and others) has one holder at a time, through a lease with a 20 s lifetime renewed every 6 s. Every acquisition increments an epoch that the task's writes check in the same transaction, so a node that lost its lease cannot complete that task's work. A dead node's leases move within about 20 to 30 s.
- LISTEN/NOTIFY only wakes consumers; they also poll, so a lost notification delays work but never loses it.
- Nodes find the primary through a multi-host database URL; Structam adds
target_session_attrs=primary. No virtual IP or proxy is needed in front of the database. - Worker pools (
ingest,discovery,integration) scale inside each process every 2 s on queue depth and the age of the oldest job. Addstructam workernodes and they join the same queues. Above 100 000 queued ingest jobs, agents are told to retry later and keep their data on disk.
Stopping and stalling
- On SIGTERM a node reports not ready at once, closes its agents so they reconnect elsewhere, waits 5 s for the load balancer, finishes in-flight jobs for up to 20 s, returns unfinished claims, and closes HTTP within 10 s.
- Every 5 s each node checks whether commits are waiting on a synchronous standby. While they are, agents are told to hold their data and changes through the API answer 503 with
Retry-After. Liveness (/livez) never touches the database, so nothing restarts.
What ships in deploy/
- Docker Compose for one host (PostgreSQL 18,
structam all, Caddy), and an HA topology (a primary with a streaming standby, twoservenodes, aworker, Caddy). - A Kubernetes kustomization: two
servereplicas, aworkerDeployment with a HorizontalPodAutoscaler or a KEDA ScaledObject, a migration Job. Pods run as non-root with a read-only root filesystem and no capabilities. - systemd units and a server installer for Debian, Ubuntu and RHEL-family hosts, and a Caddyfile.
Roles scoped by NetBox site, tenant and tag
A grant gives a role to a user, a group or an API token, for every host or for the hosts in a scope. The scope is applied in SQL to everything that returns host data.
Sign-in
Local accounts with passwords and TOTP, LDAP or Active Directory, and OpenID Connect providers. Details are on the integrations page and the security page.
Permissions and roles
13 permissions and *: view, configs.content, changes.review, inventory.export, assets.edit, agents.manage, agents.enrol, policies.manage, assistant.use, audit.view, integrations.manage, users.manage and system.manage. Five built-in roles (viewer, auditor, reviewer, operator, admin), and custom roles with any permission except *.
Scopes
- A host matches a scope when its NetBox site, or its tenant, or any of its tags is listed. Only tags with the prefix
structam-(configurable) count. Several grants add up. - A host outside your scope answers 404, as if it did not exist. Lists, estate views, reports, exports, the event stream, TAXII and every Ask AI tool are filtered the same way.
- A test enumerates every mounted route and fails on any route that returns host data without a scope check.
API tokens
A token has its own grants, and its effect on a host is those grants intersected with its owner's current grants, checked on every request. Scopes ingest, metrics, taxii and export allow what roles alone do not. Optional expiry and source address ranges.
An audit log you can verify, and data in open formats
Every change to settings, access and integrations, every sign-in, enrolment, review, raw configuration view, export and Ask AI question is an audit event, written in the same transaction as the change.
The audit log
- Configuration tables are audited by database triggers, so no code path can skip them. Secret values appear only as
(set)or(changed). - The log is append-only and hash-chained, with a checkpoint signed by the server's identity key every 5 minutes, sent to every SIEM sink.
- Events before sign-in (failed sign-ins, refused agents, script downloads) are aggregated per source address per 10 minutes.
structam audit verify # exits 1 on any gap, edit, reordering or truncation
structam audit verify -checkpoint cp.json # also against a checkpoint your SIEM receivedGetting data out
- SIEM sinks: the audit and change streams over syslog or HTTPS, in CEF, LEEF, JSON, Splunk HEC, Elasticsearch bulk and OCSF formats.
- TAXII 2.1: a read-only server with
audit,changesandinventorycollections, and push to a remote collection. - Exports: estate and report CSVs, the audit log as NDJSON or CSV, and point-in-time configuration archives. Audit and configuration exports are themselves audited.
- Prometheus metrics on
/metrics. - The REST API under
/api/v1, with the same permissions and scopes as the web UI.
See it on your own estate
Structam is installed through KazLabs. Tell us about your NetBox and your hosts.