Skip to content

Security: lifeqsoll/SysSpectogram

Security

SECURITY.md

Security Policy

SysSpectogram is a self-hosted Linux host guard. This document is the operator-facing security policy: what we support, how to report issues, what we actually trust, and what we will never claim.

For the deeper model (assets, adversaries, residual risk) see docs/THREAT_MODEL.md. For signing and manifests see docs/SUPPLY_CHAIN.md.

Recent hardening

  • 1.6.0 — Rust metrics shadow metadata and event provenance; bounded incident evidence and wall-clock spectrogram labels; explicit permanent-ban handling and atomic timed-member refresh. See CHANGELOG.md [1.6.0] and RELEASE_v1.6.0.md.
  • 1.5.0 — live guard-core RuleEngine/risk over Unix socket (Python fallback); ban6 migrate preserves IPv6 members; Telegram /notify filters. See CHANGELOG.md [1.5.0] and RELEASE_v1.5.0.md.
  • 1.4.1 — HMAC-signed agent stop markers (do not trust signal si_pid alone), verified pidfile identity, eBPF sender comm/ppid, quieter setuid/openat, protect/prefix/flow/login hardening. See CHANGELOG.md [1.4.1].

Supported versions

Version Supported
1.6.x Full support (current)
1.5.x Security fixes
1.4.x Security fixes
1.3.x Security fixes
1.2.x Security fixes
1.1.x Security fixes only
1.0.x Best-effort; please upgrade
< 1.0 Unsupported

Prefer the latest tagged release from GitHub Releases. Friend installs should use the matching AppImage / .deb plus the signed wheel/agent for that same tag — not a random main checkout on a production VPS.

Report a vulnerability

Do not open a public issue for an exploit that can harm live hosts (RCE, privilege escalation, unlock bypass, forged agent alerts, supply-chain forge, etc.).

Preferred channels:

  1. Private vulnerability reporting (GitHub Security Advisories — preferred).
  2. Or email the maintainer address listed on the GitHub profile / release notes.

Please include:

  • Affected version / commit / package (AppImage, wheel, agent binary).
  • Host OS and how you run the stack (systemd, Control Center child, dry-run, …).
  • Clear reproduction steps or a minimal PoC.
  • Impact (who can trigger it, what they gain).
  • Whether you plan a public write-up and your preferred timeline.

Target response: triage acknowledgement within 72 hours. Fix timing depends on severity and whether a coordinated disclosure date is agreed.

We welcome responsible disclosure. We do not run a paid bug bounty.

Scope (in / out)

In scope

  • Guard / agent / helper / Control Center behavior on a machine the reporter controls (or has explicit permission to test).
  • Bypass of Telegram / web / control-socket unlock.
  • Forging critical agent alerts without a valid HMAC / PEERCRED path.
  • Tampering with release artifacts that still verify under our documented checks.
  • Logic bugs that auto-ban the operator despite a correct never_ban allowlist.
  • SSRF / private-IP reachability via configured alert sinks when defaults should block it.

Out of scope

  • Attacks that already assume root on the same host and then stop units / delete state (see Same-host ceiling).
  • Social engineering of BotFather tokens or leaked .env files.
  • DoS by flooding a deliberately enabled public web UI without network controls.
  • Issues only present in unreleased main unless they also affect a tagged release.
  • Third-party profile packs or models you installed without verifying signatures.

Trust boundaries (honest)

Defaults are intentionally cautious.

Response and lockout

  • Default response.mode: observe — notify only, no auto-ban.
  • Soft / aggressive / isolate modes still honour response.never_ban_cidrs (one or many IPs/CIDRs; bare IP normalises to /32 or /128). Set your admin path before enabling auto-ban.
  • kirk.auto_isolate is off by default and needs both kirk.allow_ssh_cidrs and a valid agent HMAC on allowlisted critical rules.

Agent authenticity

  • Agent Unix datagram socket: mode 0600, same-UID PEERCRED, optional PID allowlist, HMAC-SHA256 on critical rules (kirk hide/drift/IMA, agent_unexpected_root, clean shutdown, agent/guard down, …).
  • Secret: state/agent_hmac.secret or SYSSPECTOGRAM_AGENT_HMAC.
  • Binary exe seal rejects a swapped agent process that still holds the PID.

