Security

How Structam handles your estate's data

Where the data lives, what leaves a host and what never does, how agents talk to the server, who can see what, and how the audit log can be checked. Then how to report a vulnerability to KazLabs.

Data model

Your servers, your database

Structam is self-hosted. Everything it records is in one PostgreSQL database that you run; the server writes nothing else to disk. KazLabs does not host it and does not receive your inventory.

What leaves each host

  • The inventory sections the policy turns on: applications, executables with SHA-256 hashes, processes, services, listening ports, local accounts, hardware, patches, network neighbours and system facts.
  • Watched configuration files, redacted on the host before upload, with an HMAC of the raw bytes under a key per agent, so a change behind unchanged redacted text is seen without the raw content leaving the host.

What does not

  • Files on the agent's built-in deny list, which policy cannot override: /etc/shadow*, /etc/gshadow*, SSH host keys, *.key, *privkey*, keystores (.p12, .pfx, .jks, .keystore, .keytab, .kdbx), WireGuard, NetworkManager connections, IPsec and PPP secrets, BSD password databases and the agent's own files.
  • Any file containing a private key block: it is recorded as withheld, with size, mode and owner only.
  • Secrets inside configuration files: PEM keys, credentials in URLs, bearer and basic credentials, secret key=value pairs, XML secret elements and known token shapes are redacted on the host, plus the policy's own patterns.
  • Process command lines, unless the policy turns on processes.cmdline (off by default); they are redacted on the host too.

What leaves the installation

Only what you configure: NetBox reads and the optional write-back, InfraDB, SIEM sinks and TAXII push, LDAP and OpenID Connect sign-in, and the model API for Ask AI. Configuration content never leaves through a sink or TAXII. With a hosted model, Ask AI sends the tool results it needs, which can include host names, addresses, software, change and audit data.

Once a licence is activated, one node sends a heartbeat to the KazLabs licence server at the interval the licence sets (at most every 24 hours, 24 hours by default; hourly while a check is failing): the number of enrolled agents and enabled users, the binary's SHA-256 and the version. An installation in evaluation mode, or with an offline licence, does not contact KazLabs.

Sealed 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 elsewhere does not open. Sealed: integration and sink credentials, OIDC 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.
  • Stored credentials are bound to the endpoint they were saved for: changing a URL, a CA or TLS verification needs the secret again, so nobody can point a saved token at a server they control.
  • The key can be rotated: structam rotate-secret-key re-seals every sealed column, and configuration contents move to new content ids in the background.

Configuration storage

Configuration content is stored once per distinct content across the estate, sealed under its own subkey, and addressed by a keyed HMAC of its hash rather than the hash itself. A copy of the database neither reveals a configuration nor confirms a guessed one. The server re-hashes every content it receives and drops one that does not match the agent's claim; an agent can write only for its own host, only paths its policy allows, and can never link another host's content by naming its hash.

Agent channel

A pinned, sealed channel, opened from the host

Agents connect out to your server over one WebSocket and trust the server identity key pinned in their join token from the first connection. Nothing connects to an agent.

