Skip to main content

Create a worker

The worker node is the edge node in a cluster deployment. This node will host ProxyPot, and receive attack traffic. All data collected will then be sent to the controller node for review.

System Requirements​

This depends on the size of your worker, and how many emulations you intend to deploy. As a starting point, these should be your minimum requirements:

  • CPU: Any modern (2022+) dual-core CPU
  • RAM: 500MB
  • HDD: 10GB
  • OS: x86 or ARM system capable of hosting Docker, ideally Linux (Debian)

The instructions below assume you're on a Linux distribution, specifically Debian.

System Setup​

We generally recommend using /opt to hold your container data.

After installing Docker following their setup guide, create /opt/docker-compose.yml with the following contents:

services:
worker:
image: ghcr.io/globalcyberalliance/proxypot:latest
container_name: worker
network_mode: host
environment:
- PORT=8080
- ROLE=worker
- CONTROLLER_URL=http://controller.ip:8080?token=the-enrollment-token-from-before
volumes:
- /opt/proxypot:/app
restart: unless-stopped

Do note the CONTROLLER_URL environment variable, which carries the cluster's enrollment token. You'll need to populate this before bringing your container online. The same URL can be given to every worker you deploy. You can then bring the container from the /opt directory by running docker compose up -d.

Note the /opt/proxypot directory. While this will hold this node's data, it's not too important to backup as the data is all being sent to the controller node anyway.

Joining the Cluster​

Once the container starts, it should automatically enroll itself with the controller, exchanging the enrollment token for its own API key and providing the controller with one of its own. The enrollment token is only used once, after which the issued key is stored locally. You should still review the container's logs to ensure that nothing has gone wrong ( docker logs worker).

You can ensure that the node has been enrolled by querying the GET /api/nodes endpoint on the controller node. If the worker node is listed as online, then the worker is setup and ready to go!

Ephemeral Workers​

Workers are disposable. The controller checks in with each one every 30 minutes and records the result as the node's status and lastSeen timestamp (both visible on the Nodes page). A worker that stays unreachable for 3 days is forgotten: the node, its API keys, and its devices are all removed. Devices that captured hits are disabled rather than deleted, so past hits stay attributable.

Leave CONTROLLER_URL (with its token) set, and none of that is a problem: a worker that finds itself forgotten enrolls again automatically and carries on. Recovery happens when the worker next contacts the controller - on startup, or when it next submits hits. An idle worker that has been forgotten stays absent from the node list until one of those happens.

Every enrollment creates a node, since enrollment is unauthenticated and nothing a caller sends can be trusted to name an existing one. A worker that enrolls again therefore appears twice for a moment. The row it left behind holds a callback key that worker has since revoked, so the next check-in retires it: a node whose worker rejects the controller's key is forgotten on the spot rather than after the 3 day timeout. A worker the controller cannot dial inbound at all ages out on the timeout instead.

A worker counts as alive if either side makes contact, so one the controller can't dial inbound (behind NAT) is not pruned while it is still submitting hits.

:::warning The controller pushes device configuration to workers, so a worker the controller cannot reach inbound can be enrolled and submit hits, but cannot be given devices - including seeded ones. Workers need their API port reachable from the controller. :::

Seeding Devices​

Start the controller with SEED=all (add SEED_DEMO_PORTS=true to bind unprivileged ports instead) and every worker is stocked with a default device per supported protocol as it joins - no manual device creation per worker.

Each worker declares its own profile with its SEED value (all, server or relay), and the controller seeds only that protocol set. The controller's SEED decides whether seeding happens at all, not which protocols a given worker gets. Leave a worker's SEED unset and it asks for nothing: the controller keeps the profile that worker last declared, so restarting one without it never re-labels or re-stocks it.

DoH and HTTPS both belong on 443, so only the relay profile seeds a DoH device. A profile that serves both keeps HTTPS.

Seeding is attempted for a minute after a worker enrolls, since a worker isn't serving its API yet at the moment it enrolls, and then retried on every check-in until it succeeds. A worker the controller couldn't reach in that first minute is seeded on a later check-in rather than staying empty until the controller restarts.

Before seeding, the controller records any devices the worker is already running that it has no rows for, keeping their IDs so existing hits stay attributable. That is what lets a rebuilt controller re-attach to live workers: without it, seeding would try to recreate those devices, the worker would refuse each one because its own device already holds the port, and the node would end up with nothing. Protocols that already have an enabled device on that worker are left alone, and a device that fails to bind (something else is on the port) is logged and skipped without affecting the rest.