Skip to content

Security ​

What Probeward does to protect a monitoring server that holds credentials for a whole estate, and what you should do around it. Report a vulnerability privately, as SECURITY.md describes.

Accounts, sessions and roles ​

  • Local users and single sign-on. Local users log in with a user name and password. Passwords are stored as Argon2id hashes (19 MiB, two passes, one lane); the policy is at least 12 characters, not containing the user name. People can also sign in through an OpenID Connect provider; see single sign-on.
  • Login throttle. After 5 consecutive failures for one user name, or 20 from one address, each further attempt must wait 2^(failures - free) seconds, up to 15 minutes. Attempts made while waiting are refused with 429 without checking the password. A successful login clears the user's counter.
  • Sessions. A session is a random 256-bit token in the probeward_session cookie (HttpOnly, SameSite=Strict, Path=/, and Secure when PROBEWARD_PUBLIC_URL is https). Only its SHA-256 is stored. It expires after PROBEWARD_SESSION_IDLE_MINUTES of inactivity (default 720) and never lives past PROBEWARD_SESSION_MAX_HOURS (default 168). A password change ends all of the user's sessions; POST /api/v1/auth/logout-others ends all but the current one.
  • CSRF. Every request except GET, HEAD and OPTIONS must carry a non-empty X-Probeward-CSRF header. A browser will not add a custom header to a cross-origin request without a CORS preflight, and the server never grants one. The cookie's SameSite=Strict is a second barrier. A script that logs in with a session cookie must send the header too; scripts should use an API token instead, which needs none.
  • Roles. A user holds a role (viewer, operator or admin) on a node of the tree, and it applies to everything below that node. What each role may do, and what stays global, is in access control. Sensors that run programs on the probe host (script, nagios_plugin), the one that runs a program on the target over SSH (ssh_script), the WQL query sensor (win_wql) and the database query sensors (postgres_query, mysql_query, mssql_query) can be created and have their parameters changed by an admin only; see scripts. Give every user the lowest role that fits.
  • Two-factor login (TOTP). Any user can enrol an authenticator app (6 digits, 30-second step, one step of clock tolerance) and receives ten single-use recovery codes. With TOTP on, a correct password only creates a pending session, valid for five minutes and good for nothing but POST /api/v1/auth/login/second-factor. The user's TOTP secret is kept in the vault like any other secret. An administrator can reset a user's TOTP (POST /api/v1/users/{id}/totp/reset) and a user's password (POST /api/v1/users/{id}/password). From the command line, probeward admin reset-password USER sets a password and ends the user's sessions.
  • API tokens. Scripts use personal tokens (Authorization: Bearer pwt_...) created by the user for themselves, shown once and stored only as a SHA-256. A token request needs no CSRF header and gets no cookie, and cookie sessions still need the header. A token has an optional expiry, a last-used time and address, and a role that can never exceed its owner's current role. Disabling or deleting the owner stops their tokens at once. A token can also be limited to a subtree or a set of actions (scoped tokens). A token cannot create tokens, change passwords or two-factor settings, or open the event stream. Administrators list and revoke anyone's. Failed token attempts are throttled per address like failed logins, separately. See API.
  • Push URLs. An HTTP push sensor has an ingest token in the path of its URL (/api/v1/push/{token}), shown once, stored only as a SHA-256 and rotatable. The endpoint takes no session, is limited in body size and rate, answers an unknown token with the same 404 as any unknown path, and throttles failed guesses per address. The path is masked in request logs. See HTTP push.
  • Audit. Every configuration change, control action and sign-in event writes an audit record with actor, action, object and source address. Administrators read it at GET /api/v1/audit (Settings, Audit log). Records are kept for 730 days by default.

The vault and the master key ​

Credentials (SNMP communities and v3 secrets, SSH passwords and keys, SMTP logins, webhook, Discord and Telegram secrets, TOTP secrets) are stored encrypted:

  • Each credential has its own random 256-bit data key and is encrypted with XChaCha20-Poly1305.
  • The data key is encrypted under the master key, a 32-byte random key in a file outside the database (PROBEWARD_VAULT_KEY_FILE; in the reference install, its own Docker volume).
  • Ciphertexts are bound to their credential id, so moving one between rows makes decryption fail.
  • The database stores the key's id and a check value. Starting with a key that does not belong to the database fails at once, naming the two key ids. A key file readable by group or others is refused.
  • The API never returns a credential's value: only its id, name, kind and where it is used.

