Operating Surrogate
Administrator Manual
Installing, configuring and running Surrogate — and what a person does with it every day.
01About this book
Applies to Surrogate v0.6 · server 2026.12.01 · schema migrations 1–16. The authoritative version of an installation is the one in VERSION and in the header of the web console (2026.12.01 - 384 = server version - repository revision).
This manual is for whoever installs and operates Surrogate. For the day-to-day handling (signing in, connecting, watching, files) see the User Guide.
Next: What Surrogate is →
02What Surrogate is
A bastion for privileged access, in two halves:
| Part | Runs on | Holds |
|---|---|---|
| Brain | company network | database, vault, protocol gateways, recordings |
| Portal | DMZ | the web front end and one outgoing WebSocket to the brain |
Only the portal is reachable from outside. It has no database, no vault and no gateway; everything a user does is forwarded over a single WebSocket that the brain dials out to the portal. No port of the company network is open to the outside.
A user therefore never touches a target system directly: they get a session on the brain, which connects to the target, records it and enforces the safe's rules.
Browser ──443──► Portal ──(one outgoing WebSocket)──► Brain ──SSH/RDP──► target
Next: Requirements →
03Requirements
| Component | Requirement |
|---|---|
| Host | Linux x86_64 or aarch64, glibc present |
| Node/Deno | not needed — the package ships the server binary |
| PostgreSQL | 13 or newer, on the brain (or reachable from it) |
| TLS | a certificate for the portal's public name, trusted by the brain |
| Open ports | portal: 80/443 in, 7300–7399 in only while a native seat runs · brain: 443 from administrators only |
| Time | both hosts should share a time zone — see §9 |
Next: Installation →
04Installation
The package is always unpacked somewhere temporary and installed into a directory of its own. Nothing is unpacked into the live directory, and a first installation and an update are the same command.
cd /tmp && 7z x -y v0.6.7z && cd v0.6
sudo ./install.sh --target /srv/surrogate --role brain --systemd
sudo ./install.sh --target /srv/surrogate --role portal --systemd
--target is mandatory; running the installer from the directory it is supposed to fill is refused.
| Flag | Effect | ||
|---|---|---|---|
| `--role brain\ | portal\ | both` | which half this host runs |
--target <dir> | where the installation lives (created if missing) | ||
--systemd | write /etc/systemd/system/surrogate-<role>.service | ||
--now | start or restart the service without asking | ||
--cert-dir <dir> | copy fullchain.pem + privkey.pem from here and check the name | ||
--hosts | append the suggested names to /etc/hosts (root) | ||
--install-deps | install PostgreSQL if it is missing (asks first) | ||
--data-dir <dir> | where recordings are stored |
What the installer asks
Only while the configuration is still identical to the example — afterwards it never overwrites anything and only reports what is missing.
Brain
- Database — host, port, name, user, password. The connection is tested.
- Schema — an empty database gets
server/db/schema.sql; an existing one is - Portal address —
https://<name>; DNS, TCP 443 and the certificate are - Certificate —
--cert-dircopies and verifies the name. - /etc/hosts — the two names are suggested;
--hostswrites them.
A missing database or user is created on request (superuser needed). If PostgreSQL is not reachable, the installer names the package command for this distribution and stops (or installs it with --install-deps).
compared against schema_migration and the missing migrations are applied; a database newer than the package is refused.
checked and reported (⚠ does not stop the installation).
Portal — its own public name, the brain's source address (link.allow_ip), the path to the brain's link.key, and the certificate.
The first administrator is created on the setup page, not by the installer: the installer prints a one-time token, https://<host>:443/brain/ asks for it once and lets you choose login and password.
After the installation
systemctl status surrogate-brain
journalctl -u surrogate-brain -f
Look for:
[surrogate] surrogate initializing {"version":"…","role":"brain"}
link established {"brain":"…","host":"…"} (portal log)
Next: Configuration →
05Configuration
server/config/surrogate.brain.json (brain) or surrogate.portal.json (portal). Every key has a built-in default, so a configuration from an older release keeps working; new keys simply fall back to the default.
Environment variables override the file (SURROGATE_DB_PASSWORD, SURROGATE_SESSION_IDLE_MINUTES, …) — see server/README.md in the repository for the full list.
The values an operator is most likely to touch:
| Key | Default | Meaning |
|---|---|---|
session.idle_minutes | 10 | login expires without activity in the portal (0 = off) |
session.admin_idle_minutes | 5 | same for the console |
session.token_ttl_minutes | 480 | absolute limit of a login |
session.bind_ip | true | a login is bound to the network it came from |
auth.mfa | off | off / optional / required — second factor |
policy.allow_clipboard | false | default for new safes |
recordings.native_fps | 10 | frames per second in native recordings |
link.ping_seconds | 30 | keepalive on the brain-to-portal link (0 = off) |
link.public_host | — | the address users type. It is also the host in the native RDP/SSH commands the console hands out, so set it in every mode — split and single box. Empty or localhost limits those commands to the machine itself (the log warns about it) |
rdp_gateway.enabled | true | RDP through our own Rust gateway |
A running session does not keep the login alive. When the login expires the session continues; the next login brings its tab back.
Secrets on disk
| File | What happens if it is lost |
|---|---|
server/secrets/master.key | every stored password is unrecoverable — back it up |
server/secrets/link.key | the brain and the portal no longer trust each other; copy the same file to both |
keys/portal/privkey.pem, bin/keys/privkey.pem | browsers and the link complain; reissue the certificate |
Back up master.key and the database together — one without the other is useless.
Next: The link between the halves →
06The link between the halves
- The brain dials
link.portal(a DNS name, not an IP — rustls checks the - The portal accepts only from
link.allow_ip. - Both sides ping every
link.ping_seconds; a link that dies is reported with
name and ignores verify_tls: false).
its close code: 1001 = the other side restarted, 1006 = network timeout, 4403 = refused (wrong key or address).
If the portal log does not show link: brain connected, check in this order: DNS name resolves from the brain, port 443 reachable, certificate valid for that name, same link.key on both hosts, link.allow_ip correct.
Next: Update →
07Update
Same command as the installation, with the new package:
cd /tmp && 7z x -y v0.7.7z && cd v0.7
sudo ./install.sh --target /srv/surrogate --role brain --systemd
The installer replaces code only. Configuration, secrets/, recordings and certificates stay; the database is brought up to the package's schema automatically and the installer asks whether to restart the service (it does not restart a running one by itself).
Before the first update of a new installation: copy server/secrets/ and server/config/ somewhere safe.
Next: Day-to-day operations →
08Day-to-day operations
The console is the administrator's side: Users (who may sign in), Assets (the targets), Accounts (the login used on a target), Safes (who may use which account), Vault (the stored passwords), Sessions (live and past), Requests (JIT approvals) and Settings.