Pinning and the handshake

  • Each agent has its own Ed25519 key. It pins the server's Ed25519 identity key from its join token; there is no trust on first use, and an agent with no pin refuses to start.
  • TLS is used but is not the trust anchor. Every field the server acts on is in a handshake transcript both sides sign, and both key-exchange shares are signed, so a TLS-terminating proxy or relay cannot impersonate the server or rewrite what the agent registers.
  • After the handshake every frame is sealed with AES-256-GCM under keys from an X25519 exchange (HKDF-SHA256, one key 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 seen on another machine, such as a cloned image, is refused and raises a high-severity agent.clone_suspected change event. A revoked key never enrols again.

Join tokens

The token's 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 an agent. Tokens expire (24 hours by default), are single-use by default, are shown once, and are never accepted on a command line or in an environment variable.

No remote command execution

The server can send a closed set of commands: collect now, resync, fetch one configuration file the policy allows, and update (plus policy and pin-rotation messages). The API cannot queue anything else. Everything an agent sends is validated and size-limited, and only ever touches the host the agent is bound to.

Signed updates

An agent accepts an update only when its manifest is signed by a KazLabs release key compiled into the agent, with the right product, version, SHA-256 and size. It downloads only from the server it is pinned to, keeps the previous binary and rolls back after 3 failed starts. The server can withhold an update, but cannot hand an agent a binary KazLabs did not sign.

On the host

  • On Linux the agent runs as root with only CAP_DAC_READ_SEARCH and CAP_SYS_PTRACE in its bounding set, NoNewPrivileges, ProtectSystem=strict (writable: its state directory, its binary directory and /etc/structam-agent), ProtectHome=read-only, PrivateTmp, MemoryDenyWriteExecute and UMask=0077, with network families limited to IP, Unix and netlink.
  • The env file, a join file and the local policy must be owned by root (SYSTEM or Administrators on Windows) and writable by nobody else, or the agent refuses to start: whoever can edit them could point the agent at another server.
  • A root-owned local policy on the host can narrow the paths collected and refuse on-demand fetches, whatever the server's policy says.
structam server-key rotate     # new identity key; every agent is sent the new pin, signed
structam server-key status     # how many agents have acknowledged it
structam server-key activate   # switch once they have
Access control

Scoped in SQL, checked on every route

Roles are granted per NetBox site, tenant and tag. Every route is registered with a method and an access rule, and a test fails on any route that returns host data without a scope check.

Local accounts

  • Passwords are hashed with Argon2id (64 MiB, 3 passes, parallelism 2). At least 12 characters, not a common password, not containing the username.
  • 10 failed sign-ins in 15 minutes lock the name, counted in the database across nodes and for names that do not exist, so the lockout reveals nothing. Sign-ins are also limited to 30 a minute per client address (IPv6 per /64) and 20 per name. Unknown, disabled and locked accounts answer exactly like a wrong password, and take as long.
  • TOTP (RFC 6238) with 10 single-use recovery codes; a used code is refused again. It can be required for every local account or per user.
  • Creating a token and changing a password or TOTP need a sign-in within the last 10 minutes.

Sessions and requests

  • The session cookie is __Host-structam_session: Secure, HttpOnly, SameSite=Lax, stored as a SHA-256 hash, 12 hours idle and 7 days at most. A password change or reset, a TOTP reset, or disabling or deleting a user ends their other sessions on every node at once. Grant changes take effect within 5 s.
  • Same-origin only: no CORS. A change made with a session cookie must be JSON with an Origin equal to the public URL's.
  • API tokens (stt_ and 32 random bytes) are shown once, never accepted in a URL, and never exceed their owner: their grants are intersected with the owner's current grants on every request.

Scope

A host outside your scope answers 404, exactly 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, in SQL; routes that touch two hosts check both.

Identity providers and outbound requests

  • An identity provider is trusted only for the subjects it issues: it can never take over a local account or another provider's. A directory error refuses sign-in and never falls back to a default role.
  • Outbound requests (NetBox, InfraDB, the licence server, model APIs, sinks) go through your proxy policy and follow no redirects to other hosts. Private ranges are reached directly, except cloud metadata addresses, which never are unless named, so an administrator-typed URL cannot hand the server's instance credentials to anyone.
Audit chain

Tampering is detectable

Every change to settings, access and integrations is an audit event written in the same transaction as the change, hash-chained, with a signed checkpoint every 5 minutes.

  • An event and the change it records commit together or not at all. Configuration tables (settings, policies, change rules, roles, grants, tokens, join tokens, sinks and more) 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: a trigger refuses updates and deletes. One node links committed events in commit order, and every 5 minutes writes an audit.checkpoint event signed with the server identity key, which every SIEM sink receives whatever its filters.
  • Each host's change events form their own hash chain.
  • Sign-ins, agent enrolments and refusals, reviews, raw configuration views, exports and every Ask AI question are audited too. Events before sign-in are aggregated per source address per 10 minutes, so a flood writes a few rows, not millions.
structam audit verify                       # exits 1 on any gap, edit, reordering or truncation
structam audit verify -checkpoint cp.json   # also against a checkpoint your SIEM received
structam audit verify -host 42              # host 42's change-event chain
Deployment

The server needs no privileges

The server writes nothing to disk and needs no capabilities. Only the reverse proxy listens on the network.

  • The systemd units run it as an unprivileged structam user with a read-only file system, no capabilities, a system-call filter and namespace restrictions.
  • The container image is distroless, runs as non-root (65532) and read-only. Kubernetes pods drop every capability and disallow privilege escalation.
  • The server refuses an http:// public URL outside development, and there are no default secrets anywhere.
  • The install scripts and agent downloads are public by design, since 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.
  • The bundled Caddyfile drops query strings from its access log, because an OIDC callback carries a code there.
structam.sh

This website

structam.sh is static HTML, CSS and JavaScript served by Cloudflare Pages. It sets no cookies, runs no analytics and loads nothing from other sites: fonts, scripts and images are all served from this domain.

  • Its Content-Security-Policy allows scripts, stylesheets, fonts and connections from this site only, and no inline script or style elements.
  • Pages are served over HTTPS only, with HSTS, nosniff, a same-origin opener policy and a permissions policy that turns off camera, microphone, location, payment and USB.
  • The site has no forms and nothing to sign in to. The contact link goes to the KazLabs website.
Disclosure

Report a vulnerability

If you think you have found a security issue in Structam or on this site, tell KazLabs through the contact form. This domain has no e-mail address.

  1. Open the KazLabs contact form and start your message with "Security report: Structam".
  2. Say what is affected and the version (structam version, or the X-Structam-Version header of any response), and give a short description of the impact.
  3. Leave out exploit details and any data from your estate. We will reply and agree a way to send them.

Test only against installations you run or have permission to test, and never against KazLabs systems or other people's installations. The same contact is published at /.well-known/security.txt.