SURROGATE Administrator Manual

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:

PartRuns onHolds
Braincompany networkdatabase, vault, protocol gateways, recordings
PortalDMZthe 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

ComponentRequirement
HostLinux x86_64 or aarch64, glibc present
Node/Denonot needed — the package ships the server binary
PostgreSQL13 or newer, on the brain (or reachable from it)
TLSa certificate for the portal's public name, trusted by the brain
Open portsportal: 80/443 in, 7300–7399 in only while a native seat runs · brain: 443 from administrators only
Timeboth 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.

FlagEffect
`--role brain\portal\both`which half this host runs
--target <dir>where the installation lives (created if missing)
--systemdwrite /etc/systemd/system/surrogate-<role>.service
--nowstart or restart the service without asking
--cert-dir <dir>copy fullchain.pem + privkey.pem from here and check the name
--hostsappend the suggested names to /etc/hosts (root)
--install-depsinstall 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

  1. Database — host, port, name, user, password. The connection is tested.
  2. 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).

  3. Schema — an empty database gets server/db/schema.sql; an existing one is
  4. compared against schema_migration and the missing migrations are applied; a database newer than the package is refused.

  5. Portal address — https://<name>; DNS, TCP 443 and the certificate are
  6. checked and reported (⚠ does not stop the installation).

  7. Certificate — --cert-dir copies and verifies the name.
  8. /etc/hosts — the two names are suggested; --hosts writes them.

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:

KeyDefaultMeaning
session.idle_minutes10login expires without activity in the portal (0 = off)
session.admin_idle_minutes5same for the console
session.token_ttl_minutes480absolute limit of a login
session.bind_iptruea login is bound to the network it came from
auth.mfaoffoff / optional / required — second factor
policy.allow_clipboardfalsedefault for new safes
recordings.native_fps10frames per second in native recordings
link.ping_seconds30keepalive 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.enabledtrueRDP 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

FileWhat happens if it is lost
server/secrets/master.keyevery stored password is unrecoverable — back it up
server/secrets/link.keythe brain and the portal no longer trust each other; copy the same file to both
keys/portal/privkey.pem, bin/keys/privkey.pembrowsers 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 →

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.

Users
Users

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

Safes
Safes

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

Vault
Vault

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).

TaskWhere
Add a person who may sign inConsole → Users → New user (role, password, second factor)
Add a target systemConsole → Assets
Add the login used on that targetConsole → Accounts (login, auth mode, vault secret)
Grant accessConsole → Safes → Accounts / Users
Store a passwordConsole → Vault → New secret
Suspect a leaked passwordConsole → Vault → Block (reason mandatory; running sessions can be ended)
Watch a sessionConsole → Sessions → Watch (browser) or Native watch (real client)
End a sessionConsole → Sessions → Terminate, or Disconnect in the portal
See what happenedConsole → 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

SymptomLook at
Users see brain.unavailableportal 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 connectthe 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 immediatelygateway binary present (bin/surrogate-rdp-native), target reachable, rdp_gateway.enabled
Recording is emptythe adapter cannot record that protocol/mode, or the session lasted under a second
Nothing in the console logthe 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
  • terminal cast with the command list.

  • A blocked credential keeps its detached sessions until their time limit if
  • they were not terminated on the spot.

  • Listing a folder on a Linux target asks one question per entry — a folder with
  • hundreds of entries needs seconds.

  • Clipboard is text only.