Security model

Trust boundaries, secrets at rest and key rotation, the pinned and sealed agent channel, access control, outbound connections, audit and deployment hardening.

On this page

Status. A summary of the threat models in each of the product's packages, which are the authority. The mechanisms below are covered by the packages' tests; this page adds no claim of its own. The site's own security page covers this website and how to report a vulnerability.

Trust boundaries

PartyTrusted forNot trusted for
The operator of the server, the database and its backupseverything they can already doreading sealed secrets without STRUCTAM_SECRET_KEY; forging a licence, an agent release or an audit checkpoint
Agents (a host's root can read its agent key)data about their own hostanything about another host; commands; code
NetBoxhost identitycode, or writes beyond host records and change events
InfraDBwhat it says about its own hosts and alarmscreating hosts; anything else
SIEM and TAXII destinationsreceiving eventsredirects; answers beyond a size limit
The language modelnothing: its output is text for the usercalling anything but the read-only tools, with the user's permissions
Browsers and API clientswhat their grants allowcross-site requests; tokens in URLs

Secrets at rest

STRUCTAM_SECRET_KEY (32 or more random bytes, kept outside the database) is never used directly: each purpose gets its own subkey (HKDF-SHA256), and every sealed value is AES-256-GCM with a random nonce, bound by additional data to its table, row and field, so a ciphertext copied to another row, field or purpose does not open.

  • Sealed: integration and sink credentials, OpenID Connect ID tokens, TOTP seeds, the licence activation, configuration file contents and the server identity key.
  • Passwords are Argon2id. Session ids and API tokens are stored as SHA-256 of 256-bit secrets. Join tokens are stored as the public half of a key derived from their secret.
  • Someone with a database dump but not the key reads no sealed value, cannot confirm a guessed configuration content (content ids are keyed HMACs), and cannot enrol an agent.

Rotating the secret key

  1. Generate a new key (openssl rand -base64 32).
  2. On every node set STRUCTAM_SECRET_KEY to the new key and STRUCTAM_SECRET_KEY_PREVIOUS to the old one, and restart the nodes. A node without the old key cannot open the server identity and exits at start. On nodes set up by the server installer, install.sh --secret-key-file NEW --replace-secret-key does this step (re-runs and the secret key).
  3. Run structam rotate-secret-key once, on one node. It re-seals every sealed value in batches and is audited. Configuration contents move to new content ids in the background.
  4. Remove STRUCTAM_SECRET_KEY_PREVIOUS everywhere and restart. TOTP recovery codes made under the old key stop working then; their owners generate new ones.

The agent channel

  • The trust anchor is the server's Ed25519 identity key, pinned by every agent from its join token. There is no trust on first use: an agent without a pin refuses to start.
  • TLS is used, but a TLS-terminating proxy can neither impersonate the server nor rewrite what the agent registers: every field the server acts on is in the handshake transcript both sides sign, and both key-exchange shares are signed, so a relay that swaps one fails.
  • After the handshake every frame is sealed (X25519, HKDF-SHA256, AES-256-GCM per direction) with a strict sequence number: a dropped, repeated or reordered frame ends the connection.
  • Before the WebSocket upgrade, an admission stamp signed by the agent's key (or the join key) must verify and is single-use across nodes; anything else gets a bare 404, so scanners never reach the handshake.
  • A known key on another machine (a cloned image) is refused and reported as agent.clone_suspected; a revoked key is refused forever.
  • Commands are a closed set: collect now, resync, fetch one allowed configuration file, update. The API cannot queue anything else. There is no remote command execution.
  • Agents accept an update only when its manifest is signed by a KazLabs release key compiled into them. The server can withhold updates but cannot hand an agent a binary KazLabs did not sign. (That key has not been generated yet, so release agents refuse every update today.)
  • The agent's built-in deny list cannot be overridden by policy, and secrets in configuration files are redacted on the host before upload (the agent).
  • Everything an agent sends is validated and size-limited before it is written, and only ever touches the host the agent is bound to: the host comes from the agent's record, not from the message.

Rotating the server identity key

structam server-key rotate      # a new key; every enrolled agent is sent the new pin, signed by the new key
structam server-key status      # how many agents acknowledged it
structam server-key activate    # switch once they have (-force: agents that have not must be re-enrolled)

Access

  • Every route is registered with a method and an access rule; a product test enumerates them and fails on host data without a scope check. Scoped users get 404 for hosts outside their scope, in lists, estate views, exports, the event stream, TAXII and Ask AI alike (access control).
  • Sessions use a __Host- cookie (Secure, HttpOnly, SameSite=Lax) and are revoked on every node when the password, second factor or account changes. Brute force is limited by per-address and per-name rate limits and a lockout, counted in the database.
  • There is no CORS; changes with a cookie must be JSON from the public URL's origin. Tokens are never accepted in URLs.
  • An identity provider is trusted only for the subjects it issues: it can never take over a local or another provider's account. Directory errors refuse sign-in; they never fall back to a default role.
  • users.manage is the root of access; the last unscoped administrator cannot be removed through the API.

Outbound connections

  • NetBox, InfraDB, the licence server, model APIs and SIEM sinks are reached through the outbound proxy settings (HTTPS_PROXY, NO_PROXY), with private ranges always direct (STRUCTAM_PROXY_DIRECT) except the cloud metadata addresses, which are never reached directly unless named, so an administrator-typed URL cannot hand the server's instance credentials to anyone.
  • Stored credentials are bound to the endpoint they were saved for: changing the URL needs them again. HTTP clients follow no redirects to other hosts.
  • Send test event refuses private destinations unless STRUCTAM_SIEM_ALLOW_PRIVATE=on.
  • Discovery sweeps only ranges an administrator added, never loopback, link-local, multicast or metadata ranges, and sends no credentials.

What leaves the installation:

DestinationWhatWhen
license.kazlabs.coenrolled agent count, enabled user count, the binary's SHA-256 and versiononce a day, from one node (licensing)
the model API you configurethe question and the tool results (host names, addresses, software, change and audit data)only when Ask AI is configured and used (Ask AI)
SIEM and TAXII destinations you configureaudit and change events; never configuration file contentonly for sinks you add
NetBoxStructam's own custom fields and journal entriesonly with write-back on
InfraDBalarms and linksonly when the integration is configured

Audit

Every change to settings, access and inventory configuration is audited in the same transaction, configuration tables by triggers no code path can skip. The audit log is append-only and hash-chained, with checkpoints signed by the server key and delivered to every SIEM sink. Someone with database access can still delete rows, but structam audit verify detects it unless they can also forge a checkpoint a sink already holds. Each host's change events form their own hash chain (SIEM and TAXII).

Licence

Licences are Ed25519-signed documents verified only with keys compiled into the binary, checked for the product structam and this installation's fingerprint. Time is taken from signed evidence, so setting the clock back or editing the database gains nothing (licensing).

Deployment

  • The server writes nothing to disk and needs no capabilities. The systemd units run it as an unprivileged user with a read-only file system, no capabilities, a system-call filter and namespace restrictions; the image is distroless and runs as non-root user 65532; Kubernetes pods drop every capability and disallow privilege escalation.
  • Only the reverse proxy should listen on the network. The worker's /metrics (STRUCTAM_WORKER_ADDR) and STRUCTAM_METRICS_ADDR have no authentication: bind them to private addresses. /metrics on the main listener needs a token with scope metrics.
  • STRUCTAM_TRUSTED_PROXIES must list only your proxies: their X-Forwarded-For decides the client address for rate limits, token CIDRs and the audit log.
  • Install scripts and agent downloads are public by design (a host being onboarded has no credential yet). They hold no secrets, are rate limited per address, and the script and agent verify what they download themselves.
  • The shipped Caddy configuration's access log drops query strings, because an OpenID Connect callback carries a code there.

Questions the docs do not answer?

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

Talk to us