Provision and operate a full RedAmon instance on any Linux server (EC2, DigitalOcean, Hetzner, bare metal) from your laptop, given only its IP + an SSH credential + a domain.
deploy.sh is a thin remote driver around RedAmon's own redamon.sh control script. It
prepares a bare host, clones the repo onto it, drives redamon.sh over SSH, and wraps the
whole thing in an internet-facing security layer that redamon.sh deliberately does not
provide (RedAmon is designed local-only): nginx + TLS + firewall + host hardening.
The security promise: one public origin over HTTPS. From the internet only the webapp UI (443, plus 80 for the ACME challenge and an HTTP->HTTPS redirect) is reachable. The agent API, databases, orchestrator and the optional reverse-shell port pool stay bound to loopback, and the per-person Kali sandboxes publish nothing else. nginx proxies the webapp and (same-origin) exactly the four agent WebSocket paths; nothing else on the agent is exposed.
One exception, off by default: the INBOUND MCP server. With
MCP_SERVER_ENABLED=true the same origin also serves /api/mcp-server, a credentialed
machine-facing endpoint an external AI agent connects to with a bearer token. It is a
different shape of surface from the UI, so it has its own section below.
cd tooling/deploy/single-host
cp .env.example .env
# edit .env: HOST_IP, DOMAIN, SSH_KEY_PATH, OPERATOR_ALLOW_CIDRS, LETSENCRYPT_EMAIL,
# ADMIN_NAME / ADMIN_EMAIL / ADMIN_PASSWORD
./deploy.sh initFirst build takes 30-60 minutes (Kali + agent images). When it finishes, log in at
https://<your-domain>/ with the admin you set in .env.
Upgrading from before 6.9? This directory moved from
deploy/single-hosttotooling/deploy/single-host.git pullmoves only tracked files, so your.envand any provided TLS material stay at the old path. Run./redamon.sh migrate-layoutfrom the repo root once to move them (./redamon.sh updateandupdo it automatically). Until thendeploy.shfalls back to the old location and warns.
Local machine: bash, ssh, scp, curl. Only for password auth you also need
sshpass (apt install sshpass / brew install hudochenkov/sshpass/sshpass). Key auth is
recommended and needs nothing extra.
The server: a fresh Ubuntu 22.04/24.04 box. You install nothing on it by hand -
deploy.sh detects and installs every prerequisite (Docker Engine 28.0.0 or newer + Compose
v2, nginx, certbot, ufw, fail2ban, swap, ...) idempotently. See "How the host is bootstrapped"
below.
RedAmon is heavy. redamon.sh enforces a hard 8 GB Docker-visible RAM floor at bring-up
(effective ~7.5 GB after slack), aborting below it unless REDAMON_SKIP_RAM_GATE=true.
| Profile | vCPU | RAM | Disk | Example | Notes |
|---|---|---|---|---|---|
| Bare minimum (core only, no GVM/KB) | 2 | 8 GB | 100 GB | t3.large | Fits the ~91 GB platform footprint with almost no operational headroom. Cap the build cache (DOCKER_BUILD_CACHE_MAX_GB) or the parallel build can hit 100%. Slow/swappy; keep swap on. Supply-chain scans will be admission-rejected here (see below). |
| Recommended (core + real scans, no GVM) | 4 | 16 GB | 200 GB | m5.xlarge | ~91 GB platform + ~100 GB free for operational data. Sane default, and the floor for supply-chain SCA. |
| Full (GVM + KB + Ollama judge + parallel scans) | 8 | 32 GB | 250 GB | m5.2xlarge | ~121 GB platform + ~100 GB operational. Ollama alone needs ~5-6 GB RAM while scanning. |
Disk sizing. The fixed platform footprint is ~91 GB without GVM (OS ~9 GB + the 15 built
images ~61 GB + build cache ~20 GB + the ~0.3 GB offline OSV database volume) and ~121 GB with
GVM (its images plus the vulnerability-feed volumes/DB add ~25-30 GB, and those grow on every
feed update). On top of that, budget ~100 GB of free space for operational data - the Neo4j
attack graph, scan artifacts/outputs and Postgres grow with use, and so do the saved logs in
./logs, up to LOGS_QUOTA_GB (20 GB unless set; Docker's own copy of each container's output
stops at 30 MB). That lands
at 200 GB without GVM, 250 GB with GVM, each leaving roughly 100 GB free for operations. gp3
EBS resizes online, so you can start smaller and grow in place. install and update now drop the
cache each build orphans, which holds that ~20 GB line item near its floor instead of letting it
creep; DOCKER_BUILD_CACHE_MAX_GB remains the belt-and-suspenders daemon-level ceiling.
RAM and supply-chain SCA. Supply-chain is the only feature that spawns a second heavy container per job: the scan/partial books a 1.75 GB envelope and the network-isolated "dirty" analyzer another ~1.5 GB alongside it. The memory governor reserves both, so a starved host rejects the scan rather than OOM-killing the stack - but on the 8 GB bare-minimum profile that rejection is the normal outcome once anything else is running. Plan on the 16 GB profile if you intend to use supply-chain SCA.
cp .env.example .env, then fill it in. Every key, grouped as in the file:
| Key | Purpose | Local-only |
|---|---|---|
HOST_IP |
Public IP/DNS of the target. Required. | yes |
REMOTE_USER |
SSH sudoer (default ubuntu). |
yes |
SSH_KEY_PATH |
Path to .pem key (recommended). ~ is expanded. |
yes (never copied to host) |
SSH_PASSWORD |
Password-auth fallback. Needs local sshpass. Discouraged. |
yes |
SSH_PORT |
SSH port (default 22). Also drives the host ufw SSH-allow rule and the fail2ban [sshd] jail, so set it to the port the host's sshd actually listens on. |
no (shipped to host) |
| Key | Purpose |
|---|---|
REPO_URL |
Public clone URL. No token needed. |
REPO_BRANCH |
Branch to deploy (default master). |
APP_DIR |
Checkout dir name. Keep stable - it fixes COMPOSE_PROJECT_NAME, which redamon.sh uses for DB-volume detection. Do not change between init and update. |
REDAMON_VERSION |
Optional version stamp baked into images. Blank -> redamon.sh default. |
| Key | Purpose |
|---|---|
ACCESS_MODE |
https-domain (default) | https-ip | http-domain | http-ip. See "Access modes" below. |
DOMAIN |
Required for *-domain modes; ignored for *-ip. |
HTTP_PORT / HTTPS_PORT |
Ports nginx listens on (and ufw opens). Default 80/443. Keep HTTP_PORT=80 if using Let's Encrypt (http-01 always validates on 80). Change only when fronted by another LB/proxy that presents 80/443 to clients. |
| Key | Purpose |
|---|---|
TLS_MODE |
letsencrypt (domain only) | provided | self-signed (ip only). |
LETSENCRYPT_EMAIL |
Required for letsencrypt. |
LETSENCRYPT_STAGING |
true issues against LE staging (not browser-trusted) while testing, to avoid the 5-certs/week rate limit. |
SSL_CERT_LOCAL / SSL_KEY_LOCAL |
provided mode: local paths (relative to this dir) SCP'd to the host. Drop files in cert/. |
SSL_KEY_PASSWORD |
Passphrase if the provided key is encrypted. |
HSTS_ENABLE |
Emit HSTS on https (default true). Auto-absent for http-*. |
| Key | Purpose |
|---|---|
OPERATOR_ALLOW_CIDRS |
Comma list. nginx allow-gate + ufw 443 source. Strongly recommended. |
SSH_ALLOW_CIDRS |
Comma list for ufw :22. Blank -> falls back to OPERATOR_ALLOW_CIDRS. |
GATE_MODE |
ip_allowlist (recommended) | basic_auth | none. |
BASIC_AUTH_USER / BASIC_AUTH_PASS |
Required for basic_auth. |
WS_REQUIRE_SESSION |
Default true. nginx auth_request requires a valid webapp session cookie before ANY /ws/* upgrade. Keep it on as defense-in-depth: all four agent WS paths now enforce a signed ws-ticket + a server-side same-origin check at the app layer (fail-closed when AGENT_WS_TICKET_SECRET is unset), and this cookie gate sits in front of that as a second layer. |
CSP_ENFORCE |
Default false (Content-Security-Policy-Report-Only). Set true to enforce the CSP after confirming the WebGL graph and xterm terminal still render. |
ENABLE_UFW |
Host firewall (default true). |
ENABLE_SSH_HARDENING |
Key-only + no-root login. Skips disabling password login if you deployed over a password (so you don't lock yourself out). |
ENABLE_FAIL2BAN |
sshd + nginx jails. |
ENABLE_UNATTENDED_UPGRADES |
Auto security patches. |
| Key | Maps to | Notes |
|---|---|---|
ENABLE_GVM |
--gvm |
Heavy; 10-20 min feed sync; the install generates a strong GVM_PASSWORD (pinned in the server .env) and applies it to gvmd's admin. |
ENABLE_KB |
--kbase |
Bakes ML embedding models (+~4.4 GB image). The real KB switch. |
ENABLE_KB_REFRESH |
kb-refresh sidecar | |
ENABLE_ZRAM |
REDAMON_ENABLE_ZRAM=1 |
Compressed-RAM cushion. |
SKIP_KB is intentionally not an input: redamon.sh derives it from the .kbase-enabled
flag it manages. Control KB with ENABLE_KB only.
| Key | Purpose |
|---|---|
SWAP_PCT |
Swapfile as a percentage of host RAM, at ANY size (default 25, 0 skips). 25% is what unlocks the memory governor's higher burst factor. |
SWAP_SIZE_GB |
DEPRECATED explicit override in GB; blank uses SWAP_PCT. |
OS_RESERVE_PCT / SERVICES_PCT / BURST_FACTOR / BURST_SWAP_MIN_PCT / BLAST_PCT / DISK_RESERVE_PCT / REDAMON_WEIGHT_* |
Memory-governor shares. Percentages only, so the same file is correct on an 8 GB and a 64 GB instance: redamon.sh computes the actual sizes from the target's own RAM. |
REDAMON_SKIP_RAM_GATE |
true bypasses the 8 GB floor on tiny boxes (risky). |
REDAMON_BUILD_PARALLEL |
Cap concurrent image builds. Blank -> redamon.sh auto-sizes. |
DOCKER_DNS |
e.g. 8.8.8.8,8.8.4.4 merged into /etc/docker/daemon.json if container DNS breaks. |
DOCKER_BUILD_CACHE_MAX_GB |
Cap the BuildKit build cache (GB) via daemon.json auto-GC. Blank -> Docker's default. install/update already drop the cache each build orphans, so this is a second-line ceiling for cache the daemon accumulates outside RedAmon's builds; set e.g. 30 on a shared or long-lived host. |
<SERVICE>_CPUS |
Per-service CPU limit (NEO4J_CPUS, AGENT_CPUS, ...). Auto-capped at init to min(compose default, host nproc) so up never fails on a box with fewer CPUs than compose's generous defaults (neo4j 8 / agent 8). Set one to pin it; blank -> auto. KALI_CPUS (like KALI_MEM and KALI_PIDS) is ignored: the orchestrator sizes each Kali sandbox itself (half the host's CPUs, 1 to 4; 4096 processes; its 1 GiB memory envelope). |
| Key | Purpose |
|---|---|
REVSHELL_TARGET_CIDRS |
Scopes the ufw rules revshell-open adds for the reverse-shell port pool to your RoE targets. See the Security posture section for how to catch reverse shells (a person's own tunnel, or the pool). |
KALI_SANDBOX_PORT_POOL |
first-last (or 127.0.0.1:first-last), e.g. 4500-4509: one host port per running Kali sandbox for direct reverse shells, bound on loopback. The deploy refuses any other bind address, a range starting below 1024 or holding more than 100 ports, and a range over any port the host already serves (the loopback-only services, SSH/HTTP/HTTPS and every port the shipped compose files publish). Required by revshell-open. Blank -> no pool: init/update remove the key from the server .env, so no sandbox port is published. |
KALI_SANDBOX_MAX_CONCURRENT |
The most Kali sandboxes running at once (one per person and view), a whole number (0 blocks every new one; the deploy refuses anything else). Advised on a multi-user server; blank -> init/update remove the key, and only the memory governor limits them. |
KALI_SANDBOX_IDLE_MINUTES |
Minutes without use before a Kali sandbox stops, a whole number of at least 1 (the deploy refuses anything else). Blank -> init/update remove the key, and the default, 20, holds. |
KALI_SANDBOX_PORT_HOLD_HOURS |
Hours a stopped or replaced Kali sandbox's pool port goes to nobody else and back to its person (and view) on their next start, so a late callback never lands in another person's sandbox; a whole number, 0 frees it at once (the deploy refuses anything else). Blank -> init/update remove the key, and the default, 24, holds. |
TUNNELS_ENABLED |
Unused: written to the server .env, read by nothing. Tunnels are per person, in each person's own Kali sandbox, behind the platform:tunnels permission. |
| Key | Purpose |
|---|---|
ADMIN_NAME / ADMIN_EMAIL / ADMIN_PASSWORD |
The first admin user, created automatically during init; it is the instance's Root. The password must be 12 characters to 72 bytes (bcrypt reads no further); init refuses anything else before it touches the server. Use a strong password: the app locks an email for 15 minutes after 5 failed sign-ins (a browser that signed in to it before keeps signing in), and nginx limit_req brakes the login route. With RBAC_IDENTITY_ENABLED=true in the app .env on the server, every update confirms the admin ADMIN_EMAIL names as Root when there are several (see Update and rollback). |
| Key | Purpose |
|---|---|
NVD_API_KEY |
Faster NVD lookups. |
KB_EMBEDDING_USE_API / KB_EMBEDDING_API_BASE_URL / KB_EMBEDDING_API_KEY |
Use a remote embedding API instead of the baked local model. |
OSV_DB_AUTO_REFRESH |
false disables the lazy-on-scan refresh of the offline OSV database. Set it for an air-gapped host, otherwise every supply-chain scan burns OSV_DB_REFRESH_TIMEOUT on a download that cannot succeed. Blank -> true. |
OSV_DB_ECOSYSTEMS |
Comma-separated ecosystems to keep synced. Blank -> all eight (~280 MB). npm alone is ~208 MB and a noticeably shorter first install. An ecosystem you drop here is never refreshed, and a scan against it reports a missing ecosystem rather than a clean result. |
OSV_DB_TTL_SECONDS |
Freshness window before a re-sync (blank -> 86400). |
OSV_DB_REFRESH_TIMEOUT |
Ceiling on a single refresh, seconds (blank -> 900). |
SCA_INTEL_AUTO_REFRESH |
false stops contacting the supply-chain incident catalog feed (supplychainattack.org, ~5 MB) on an air-gapped host; an empty catalog still receives the bundled offline copy, installed with no network. Blank -> true. Unlike the OSV database this one is also seeded at install/update, because captured traffic is matched against it without any scan having run. |
SCA_INTEL_TTL_SECONDS |
Freshness window before a re-sync (blank -> 86400). |
SCA_INTEL_RETRY_SECONDS |
Retry floor after a failed or rejected fetch (blank -> 3600), so a broken feed is not re-fetched on every scan. |
SCA_INTEL_REFRESH_TIMEOUT |
Ceiling on a single refresh, seconds (blank -> 120). Lower than the OSV one because this feed is ~5 MB, not ~208 MB. |
SCA_INTEL_BOOTSTRAP_ON_SCAN |
false stops a scan populating a cold catalog volume (blank -> true). |
SCA_INTEL_MATCH_ENABLED |
false turns off matching captured requests against the catalog (blank -> true). |
CAPTURE_IOC_IGNORE_SUFFIXES |
Hosts excluded from that match. Blank -> the five OAST providers the catalog lists as indicators, so your own Burp Collaborator callbacks are not flagged. |
API_USAGE_CHECK_ENABLED |
false (or 0, no, off, any case) turns off Settings > API Keys > Check API usage on an air-gapped host: the check makes the webapp call each provider's account/usage endpoint with the saved keys, on demand. The last saved report stays readable. Blank -> true. |
WORKSPACE_URL_IMPORT_ENABLED |
false turns off Import from URL in the Agent Workspace for every user (folder and archive uploads stay). Blank -> on. See below. |
LOGS_QUOTA_GB |
Quota in GB on ./logs, every project's saved scan, agent, Triage and CodeFix logs: past it the hourly sweep deletes the oldest finished logs of the project using the most space. 0 = no quota. Blank keeps the server's value (20 unless set). Lower it on a small disk. |
LLM provider keys are configured in the UI, not here.
Supply-chain SCA / offline OSV database. init and update call redamon.sh's
ensure_osv_db, which populates the redamon-osv-db volume (~280 MB for all eight ecosystems)
after the tool images are built. It is best-effort: a network failure warns and lets the
stack come up, so verify re-checks the volume and warns if it is empty. To fix one by hand:
ssh in and run ./redamon.sh supply-chain-sync (optionally ... npm PyPI Go). The download
is plain HTTPS egress to the OSV GCS bucket, which the default ufw policy (allow outgoing)
already permits.
Agent Workspace URL import. A signed-in user can import a repository, an archive, a file
or a copy of a website into the Agent Workspace, so this server fetches public URLs that users
name: plain HTTP(S) egress, which allow outgoing permits. Private, loopback and metadata
addresses are refused on the link and on every redirect, and a website copy keeps to the
project's Rules of Engagement. It is on by default; WORKSPACE_URL_IMPORT_ENABLED=false turns
it off; a change reaches the running agent on the next deploy.sh update, because
redamon.sh update brings the running services onto the changed .env even when there is no
new code (only a service whose configuration changed is recreated).
| Key | Purpose |
|---|---|
INIT_FORCE |
true skips the typed INIT wipe confirmation (CI only - dangerous). |
BACKUP_BEFORE_UPDATE |
Reserved (pre-update DB snapshot). |
DRY_RUN |
Print the resolved plan and exit without touching the host. |
VERBOSE |
Stream full remote output. |
ALLOW_INSECURE |
Must be 1 to permit http-* modes. |
| Pick | When |
|---|---|
https-domain |
You have a real DNS name pointing at the host. The default and recommended. Use TLS_MODE=letsencrypt. |
https-ip |
Bare IP, no DNS, but you still want TLS. TLS_MODE=self-signed (browser warning) or provided. |
http-domain / http-ip |
Lab/test only. No TLS. Gated behind ALLOW_INSECURE=1 and a loud banner - they invert the whole security posture (plaintext cookies/creds, no HSTS, agent WS unencrypted). |
Derived automatically from ACCESS_MODE (you never set these):
| ACCESS_MODE | Public host | nginx | WS scheme | Secure cookie / HSTS |
|---|---|---|---|---|
https-domain |
$DOMAIN |
443 + 80->443 | wss://$DOMAIN/ws/... |
on |
https-ip |
$HOST_IP |
443 + 80->443 | wss://$HOST_IP/ws/... |
on (self-signed warning) |
http-domain |
$DOMAIN |
80 only | ws://$DOMAIN/ws/... |
off |
http-ip |
$HOST_IP |
80 only | ws://$HOST_IP/ws/... |
off |
The agent WebSocket URL is baked into the webapp image at build time
(NEXT_PUBLIC_AGENT_WS_URL). Changing the scheme or host later requires a webapp rebuild
(re-run update), not just an nginx reload.
- letsencrypt (recommended,
https-domain): needsDOMAINresolving to the host and port 80 reachable. The deploy stands up an ACME webroot on 80, runscertbot certonly --webroot, then installs the hardened 443 vhost pointing at/etc/letsencrypt/live/$DOMAIN/. Auto-renew is wired via certbot's timer + an nginx reload hook. SetLETSENCRYPT_STAGING=truewhile testing. - provided (
https-domainorhttps-ip): dropfullchain.pem+privkey.pemincert/(or pointSSL_CERT_LOCAL/SSL_KEY_LOCALat them). They are SCP'd to/etc/ssl/redamon/(key600), md5-idempotent. The only way to a trusted cert on a bare IP. - self-signed (
https-ipescape hatch): generated on the host with the IP in a SAN. Browser warning expected. Not for production. - No TLS (
http-*): certbot is skipped entirely.
| Command | What it does | Destructive |
|---|---|---|
./deploy.sh init |
Wipe ALL Docker state + the checkout, then build from zero. Auto-creates the first admin from .env. |
yes (typed INIT confirm) |
./deploy.sh update |
Pull latest REPO_BRANCH HEAD and apply (diff-driven rebuild via redamon.sh). Preserves all volumes/data. |
no |
./deploy.sh status |
redamon.sh status + docker compose ps + ufw + nginx -t + cert expiry. |
no |
./deploy.sh harden |
Re-apply host hardening + nginx/TLS only (idempotent), no rebuild. | no |
./deploy.sh ssl-renew |
Renew (certbot) or re-install (provided) the cert + reload nginx. | no |
./deploy.sh down |
Stop the stack, keep volumes/images. | no |
./deploy.sh logs [service] |
Tail docker compose logs -f for a service (default agent). A person's Kali sandbox is not a compose service: on the host, find it with docker ps --filter label=redamon.sandbox=1 and read it with docker logs <container>. |
no |
./deploy.sh revshell-open |
Per-engagement: expose every port of KALI_SANDBOX_PORT_POOL to REVSHELL_TARGET_CIDRS via one host socat forwarder per port (fails closed on reboot). Refuses without a pool, and while the server's app .env holds no pool or another one (run update first). |
no |
./deploy.sh revshell-close |
Tear every forwarder down (also the single 4444 one of a host opened before per-user sandboxes) and delete every ufw rule an open tagged redamon-revshell, for any pool or CIDR, and every 4444 allow rule (the release before per-user sandboxes tagged none). |
no |
Connection fields can be overridden positionally, e.g.
./deploy.sh init 1.2.3.4 ~/.ssh/redamon.pem ubuntu. Use --env NAME to select
.env.NAME for per-instance configs (prod, staging, a client name).
MCP_SERVER_ENABLED=true exposes /api/mcp-server so your own AI agent can start recon
scans, read the attack-surface graph and adjust recon tuning, acting as ONE RedAmon user
inside that user's own projects. Tokens are minted per user in Global Settings ->
MCP Server; the full model is in
docs/readmes/README.MCP.SERVER.md.
Three gates sit in front of it, and all three must admit the agent. This is the part that surprises people, because two of them are invisible from the app:
| Layer | Controlled by | If it refuses |
|---|---|---|
| Cloud Security Group | your provider | connection times out |
| ufw on the app port | OPERATOR_ALLOW_CIDRS + MCP_CLIENT_CIDRS |
connection refused/dropped, nginx never sees it |
nginx location = /api/mcp-server |
MCP_CLIENT_CIDRS, MCP_EDGE_ALLOW_BEARER |
403 |
The firewall filters by PORT and cannot see the URL path. So when
OPERATOR_ALLOW_CIDRS is set (the recommended posture), an agent connecting from anywhere
else is dropped before nginx, and MCP_EDGE_ALLOW_BEARER=true on its own changes
nothing. Set MCP_CLIENT_CIDRS to your agent's egress range: it is admitted to the port,
then narrowed by the nginx location to /api/mcp-server only. It does not gain the UI, the
login page, or the agent WebSocket paths.
Two hard rules the deploy enforces for you:
http-*modes are refused outright. The credential is a bearer token in a header; over plaintext it is broadcast on every call and, unlike a session cookie, it outlives the session.ALLOW_INSECURE=1does not override this.GATE_MODE=basic_authreturns 403 untilMCP_EDGE_ALLOW_BEARER=true, because Basic and Bearer cannot share oneAuthorizationheader.
deploy.sh verify probes the endpoint and distinguishes the failure modes: 404 (disabled or
the flag never reached the container), 401 (working), 403 (the edge gate ate the header).
Repeated 401s are banned by the redamon-mcp-auth fail2ban jail.
In https-ip with a self-signed certificate most MCP clients reject the connection. Use a
real certificate (TLS_MODE=provided) or a domain.
AGENT_IN_THE_LOOP_ENABLED (default true) lets a person pick Agent in the Loop as a
chat's model: their own Claude Code or Codex then answers each reasoning step of that run
through the loop_* MCP tools. It needs the MCP server, which stays off by default on a
deploy: until you set MCP_SERVER_ENABLED=true, deploy.sh notes that the switch is
inert. deploy.sh also writes REDAMON_SINGLE_HOST_DEPLOY=true into the server's app .env, so
redamon.sh (which turns the MCP server on by default on a local install) never turns it on
here, even when someone runs ./redamon.sh update on the server by hand; verify reports an
MCP server that answers while configured off as an error. Against an app older than Agent in
the Loop, verify skips the loop check. The flag is seeded into the server .env and passed to
both the agent and webapp containers; deploy.sh verify checks that it reached both.
The three gates above apply unchanged (the driver is just another MCP client), and
MCP_RATE_LOOP_PER_MIN (default 120) is the per-token rate of the loop tools. The client
setup is on the wiki page
Agent in the Loop.
Every deploy runs the RedAmon plugin platform: the Plugins page, where an admin installs
optional features from the signed redamon-plugins catalog, and the plugin-runner and
plugin-gateway containers that run them on an internal network with no internet access.
There is nothing to turn on. deploy.sh init and update set PLUGINS_ALLOWED_ORIGIN in the
server .env from the same derived origin as MCP_ALLOWED_ORIGIN (nginx forwards
Host $host without the port), and the update's explicit webapp recreate passes
-f docker-compose.plugins.yml so the webapp keeps its plugin network and volume.
- Docker Engine 28.0.0 or newer is required on the server. The plugin networks use
gateway_mode_ipv4: isolated, which older engines refuse, andredamon.shstops on an older engine before building anything.init,hardenandupdate(before its pull) install Docker from Docker's apt repo when the engine is older than 28.0.0 and fail if it is still older afterwards, so./deploy.sh updatebrings an existing server's Docker up to date by itself. Check withdocker version --format '{{.Server.Version}}'. - A server that cannot run the platform is refused.
redamon.shgeneratesPLUGIN_RUNNER_KEYandPLUGIN_CALL_TOKEN_SECRET, then a preflight checks them, the internal key, the engine, the runner image and the plugin networks before any service is (re)created; a failure stops the deploy withThe plugin platform cannot run on this host: <reason>., and./redamon.sh statusrepeats the reason. - The secrets gate covers both plugin secrets: an unset, known-default or shorter than 24
characters
PLUGIN_RUNNER_KEYorPLUGIN_CALL_TOKEN_SECRETfails the deploy. - The plugin-internal routes are denied at nginx in both templates, before
location /api/:/api/plugin-gateway/(plugin code's Gateway),/api/plugin-runner/(the runner's run list) and/api/internal/plugins/(reconciliation) answer 404 at the edge. They are reached only on the container networks; nginx does not strip the headers they authenticate with, so the edge must not offer them. - The runner's CPU cap (
PLUGIN_RUNNER_CPUS, 2) is fitted to the server's cores like the other services' caps. - Installing from the official catalog needs outbound HTTPS from the server to
raw.githubusercontent.com(the signed catalog),github.comandrelease-assets.githubusercontent.com(the release archives);PLUGINS_DOWNLOAD_HOSTSis the allowlist checked on every redirect hop. Without egress, an admin can still install a plugin from files on the Plugins page.
RedAmon's threat model assumes a local-only deployment with no anonymous internet attacker. Putting it on a public IP invalidates that, so the deploy closes the gap:
-
Parts of the agent REST API remain unauthenticated (
/sessions/*,/files, FastAPI/docs+/openapi.json; the/workspace/*family needs the internal key);/graph/execand/emergency-stop-allnow requirerequire_internal_auth(wave 2). All four WS paths now enforce a signed ws-ticket + a server-side same-origin check and fail closed whenAGENT_WS_TICKET_SECRETis unset - including/ws/kali-terminal(the root PTY) and the two cypherfix sockets that clone repos / edit code. The deploy still treats the agent as fully untrusted from the edge:- nginx proxies only the four
/ws/*paths to the agent - never any agent REST route. auth_request(WS_REQUIRE_SESSION=true) makes nginx validate the webapp session cookie against/api/auth/mebefore allowing any WS upgrade, so reaching those agent sockets requires a logged-in user - not just a network position - on top of the app-layer ws-ticket.- the operator IP allowlist / basic-auth gate sits in front of everything.
- nginx proxies only the four
-
The webapp trusts
X-Internal-Keyas a service-to-service auth bypass and injectsX-User-Id/X-User-Roledownstream after auth. nginx strips these inbound headers on every request (plusX-Powered-By) so a client can never spoof identity or bypass auth. -
Sign-in throttling is layered. nginx supplies
limit_reqon/api/auth/login(5r/m) and a general/api/limit (30r/s), a per-IP connection cap, and slowloris timeouts. The app locks an e-mail for 15 minutes after 5 failed sign-ins, and the client IP too (TRUST_PROXYmakes nginx'sX-Forwarded-Fortrusted). A browser that has signed in to an account before carries a signed known device cookie (redamon-login-device, sent only to/api/auth/login) and is counted on a lockout of its own, so a stranger's failed sign-ins cannot keep the account's own browsers out. -
Request bodies before authentication: nginx accepts up to
client_max_body_size 60m(the largest upload), and the webapp refuses any body over 1 MiB from a caller with no valid login cookie (413 body_too_large_unauthenticated) from its headers, before Next.js reads it, so a stranger cannot fill the webapp's memory with large bodies. -
Headers: the webapp sets none of its own, so nginx is authoritative - HSTS, a tightened CSP (no
unsafe-eval;object-src 'none';base-uri/form-action 'self'),X-Frame-Options DENY,X-Content-Type-Options,Referrer-Policy,Permissions-Policy, and COOP/CORP. -
TLS: TLS 1.2/1.3 only, modern ECDHE ciphers,
ssl_session_tickets off, OCSP stapling. -
Every secret must be strong: the deploy runs a secrets gate that fails the build on any unset/default/short secret (
changeme,redamon_secret, ...). redamon.sh generates them; the deploy only verifies. -
ip_allowlist(defaultGATE_MODE) is strongly recommended given the powerful agent WS surface + root PTY - defense-in-depth on top of the app-layer ws-ticket and login. -
Reverse shells. Each person's Kali tools run in their own sandbox on a private Docker network, and no sandbox port is published by default, so a target cannot connect back to it. Two ways to catch a direct reverse shell during an engagement:
- A person's own tunnel (Global Settings -> Tunneling, ngrok or chisel, behind the
Tunnels permission
platform:tunnels, and used only when the project's Tunnel Provider names it too): it runs inside that person's sandbox and forwards to port 4444 there, where the agent then binds its handler, pool or not; every restart of the sandbox turns it off. A chisel server serves one person: every client asks it for the same remote port 4444, and a second person's is refused ("remote port 4444 in use"). - The port pool. Set
KALI_SANDBOX_PORT_POOL(e.g.4500-4509) and apply it with./deploy.sh update: each running sandbox gets one port of the range for its listener, bound on127.0.0.1. SetREVSHELL_TARGET_CIDRSto your RoE target scope and run./deploy.sh revshell-open; run./deploy.sh revshell-closethe moment you are done.revshell-openstarts one transientsocatforwarder per pool port on the host's public IP (<public-ip>:<port> -> 127.0.0.1:<port>) and opens the range in ufw to your target CIDRs only. Becausesocatis a host listener (not a Docker-published port), ufw's source scoping actually applies - a plain ufw rule on a Docker-published port would be bypassed by Docker's own iptables chains. A host reboot drops the forwarders, so the pool fails closed. Each person's LPORT is their own sandbox's pool port, which the agent uses as LPORT and the Sessions panel and the terminal show; LHOST is the host's public IP. A stopped sandbox's port stays its person's forKALI_SANDBOX_PORT_HOLD_HOURS(24 by default), and a sandbox that finds no free port starts without one ("the port pool is full"), so size the pool for the people who work at once plus those within the hold.initandupdatewriteHOST_IPto the server.envasHOST_LAN_IPwhen it is an IPv4 address, so the agent and the project settings suggest that address (detected on the host, it would be the private one behind a cloud's NAT); with a DNS name inHOST_IP, give LHOST yourself. The msf handlers are unauthenticated, so they are exposed only toREVSHELL_TARGET_CIDRS, never the world.
Never run a world-open pool and a tunnel at once.
- A person's own tunnel (Global Settings -> Tunneling, ngrok or chisel, behind the
Tunnels permission
-
The AI attack-surface judge (Ollama,
11434) has no authentication of its own. The orchestrator starts it only while an AI attack-surface scan runs and publishes it on127.0.0.1only: the scan's host-network containers reach it atlocalhost:11434, nothing off the host does. It is published through the Docker SDK, so the prod overlay cannot re-bind it and ufw does not filter it; the loopback binding is the control, andverifyfails if 11434 ever listens off-loopback. -
If
ENABLE_GVM=true, the install generates a strongGVM_PASSWORD, pins it in the server.env, and applies it to gvmd'sadminuser (so the app and gvmd never disagree). The deploy printsadmin / <password>once; it is always recoverable withgrep '^GVM_PASSWORD=' ~/redamon/.envon the host.
deploy.sh configures the host ufw, but on a cloud host your provider firewall (AWS
Security Group / GCP firewall / Azure NSG) is the reliable outer boundary — Docker's own
iptables chains can bypass ufw, so the cloud firewall is what still protects you if a
loopback re-bind is ever wrong (e.g. a stray docker compose up that republishes
3000/8090 on 0.0.0.0). Open only:
| Port | Source | Purpose |
|---|---|---|
| 443/tcp | your OPERATOR_ALLOW_CIDRS (or 0.0.0.0/0 if you rely on the nginx gate) |
the app (HTTPS) |
| 80/tcp | 0.0.0.0/0 |
Let's Encrypt ACME challenge + redirect to 443 (required for TLS_MODE=letsencrypt) |
| 22/tcp | your IP only | SSH management |
Open nothing else. In particular do not open 8090 (agent), 3000 (webapp),
5432/7687/7474 (PostgreSQL/Neo4j), the KALI_SANDBOX_PORT_POOL range (reverse-shell
listeners, opened to your targets only by revshell-open), or 11434 (the AI attack-surface
judge, Ollama) — all are loopback-bound and reached only through nginx on 443, or not at all
from outside the host. The Kali sandboxes' MCP, progress, tunnel-manager and PTY ports are not
published at all. Opening 8090 would expose the agent directly, bypassing nginx and its
session gate: its WebSockets (the root PTY /ws/kali-terminal among them) still demand a
signed ws-ticket and a same-origin request, but its unauthenticated REST routes (/sessions/*,
/files, /docs) would answer anyone. The browser reaches the agent's WebSockets at wss://<domain>/ws/… on 443
(nginx → 127.0.0.1:8090), so 8090 never needs to be publicly reachable.
nginx runs on the host, not in a container. It sits only at the edge (80/443), reverse-proxying to two loopback backends — the webapp (
127.0.0.1:3000, for/and/api/*) and the agent (127.0.0.1:8090, for the four/ws/*paths only). It is not a middlebox between containers: all internal service-to-service traffic (webapp ↔ agent ↔ orchestrator ↔ DBs ↔ Kali) flows directly over the Docker bridge networks and never passes through nginx.
cp .env.example .env; setHOST_IP,DOMAIN,SSH_KEY_PATH,OPERATOR_ALLOW_CIDRS,LETSENCRYPT_EMAIL, andADMIN_NAME/ADMIN_EMAIL/ADMIN_PASSWORD. PointDOMAIN's A-record atHOST_IPfirst (letsencrypt needs it)../deploy.sh init-> typeINITto confirm the wipe.- Watch: teardown -> host bootstrap -> hardening -> clone + overlay ->
redamon.sh install(30-60 min build) -> secrets gate -> admin bootstrap -> nginx + TLS -> verify. - Verification asserts loopback binds (3000/8090 on 127.0.0.1 only), datastores, the
orchestrator, 4444 (kept in the list so a leftover publish is caught), every port of the
KALI_SANDBOX_PORT_POOLin the server's app.envand the Ollama judge (11434, while an AI attack-surface scan runs) never off-loopback, container health (it lists the running Kali sandboxes and fails while a sharedredamon-kalicontainer still runs), that the Kali image is the per-user one (it warns otherwise), an admin exists, andhttps://<domain>/api/health-> 200. - Log in at
https://<domain>/.
DRY_RUN=true ./deploy.sh init prints the resolved plan without touching the host.
init (and harden) run a dynamic detect-and-install matrix (update runs its Docker
Engine + Compose step only, before the pull) - each item is probed and
installed only if missing or too old, idempotently: base apt packages (git, openssl, curl,
jq, expect, ...), Docker Engine 28.0.0 or newer + Compose v2.24 or newer from Docker's
official repo (purging any old docker.io/v1 compose first; an older engine or Compose is
upgraded, and the bootstrap fails if either is still too old afterwards), the docker service + group membership, nginx, certbot (only
when letsencrypt is used), ufw, fail2ban, unattended-upgrades, a swapfile sized at SWAP_PCT of RAM
hosts, optional Docker DNS, and inotify limits. Nothing is assumed pre-present.
update first upgrades Docker Engine and Compose when they are too old (a no-op on a current
host), then wraps redamon.sh update: git pull --ff-only + diff-driven
selective rebuild + secret regen (all via redamon.sh, which preserves DB passwords by volume
detection), then re-renders nginx. The settings it seeds take effect in the same run, even
with no new code: redamon.sh update brings every running service onto the current .env,
recreating only the ones whose configuration changed. No source patches are applied: the single-origin agent WS
URL is a first-class ARG NEXT_PUBLIC_AGENT_WS_URL in the base webapp/Dockerfile, baked from
the prod overlay's build-arg, so redamon.sh's own webapp rebuild bakes the right value.
All engagement data (Postgres, Neo4j, reports, GVM feeds, models) lives in named volumes
that survive update.
When the update rebuilds the webapp, redamon.sh update prints a read-only report of what it
changes for your accounts (legacy grants, tunnel rows, members' stdio MCP servers, who becomes
Root) before anything restarts. ./deploy.sh update has no terminal, so it prints the report
and goes on; to read it first, run ./redamon.sh update --preview in the checkout on the
server, which pulls and builds but restarts nothing.
The first update onto 7.7.0 also runs a one-off backfill (tooling/scripts/urlscan_backfill.py --apply, in the recon image). It masks the urlscan tokens earlier releases stored in clear, in
the graph and in the recon JSON files, then writes two marker files in recon/output/ so it
never runs again. It only warns, and never fails the update, when Neo4j or the recon image is
not up (urlscan backfill skipped) or the script fails (did not finish). An update with
nothing new to pull does not retry it, so look for either line in the update log and, if you
find one, run the docker run command in the script's header on the server.
REDAMON_SECRET_HMAC_KEY, in the server .env, belongs with any Neo4j backup. A graph
restored under a different key, for example onto a host that was re-initialised, gives every
urlscan Secret a new id at the next scan, so mutes and Priority Board verdicts stay on the old
nodes.
The prod compose overlay (compose/docker-compose.prod.yml) is SCP'd to the host and installed
at $HOME/.redamon-deploy (outside the checkout, so it never blocks git pull --ff-only). It
sets NEXT_PUBLIC_AGENT_WS_URL=wss://<host>/ws/agent as the webapp build-arg. The deploy works
even if tooling/deploy/single-host/ is not committed to the cloned branch (committing it is still fine
and makes the overlay part of the repo history).
The identity controls (Root, account status, invites, shorter admin sessions) follow
RBAC_IDENTITY_ENABLED, which deploy.sh never writes. redamon.sh writes it to the app .env
on the server as true (with the other four RBAC_*_ENABLED switches: permissions, sharing,
write sharing and the IAM console) whenever a line is missing or blank, and keeps any value
already there (seed keeps lines it does not own too), so all five are on unless you change a
line to false and run update. No project is shared until Root turns the sharing policy on
(IAM, Instance). After the restart
redamon.sh update confirms Root: the only admin with a password, or the admin ADMIN_EMAIL
names (exported from this .env); otherwise it leaves Root unconfirmed and prints how to set it
(./redamon.sh set-root <email> in the checkout on the server). Invite and reset links point at
the deploy's public origin (PLUGINS_ALLOWED_ORIGIN, which deploy.sh seeds) until Root sets
a publicBaseUrl. Invitees open those links through the same firewall and nginx gate as you:
add their addresses to OPERATOR_ALLOW_CIDRS (and, under GATE_MODE=basic_auth, give them the
Basic-auth login) before you send an invite, or the link never reaches the app. The rendered nginx also closes /api/internal/ and the tunnel config paths
(404); the same update re-renders it.
Rollback is manual, and ./deploy.sh update cannot do it: redamon.sh update pulls
REPO_BRANCH forward first, so a checkout reset to an older commit comes straight back to the
newest one. Check out the older commit in the checkout on the server and rebuild it with
./redamon.sh install, exporting what the deploy passes to its own install (COMPOSE_FILE
with the overlay, DOMAIN, WEBAPP_NODE_ENV, NEXT_PUBLIC_AGENT_WS_URL,
AGENT_CORS_ORIGINS). Going back past per-user sandboxes, the overlay already on the server
gives the old shared Kali container no host port, so 4444 stays closed; check the same
release out in your local checkout before the next deploy.sh run, so its overlay and its
revshell-* verbs match the app again.
Rolling back past the release that added AI Navigator applies the older schema with
db push --accept-data-loss, which drops navigator_threads, navigator_messages,
navigator_project_policies and InstanceSettings.navigator_enabled: every AI Navigator
conversation and every owner's "AI Navigator for collaborators" choice is lost (re-upgrading
recreates them empty and off). Take a database backup before upgrading to keep them.
The first update onto per-user Kali sandboxes replaces the shared redamon-kali container:
- Keep your local checkout (it ships the overlay, the modules and the nginx config) and
REPO_BRANCH(the code the server builds) on the same release. The overlay gives the old shared container no host port, so a mismatch does not leave4444public, butverifythen reports the shared container still running andrevshell-openhas nothing to forward to. - Set
KALI_SANDBOX_PORT_POOLbefore theupdateif you catch reverse shells without a tunnel, andKALI_SANDBOX_MAX_CONCURRENTon a server several people use (each sandbox reserves 1 GiB; without a cap only memory limits them). - Shells open in
redamon-kaliend at theupdate, which removes the container once every image is built. A Kali build that fails keeps it, anddeploy.sh updatethen stops as failed: run it again. Onlyredamon.sh(whichdeploy.shdrives) removes it: a baredocker compose upon the server leavesredamon-kalirunning beside the new sandboxes, so remove it withdocker rm -f redamon-kali(or rerun./deploy.sh update). - If an engagement was open, run
./deploy.sh revshell-closeonce: it stops the old4444forwarder and deletes its ufw rules, which carried no tag.
- The first
updatemakes./logsin the checkout on the server, as the deploy user, before the stack restarts. Every scan, chat, Triage and CodeFix run saves its log there, withinLOGS_QUOTA_GB. - It also moves the MCP presets' data (
agentic/logs/mcp_memory.jsonandagentic/logs/sandbox/) intoagentic/mcp-data. Docker madeagentic/logsas root, so the move runs as root in a throwawayalpinecontainer (pulled if the host lacks it). If the update log warnsCould not move agentic/logs/...instead, run thesudo mvit prints: until then a saved Memory, Filesystem or SQLite MCP server starts empty. Nothing reads the old agent logs left inagentic/logs; remove them withsudo rm -rf agentic/logswhen you no longer need them. updatedoes not recreate the KB refresh sidecar (ENABLE_KB_REFRESH), so it keeps unbounded Docker logs and the agent image it started from. Recreate it in the checkout on the server:docker compose --profile kb-refresh up -d --no-deps kb-refresh.
- RAM gate abort ("need ~8 GB"): provision more RAM, or set
REDAMON_SKIP_RAM_GATE=true(risky) and keep swap on (SWAP_PCT). - certbot fails:
DOMAINmust resolve to the host and port 80 must be reachable (open it in your cloud Security Group /OPERATOR_ALLOW_CIDRSmust not block the ACME check - LE validates from arbitrary IPs, so 80 must be world-open). UseLETSENCRYPT_STAGING=trueto iterate without burning the rate limit. - Secrets-gate failure: a secret is unset/default/short. redamon.sh should have generated
them; check the server
~/<APP_DIR>/.env. - GVM feed-sync wait: with
ENABLE_GVM=true, scans don't work until feeds finish syncing (10-20 min after first boot). - Never run raw
docker compose upon the host. The loopback re-binds hold only while the prod overlay is active (COMPOSE_FILE). A baredocker compose upreloads the base file and republishes 3000/8090 on 0.0.0.0 and starts the profile-less GVM stack. Always go throughredamon.sh(which the deploy points at the overlay).redamon.sh up devis likewise forbidden here (it hardcodes its own compose files and defeats the overlay). - Locked out over SSH: if you deployed over a password,
ENABLE_SSH_HARDENINGwill not disable password login. Install a key, then re-runhardenwith key auth to close it.
deploy.sh never edits redamon.sh. It drives it through four channels: the subcommand
(MODE), CLI flags on install, exported env vars, and keys appended to the server-side
application .env.
.env key |
Drives |
|---|---|
ENABLE_GVM |
install --gvm |
ENABLE_KB |
install --kbase |
ENABLE_ZRAM |
REDAMON_ENABLE_ZRAM=1 |
REDAMON_BUILD_PARALLEL |
REDAMON_BUILD_PARALLEL (blank -> auto) |
DOCKER_BUILD_CACHE_MAX_GB |
builder.gc.defaultKeepStorage in /etc/docker/daemon.json (blank -> Docker default) |
REDAMON_SKIP_RAM_GATE |
REDAMON_SKIP_RAM_GATE=1 |
REDAMON_VERSION |
image build-arg stamp |
| (fixed) | COMPOSE_FILE = base + prod overlay, made sticky |
APP_DIR |
COMPOSE_PROJECT_NAME (do not change between init/update) |
ADMIN_* |
first-admin creation on init |
NVD_API_KEY, KB_EMBEDDING_*, TUNNELS_ENABLED, OSV_DB_* |
appended to the server .env |
KALI_SANDBOX_PORT_POOL, KALI_SANDBOX_MAX_CONCURRENT, KALI_SANDBOX_IDLE_MINUTES, KALI_SANDBOX_PORT_HOLD_HOURS |
written to the server .env when set, removed from it when blank (the orchestrator reads them) |
HOST_IP (an IPv4 address) |
HOST_LAN_IP in the server .env, the LHOST the agent suggests |
Intentionally hands-off (redamon.sh owns these; the deploy only verifies): AUTH_SECRET,
INTERNAL_API_KEY, SCANNER_API_KEY, ORCHESTRATOR_API_KEY, MCP_AUTH_TOKEN,
AGENT_WS_TICKET_SECRET, TUNNEL_AUTH_TOKEN, PLUGIN_RUNNER_KEY,
PLUGIN_CALL_TOKEN_SECRET, POSTGRES_PASSWORD, NEO4J_PASSWORD, and SKIP_KB (derived
from the .kbase-enabled flag). MCP_AUTH_TOKEN and TUNNEL_AUTH_TOKEN are still generated
and checked, but nothing reads them: every Kali sandbox gets its own random pair.
REDAMON_SECRET_HMAC_KEY is redamon.sh's too, but the secrets gate does not check it. It
keys the HMAC of a secret urlscan saw written in a URL, so the same secret is recognised
across scans without storing it. Unset, nothing fails: those Secrets keep only their length.
Never rotate it, and back it up with the data (see Update and rollback).