What this protects against: a stolen database dump or backup of the database alone reveals no credential values. What it does not: an attacker who has both the key file and the database, or who controls the running server. The server must be able to decrypt to poll, so a compromise of the host or the container exposes the credentials in use. Keep the key file out of any backup that also holds the dump, or at least encrypt the combined backup. See backup and restore.

Use read-only accounts everywhere: SNMP communities and v3 users with read access only, SSH users with no shell privileges beyond cat, df and getconf. A monitoring server is a high-value target and the credentials in it should be worth little.

Trap and syslog receivers ​

The trap and syslog sensors make a probe listen on UDP 162 and UDP and TCP 514 (or the ports you set), open to the devices and to anyone else who can reach them. A source address can be forged, and v1, v2c and syslog messages carry no proof of who sent them, so a match is evidence and not proof: firewall the ports to the devices, and use SNMPv3 with authentication where the device can. A datagram from an address no sensor watches is dropped before it is read; a flood is cut by a rate limit per device and a bound on memory; a community is never stored; what a device writes in a log line is stored as written. Receivers has the details.

Remote probes ​

  • Probes connect to a separate listener with TLS 1.3 and client certificates from the core's own probe CA. Each side pins that CA; the system trust store plays no part. The CA key is sealed with the vault master key in the database.
  • A pairing token is single use, valid for one hour, and stored only as a hash. Issuing and pairing are audited; the token itself is never logged or stored.
  • A probe receives the credentials its sensors need, over the session only, and keeps them in memory. It never writes them to disk. A revoked or stolen probe must be assumed to have seen them: rotate them if the machine is not trusted.
  • Revocation takes effect at once, for new handshakes and the open session. See probes.

What is never logged ​

Credential values never appear in logs, API responses, exports, events, notification payloads or audit records. Error messages name the credential, never its content. The files of the configuration export name credentials, never their values. Webhook, Discord and Telegram secrets and a webhook's signing key are never shown at all. The heartbeat URL, which often carries a token in its path, is only ever shown masked (https://host/…), administrators included, and is scrubbed from errors and logs. API tokens and push tokens are never shown again after the first time.

Tests hold this: one plants a marker in every credential kind and every secret the product holds and fails if the marker reaches an export, a plan, an audit entry or any of the places above, and one per kind of token searches every response, every table and the captured log for the token. In the rehearsal described in backup and restore, marker strings stored in two credentials did not appear in the container logs.

Logs do contain user names, device names and addresses, and the source address of requests.

Hardening the reference installation ​

  1. Claim the instance immediately. Until the first administrator exists, POST /api/v1/setup is open to anyone who can reach the server, by design: it is how the first user is made. On an exposed host, install with PROBEWARD_BIND_ADDRESS=127.0.0.1 in .env, finish setup through an SSH tunnel, then open it up.
  2. Expose only Caddy. Compose publishes only Caddy's ports. PostgreSQL and Probeward have no published port. Keep it so, and firewall ports 80 and 443 to the networks that need them. Do not publish port 8080.
  3. Use TLS everywhere. Caddy obtains a certificate for a public domain automatically. For an internal name use Caddy's own authority (see install). Caddy sends Strict-Transport-Security and the server sets a strict content security policy, X-Frame-Options: DENY, nosniff and no-referrer.
  4. Trusted proxies. PROBEWARD_TRUSTED_PROXIES decides whose X-Forwarded-For is believed. The Compose default trusts the private ranges Docker networks come from. If you put another proxy in front, or run Probeward elsewhere, narrow it to the proxy's address. A too-wide list lets clients forge the source address in the audit log and dodge the per-address login throttle.
  5. Turn on two-factor login for every administrator.
  6. Protect .env and the volumes. deploy/.env holds the database password; install.sh creates it with mode 0600. The vault volume holds the master key. Anyone who can run docker on the host can read both.
  7. Set a heartbeat (Settings, Global) so that something outside Probeward tells you when it stops.
  8. Sign webhooks. Give each webhook destination a signing key and have the receiver check the X-Probeward-Signature header and its timestamp (see webhook). The URL alone is a bearer secret; the signature also proves the body was not changed or replayed. The key is a vault credential, set by administrators and never shown again.
  9. No outbound surprises. Probeward makes no connection you did not configure: no phone-home, no update check. Outbound traffic is polls, notifications and the heartbeat, and, only if you set OTEL_EXPORTER_OTLP_ENDPOINT, telemetry export to the collector you named (off by default; a probe exports only if its own environment says so). What it sends is listed in what is never exported; the collector's token is held as a secret. The heartbeat is withheld whenever Probeward could not alert, so the outside watcher notices; notification retries stop after PROBEWARD_DELIVERY_MAX_ATTEMPTS attempts.
  10. Keep it updated and watch for advisories; see upgrade.

