mlab docs

mlab-agent

The mlab.sh workspace agent: runs on your hosts, connects out only, and serves the tools its local policy allows.

mlab-agent is the on-site agent of mlab.sh workspaces. It runs on the host that holds the data, connects out to mlab.sh (no listening port), runs the tools its local policy declares, and serves your workspace's requests: each one signed, end-to-end encrypted, checked against the policy and written to a local audit log.

Linux x86_64, glibc 2.36 or later. Needs an mlab.sh workspace (Team or Enterprise plan). Setup guide: The agent.

Installation

# Debian, Ubuntu
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://apt.mlab.sh/mlab.asc -o /etc/apt/keyrings/mlab.asc
echo "deb [signed-by=/etc/apt/keyrings/mlab.asc] https://apt.mlab.sh stable main" | sudo tee /etc/apt/sources.list.d/mlab.list
sudo apt update && sudo apt install mlab-agent

# Fedora, RHEL, Rocky, openSUSE
sudo curl -fsSL https://pkg.mlab.sh/rpm/mlab.repo -o /etc/yum.repos.d/mlab.repo
sudo dnf install mlab-agent

The package installs /usr/bin/mlab-agent, the mlab-agent system user, /etc/mlab-agent (owned by root, group mlab-agent, mode 1770: the agent writes its own files there but cannot replace your policy.toml), an example policy in /usr/share/doc/mlab-agent/, and a hardened systemd unit that starts once the host is enrolled.

Commands

CommandWhat it does
mlab-agent enroll --server <url> --code <code> --expect-fingerprint <fp> [--label <name>] [--force]Joins a workspace with a one-time code. Creates the agent's keys on the host and pins mlab.sh's, after checking the fingerprint.
mlab-agent runConnects and serves requests until stopped (what the service runs).
mlab-agent statusThe agent's identity (organization, workspace, agent id) and both key fingerprints.
mlab-agent tools hash <path>The SHA-256 to pin for a tool binary in the policy.
mlab-agent tools checkStarts every declared tool once and reports whether it gets ready, with its version and allowed operations.
mlab-agent install [--user <name>] [--out <dir>]Writes svc.sh, which installs this binary as a systemd service (sudo ./svc.sh install, also uninstall, start, stop, restart, status). For copies not installed from the package.

--config <dir> (or MLAB_AGENT_CONFIG_DIR) points at another configuration directory; the default is /etc/mlab-agent.

Files

FileWritten byContent
agent.tomlenrollOrganization, workspace, agent id, mlab.sh's public keys
agent.keyenrollThe agent's secret keys and credential; must stay owner-only (mode 600)
policy.tomlyouWhat the agent may do (below)
audit.jsonlthe agentOne line per request served or refused
tools/the toolsEach tool's work directory (caches, results waiting for upload)

The policy

# Kill switch: false refuses every request.
enabled = true

# Where results (indexes, extracted files) may be uploaded: filled in by mlab.sh's Policy editor.
upload_hosts = ["<storage host from the Policy editor>"]

[tools.engram]
path = "/usr/bin/engram-tool"
sha256 = "<mlab-agent tools hash /usr/bin/engram-tool>"
enabled = true
# Optional: only these operations. Without it, every operation the tool offers.
# allowed_ops = ["list_dumps", "get_index", "mem_read", "phys_read", "extract_pe"]

[tools.engram.settings]
dump_dirs = ["/srv/dumps"]
max_read_len = 65536
collect_environment = true
redact_secrets = true

The agent reads the policy again on every request. It starts a tool only if its binary matches the pinned SHA-256, and a tool refuses unknown settings. Build it with the Policy editor of the workspace's Agents tab, which also shows what the agent reports against your draft.

On this page