A user carries exactly one role; a blocked account keeps its record for the audit and is hidden from the list by default.

A safe is not a login. It says who may use which account on which target, under which conditions (window, approval, recording, clipboard, limits).

In the vault a secret can be revealed (audited), checked out (others may not change it while you do) and blocked (nobody may use it — the reason is mandatory and shown to whoever tries).
| Task | Where |
|---|---|
| Add a person who may sign in | Console → Users → New user (role, password, second factor) |
| Add a target system | Console → Assets |
| Add the login used on that target | Console → Accounts (login, auth mode, vault secret) |
| Grant access | Console → Safes → Accounts / Users |
| Store a password | Console → Vault → New secret |
| Suspect a leaked password | Console → Vault → Block (reason mandatory; running sessions can be ended) |
| Watch a session | Console → Sessions → Watch (browser) or Native watch (real client) |
| End a session | Console → Sessions → Terminate, or Disconnect in the portal |
| See what happened | Console → Sessions log, session_event, audit |
A session that lost its client (closed tab, network, another device) stays detached and keeps running until its safe's time limit; the owner gets it back by signing in again.
Next: Troubleshooting →
09Troubleshooting
| Symptom | Look at |
|---|---|
Users see brain.unavailable | portal log: is the link up? link.allow_ip, link.key, certificate name |
| Login works, then "Your session ended" | session.idle_minutes / session.admin_idle_minutes; the console expires after 5 minutes by default |
| A safe refuses to connect | the safe's window, JIT approval, max_concurrent, exclusive_account |
| "vault blocked this credential: …" | the credential is blocked; lift it in the Vault tab |
| RDP session ends immediately | gateway binary present (bin/surrogate-rdp-native), target reachable, rdp_gateway.enabled |
Recording is empty | the adapter cannot record that protocol/mode, or the session lasted under a second |
| Nothing in the console log | the plugin is idle: SURROGATE_CONFIG is not set (see §3) |
Logs: journalctl -u surrogate-brain -f and -u surrogate-portal -f. The session log in the console shows server lines and gateway lines for one session.
Next: Time →
10Time
Store in UTC, show in the browser's zone: the database and the protocol always carry UTC, the web interface converts. journalctl shows the host's time zone — set it to the customer's zone so that a log line and a user report can be compared:
timedatectl set-timezone Europe/Vienna
Next: Limits of this version →
11Limits of this version
- Two-factor is TOTP. The phone app for pairing and QR sign-in is the next step.
- Recording of RDP is a video of the gateway's picture; SSH is recorded as a
- A blocked credential keeps its
detachedsessions until their time limit if - Listing a folder on a Linux target asks one question per entry — a folder with
- Clipboard is text only.
terminal cast with the command list.
they were not terminated on the spot.
hundreds of entries needs seconds.