Hardening the deb installation ​

The package's defaults are the first half of this list: the server listens on the loopback address only, /etc/probeward/probeward.env is readable by root only, the vault key is mode 0600 and owned by the service user, and the systemd unit drops every capability and restricts the file system, system calls and address families (see install). What is left to you:

  1. Put a reverse proxy with TLS in front, and keep PROBEWARD_LISTEN on 127.0.0.1.
  2. Set PROBEWARD_TRUSTED_PROXIES to the proxy's address only if the proxy is on another host.
  3. Claim the instance at once: the setup page is open until the first administrator exists. It is only reachable from the host itself until you set up the proxy, which gives you time.
  4. Back up the vault key apart from the database dumps, and do not delete it when you purge the package unless you mean to lose the credentials (install).
  5. Items 5 and 7 to 10 of the list above apply unchanged.

Known advisory: RUSTSEC-2023-0071 (rsa) ​

RUSTSEC-2023-0071 is the "Marvin attack": a non-constant-time RSA implementation in the rsa crate that can leak information about a private key through timing, observable over the network. The advisory lists rsa 0.10.0 and later as patched.

  • Probeward's SSH sensors (ssh_disk, ssh_load) use the russh library, which depends on rsa. cargo tree -i rsa@0.10.0 shows the only users: russh and ssh-key.
  • The locked version is 0.10.0, the patched release. The advisory therefore does not apply to the shipped binary, and cargo deny check advisories reports nothing for it.
  • Cargo.lock also lists rsa 0.9.10, which is vulnerable. It is a dependency of sqlx-mysql, which sqlx lists in the lock file but is not compiled: Probeward builds sqlx with only the PostgreSQL driver, and cargo tree --target all --all-features -i rsa@0.9.10 prints nothing. Scanners that read only the lock file, not the build graph, may still report it; it is not in the binary.
  • Where RSA could be used at all: to check an RSA host key of a target and, for an ssh_key credential holding an RSA key, to sign the login. The signing operation is the one the attack is about, and it is observable only by the SSH server the sensor logs in to, on a network path you control. Ed25519 and ECDSA keys do not use it. If you want nothing to depend on it, use Ed25519 keys for the monitoring account.

Re-run cargo tree -i rsa and just deny after every dependency update to confirm this still holds.

Nightly scans ​

Every night the nightly-security workflow scans the whole Git history for committed secrets with gitleaks and the lock files (Cargo.lock, ui/pnpm-lock.yaml, docs/pnpm-lock.yaml) for known vulnerabilities with osv-scanner. A failed run is reported by GitHub like any failed workflow. just scan runs the same checks locally.

osv-scanner reads lock files, so it also reports crates that are locked but never compiled, such as rsa 0.9.10 above. Advisories accepted for that reason are listed with their reason in osv-scanner.toml, matching the decisions in deny.toml. A test value that looks like a secret carries a gitleaks:allow comment on its line.

Known gaps ​

Limits that the rest of the documentation would otherwise hide.

  • A changed SSH host key needs a person. The sensors record a target's SSH host key on first use and refuse a changed one. After a change you expected, an operator chooses Forget stored state in the sensor's settings (DELETE /api/v1/sensors/{id}/state, audited) and the next poll records the new key. If you did not expect the change, find out why first.
  • Setup is public until the first user exists, as described above.
  • The vault key cannot be rotated from the command line. The store supports re-wrapping every data key under a new key, but no command exposes it yet.

AGPL-3.0-only