Control plane (Telegram / web / local socket)

  • Destructive actions require a console unlock code shown in Control Center / state/unlock.code (never sent in the unlock Telegram notice itself).
  • Unlock language follows ui.lang once per guard start (no dual EN+RU spam from one process).
  • Local SOAR uses state/control.sock with the same unlock gate as Telegram.
  • Multi-VPS fleet control uses SSH + device tokens (host pair code); see docs/FLEET.md. No public HTTPS control plane.
  • Web read APIs (/api/status, /api/snapshot, /api/stream) require a valid ss_session cookie or Bearer (state/web.token) — loopback alone is not enough. /api/health stays public (ok + unlock_code_len only). When control is LOCKED, authorized responses still redact bans/processes/allowlist.
  • Dashboard WEB LOGIN CODE (state/web.login, POST /api/login) mints a read session; it does not unlock SOAR. Control unlock stays separate.
  • nft lockdown/quarantine/shield comments are quoted (colons broke rules on real nft). Lockdown SYN match is flags syn / fin,syn,rst,ack (a bare syn / syn never installed on nft 1.1.x). A failed lockdown or syn-rate-limit rolls back only the rules that attempt added; it does not remove the other feature's rules. Lockdown state flips only after nft succeeds.
  • home health ssh_source is false when the system journal is absent, including for root. journalctl --system is run without -q so "No journal files were found" is visible.
  • Kirk isolate DNS uses /etc/resolv.conf and, when that file only has a systemd-resolved stub, upstreams from resolvectl dns (IPv6 kept intact; DNS-over-TLS #name also allows port 853). If neither lists a non-loopback resolver, public names do not resolve during isolate (oif lo only reaches the stub).
  • Repeating lockdown with a new admin CIDR inserts that allow before the SYN drop. A new syn-rate-limit allow is inserted before the drop; a different rate replaces the drop rule instead of reporting a rate that was not installed.
  • Kirk isolate does not open DNS or TCP/443 to the internet. DNS goes to configured resolvers; HTTPS only to kirk.egress_allow_cidrs (default: Telegram publish ranges).
  • POST bodies: Host checked before read; Content-Length must be a non-negative integer ≤ 64 KiB.
  • home settings / seed writes are flocked; schema type checks reject non-finite / out-of-range values (allow_nan=False).
  • kirk_isolate deadline is on disk (state/kirk_isolate.json 0600); expired tables are cleared on backend start; failed SSH-allow install rolls the table back.
  • Helper: concurrent connection handlers (ban.* not blocked by silent peers); pkcheck bounded; ban IP rules match Python (no IPv4-mapped / broadcast / 240/4, no RFC1918/ULA/CGNAT unless overlay response.allow_private_bans; ban.add also refuses Telegram CIDRs, resolvers from resolv.conf / /run/systemd/resolve/resolv.conf, and v4+v6 default gateways).
  • SYN_RECV counts unique (ip, port) once per window (not once per poll); SYN_SENT is a separate non-ban flow_syn_sent_hang alert. flow_syn_burst is alert-only unless flow.auto_ban: true. ban_ip refuses Telegram publish ranges, resolvers, IPv4 and IPv6 default gateways, and private/ULA/CGNAT (unless allow_private_bans). IPv6 brute aggregation bans the /N prefix (ban6 interval), not a single /128.
  • Auth log: Failed/Invalid with more than one from <ip> port → auth_log_injection. Only the sshd tail peer is counted as a fail (embedded from addresses are not). One injection alert per peer per 10 minutes (suppressed counts the rest); about 10 injection alerts per minute host-wide, then the overflow is digested. A single sshd tail from <ip> port …$ is the peer. Accepted uses the first from after the user.
  • Mini App /api/auth/telegram matches user id to TELEGRAM_ALLOWED_USER_IDS / telegram.allowed_user_ids and chat id exactly (no lstrip("-")). A negative group chat_id without allowed_user_ids is refused (chat alone never grants a session). Unlock and login have separate per-IP buckets. Wrong guesses do not rotate the login or unlock code, so a flood cannot invalidate the code the operator already has; a correct code still works during rate limiting. Codes still rotate on expiry and after a successful login or unlock. Behind an HTTPS tunnel every client looks like 127.0.0.1, so per-IP rate limits do not isolate users. /api/logout drops the session; SSE re-checks it and closes the connection.
  • Resolvers: /etc/resolv.conf plus fallback /run/systemd/resolve/resolv.conf when the stub is 127.0.0.53 and resolvectl is unavailable. Local forwarders (dnsmasq/unbound) that are not listed there are not auto-protected — put them in never_ban_cidrs.

Same-UID ceiling for unlock (I-03): the unlock gate protects a stolen Telegram bot token / Mini App session — not malware running as the same Unix user as the guard. That process can already read state/unlock.code (mode 0600, owner-only) or the .env bot token. Persisted state/control.unlocked (only when unlock TTL is 0) accepts the exact marker 1 and refuses symlinks / arbitrary content; it is still same-UID writable by design. Treat same-UID compromise as full control of the guard process.

Single guard

  • Only one guard may hold state/guard.lock. A second instance would unlink/rebind the agent socket, miss heartbeats, and flood false agent_kirk_agent_down alerts. Control Center refuses to start a second guard when the pidfile is alive.

Packaged install (AppImage / deb)

  • First-run Install stack downloads the same-version GitHub Release assets (wheel + musl agent). SHA-256 is required (SHA256SUMS for wheel/agent stack only + agent .sha256). Desktop bundles use a separate SHA256SUMS.desktop so they cannot overwrite the stack sums file. If a .minisig is published for an asset, minisign must succeed (install minisign; soft-fail is not accepted).
  • No runtime git clone / git pull as the friend install path (ADR 0005).
  • Runtime data lives under ~/.local/share/sysspectogram unless SYSSPECTOGRAM_HOME is set.
  • Details: RELEASE_v1.1.1.md, FRIEND.md, SUPPLY_CHAIN.md.

Models and packs

  • Prefer ONNX / pickle-free artifacts. cnn.pt loads with weights_only=True only.
  • Legacy joblib needs SYSSPECTOGRAM_ALLOW_JOBLIB=1 and is refused when supply-chain enforce is on.
  • Profile packs: verify SHA-256 + minisign in production; local HMAC .sig is compatibility only.

Privilege split

  • Control Center never runs as root. System overlays / service control go through sysspectogram-helper + polkit when the helper is installed.
  • Home / Day-0 overlays can live in user-owned state/user-settings.json without the helper.
  • Distro units for guard/monitor run as the dedicated sysspectogram account; the packaged agent defaults to userspace and does not get eBPF capabilities unless an operator adds a reviewed drop-in.

Ban operations (sysspectogram group)

On friend / headless installs the guard often runs without root. Auto-ban then uses the helper’s nft set path, authorized by Unix group membership (sysspectogram), not polkit — so a headless unit never blocks on a desktop pkcheck dialog.

Threat note: any local user in group sysspectogram (or any process running as that user) can ask the helper to add/remove ban-set members within the helper’s allowlist. Treat group membership like partial network admin: do not add untrusted accounts to sysspectogram; keep the helper binary and unit files root-owned; prefer a dedicated service user over sharing the group with human login accounts. Compromise of a group member can disrupt SSH reachability to your VPS (DoS), not remote code execution in the helper itself.

Evidence and sinks

  • Local JSONL is convenient, not WORM storage. Remote alerts.sinks (HTTPS / syslog) can mirror events off-box; private/link-local sink hosts are blocked unless explicitly allowed.
  • Hybrid watchdog (Phoenix userspace; optional DKMS module, default off) aims to make agent death noisy, not immortal. See AGENT_PROTECT.md.

Hardening checklist (operators)

  1. Install from a tagged release; verify minisign / SHA256SUMS when you download by hand.
  2. Put your SSH / admin IP(s) in never-ban before enabling soft/full auto-ban.
  3. Keep Telegram unlock required (telegram.require_console_unlock: true).
  4. Keep the agent HMAC secret mode 0600 and off shared disks.
  5. Prefer response.mode: observe until charts and alerts look sane.
  6. Turn on remote alert sinks if you need evidence after a local wipe.
  7. Do not run multiple guards; use one Control Center Start protection.
  8. Treat imported ML weights as untrusted until you trained them yourself or verified the publisher.

Same-host ceiling

If an attacker already has root on the monitored VPS, they can stop systemd units, kill processes, replace binaries under paths they own, and delete local logs. SysSpectogram tries to make that noisy (remote sinks, Dead-man, phoenix respawn, dual-process friction) — not impossible.

Do not market or assume “unkillable EDR”, “rootkit-proof”, or “survives hostile kernel”. Out-of-guest visibility (VMI) remains lab / opt-in and is not a production guarantee.

Full write-up: docs/THREAT_MODEL.md.

What we will not ship

  • Rootkit / malware samples “for tests”
  • Claims of being rootkit-proof or unkillable
  • Mandatory phone-home telemetry (see TRUST.md)
  • Runtime git pull / clone as the supported friend install path
  • Process kill / isolate from Telegram without the unlock gate (helper ban.* is group-gated for headless auto-ban; interactive SOAR stays unlock-gated in the guard)

Related docs

Doc Topic
THREAT_MODEL.md Assets, adversaries, residual risk
SUPPLY_CHAIN.md Manifests, minisign, CI secrets
TRUST.md Privacy / no phone-home
AGENT_PROTECT.md HMAC, seal, phoenix
ROOT_WATCH.md Unexpected root
KIRK.md Integrity / isolate
CONTROL_CENTER.md Helper + polkit surface
RELEASE_v1.6.0.md Latest release notes
FRIEND.md Friend install path

There aren't any published security advisories