Skip to main content

Create a controller

The controller node is the central node in a cluster deployment. All workers are configured from here, and all data is fed into this node.

System Requirements​

This entirely depends on the size of your cluster, and how many worker nodes you have deployed. As a starting point, these should be your minimum requirements:

  • CPU: Any modern (2022+) dual-core CPU
  • RAM: 1GB
  • HDD: 32GB
  • 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:
controller:
image: ghcr.io/globalcyberalliance/proxypot:latest
container_name: controller
network_mode: host
environment:
- PORT=8080
- ROLE=controller
volumes:
- /opt/proxypot:/app
restart: unless-stopped

You can then bring the container from the /opt directory by running docker compose up -d.

Note the /opt/proxypot directory. This will hold all of your system's data. You should have backups in-place for this directory.

User Credentials​

Once the container is online, inspect the logs for it via docker logs controller. You should see logs resembling the following:

{"level":"info","email":"proxypot@globalcyberalliance.org","password":"ab70a613-144f-45f6-984d-f911e5069941","time":"2024-09-23T20:25:43+01:00","message":"Default admin user created!"}
{"level":"info","time":"2024-09-23T20:25:43+01:00","message":"Background jobs disabled"}
{"level":"info","time":"2024-09-23T20:25:43+01:00","message":"Starting api server on port 8080"}

The user password will be automatically generated at startup. With these credentials in-hand, follow the installation's API docs (you can find your installation's own docs by visiting http://your.server.ip:8080/api/docs), specifically you want the POST /api/auth/login endpoint. Submit your credentials, and you'll receive back an API key which you can use for your next requests.

With your API key in hand and applied as your authorization header, fetch the cluster's enrollment token from the GET /api/nodes/enrollment-token endpoint (it's also shown on the Nodes page in the UI):

{
"token": "a64ef71c-1c07-49f6-8595-2aeb698d3ba1"
}

Every worker enrolls itself with this one token, so the same value goes to all of them. Append it to your controller's URL and hand that out as each worker's CONTROLLER_URL:

http://your.server.ip:8080?token=a64ef71c-1c07-49f6-8595-2aeb698d3ba1

If the cluster is provisioned by infrastructure-as-code, set the token yourself with ENROLLMENT_TOKEN (or --enrollmentToken) instead of reading back a generated one. It must be at least 16 characters.

Rotating the Token​

The token never changes on its own. How you rotate it depends on where it came from:

  • Generated (neither ENROLLMENT_TOKEN nor --enrollmentToken set): POST /api/nodes/enrollment-token/rotate, or the Rotate button on the Nodes page.
  • Configured (set either way): change the configured value and restart the controller. The API rotate endpoint returns 409 Conflict in this case, because the configured value is reapplied on every start and would reinstate the token you were trying to retire.

Either way, already enrolled workers keep working, but the old token will no longer enroll anything.

:::warning Rotation only stops future enrollments. Anyone who already used the leaked token holds a non-expiring worker API key that keeps working after the rotation, and that key can submit hits. After rotating, review GET /api/nodes for nodes you don't recognise and delete them (DELETE /api/nodes/{nodeID}) to revoke their keys. :::