Skip to main content
Workers are the distributed scanning engine of OASM. A worker is a small program that connects securely to the platform, joins a workspace with a one-time API key, and pulls scan jobs as capacity frees up. It executes the configured scanning tools, reports progress and results back to the platform, and lets you scale scanning horizontally by running more instances. Workers are stateless: they can join or leave the system at any time without affecting the platform, the Console, or other workers. This pull-based model makes the execution layer fault-tolerant — if a worker stops mid-job, the job stays visible in the Job Registry and can be re-run once the worker layer is healthy again.

Key concepts

How a worker connects

The connection is established once at startup and then kept alive for the lifetime of the process:
  1. The worker starts and reads its connection settings.
  2. On its first start it joins with the one-time API key and receives its own worker token, which it saves for later restarts.
  3. It registers with the platform and starts pulling scan jobs.
  4. It executes each job’s steps, reporting progress and results back.
  5. The platform’s job registry tracks the job through each stage: waiting, running, and then finished successfully, failed, or cancelled.
A worker that cannot connect is almost always a credential problem: a one-time API key that expired or was already used, or a worker token that was lost. Check the worker logs first — they name the failing request and the platform’s response.
Workers execute job steps grouped by category. Each job belongs to one of the scanning categories, and the worker runs the tools associated with it:

Connector tools on a worker

Not every tool is built into the worker. A connector is an external security tool packaged as a container image. When a job targets a connector, the worker acts as a container supervisor:
  1. The platform sends the run to the worker with the connector’s container image, its per-run inputs, and the resolved configuration.
  2. The worker pulls the image if it is not already cached, then starts the container.
  3. The container starts the connector, which dials back to the worker over a private endpoint. The connector never listens for inbound connections.
  4. The connector registers, runs the scan, and streams findings back to the worker, which persists them through the platform.
  5. When the run finishes, the outcome is recorded in the job registry.

Connector runtime requirements

  • A container runtime. The worker needs access to a Docker daemon to start connector containers. In the production Compose stack the worker runs in node mode with the Docker socket mounted — see Deployment.
  • A reachable dial address. Connector containers must be able to reach the worker at WORKER_CONNECTOR_ADDR (host:port). If the address is empty and autodetect is not enabled, the worker stops at startup rather than starting containers that could never connect.
  • Optional authentication. Set WORKER_CONNECTOR_TOKEN for a shared-secret handshake, or enable mTLS on the connector endpoint.
Mounting the Docker socket gives the worker root-equivalent control of its host. Only run connector images you trust, and keep the worker host dedicated to scanning.

Connector egress proxy

Connector containers send their outbound traffic through a proxy inside the worker instead of going to the internet directly. The worker listens on WORKER_EGRESS_PORT (default 26277) at the same address containers use to dial back to it. The port is never published on the host.
  • Injected at container start. Each container gets HTTP_PROXY / HTTPS_PROXY (HTTP proxy) and ALL_PROXY (socks5h://, DNS resolved by the worker), authenticated with that execution’s single-use token. NO_PROXY covers loopback, the worker itself and the platform address.
  • Public targets only. The proxy refuses loopback, private, link-local (including cloud metadata such as 169.254.169.254), carrier-grade NAT and reserved addresses, plus metadata.google.internal. Names are checked after DNS resolution, so a name that resolves to a private address is refused too. HTTP clients get 403.
  • TCP only. SOCKS5 supports CONNECT; UDP is not proxied.
  • Enforced on an internal network. When the connector network is created as internal (the Compose file of the open-asm repository creates oasm-connectors that way), a connector has no route to the internet except through the proxy. Port scanners (Nmap, RustScan) are exempt: they send raw probes a proxy cannot carry, so the worker also attaches them to the default bridge network and they connect directly. A worker started without WORKER_CONNECTOR_NETWORK (for example, run natively on a host) cannot enforce this: there, tools that ignore the proxy settings still connect directly.
  • Warm pool. Proxy settings are fixed when a container is created. Containers created before a change keep their old settings until they are recycled; pooled containers are retired after at most two hours.
Set WORKER_EGRESS_PROXY=off to restore direct egress: every connector is then attached to the default bridge network as well. If the listener cannot start (for example, the port is taken), the worker logs an error and containers fall back to direct egress the same way.
Upgrading an existing Compose deployment: Docker does not change an existing network in place. Run docker network rm oasm-connectors (with the stack stopped) so Compose recreates it as internal.
Because private addresses are refused, a connector that reaches a private address through the proxy fails: an on-prem Nessus or Acunetix server, or an internal scan target. List those addresses in WORKER_EGRESS_ALLOW (comma-separated IPs or CIDRs, for example 10.0.5.20,192.168.10.0/24); hostnames are not accepted, so list the IP the name resolves to. To turn the proxy off entirely, set WORKER_EGRESS_PROXY=off.

Connect a worker

Prerequisites

  • A running platform that the worker can reach.
  • The workspace.apikey permission, which is needed to issue a one-time API key — see Permissions.
A one-time API key works once and expires after five minutes. Start the worker right after copying the command, and treat the key like a password until it is used.

Step-by-step

1

Get a one-time API key

Open the Connect worker dialog from the Workers page or Create → Connect worker. It issues a one-time API key and shows how long it stays valid; an expired key is replaced automatically, and Rotate API key issues a new one on demand.
2

Configure the connection settings on the worker host

Set the worker’s connection settings — at minimum the one-time API key (WORKER_API_KEY). The remaining settings have sensible defaults for a standard deployment.
3

Start the worker

Run the worker in the way that fits your environment — as a container, a system service, or the local CLI.
4

Verify the worker appears as connected

The Connect worker dialog shows Connected! as soon as the worker joins. You can also open Workers in the sidebar (under Management) and switch to the Workspace tab: the worker appears with a green connected status badge. If it does not, follow the troubleshooting steps below.

Run a worker with Docker Compose

The simplest path is the worker service shipped in the platform’s Docker Compose deployment. It joins with the platform’s cloud key (OASM_CLOUD_APIKEY), so it serves every workspace as a Global worker. The shipped worker runs in node mode: it mounts the host Docker socket so it can start connector containers, and those containers join a dedicated connector network and dial back to the worker on its own address there, so no connector port is published on the host. The stack also mounts a shared tools folder where the built-in scanning tools are installed once and cached, so tool installation does not repeat for every job.

Run a worker from the Console

Open the Connect worker dialog from either the Workers page or the sidebar’s Create menu (Create → Connect worker). The Create menu entry is shown only to members with the workspace.apikey permission, because issuing a one-time API key requires it. The dialog shows a ready-to-run command, pre-filled with a one-time API key and the host you are browsing from. When more than one environment applies (running from source in DevMode, Linux, or Windows), pick one from the tabs; when only one applies, the tabs are hidden and the command is shown directly.

Worker scope

Each worker operates under a scope that determines which jobs it may pull: The Workers page shows workers under Global and Workspace tabs. A worker bound to a workspace serves that workspace’s jobs; a Global worker has access to jobs from any workspace.

Scaling workers

Workers scale horizontally without shared state — add instances and the platform distributes jobs among whoever is ready.
  • Run more instances. Each new workspace worker joins with its own one-time API key, because a key works only once; after that it reconnects with its saved token. Workers that join with the platform cloud key can be started in any number. Each pulls the next available job when it has capacity.
  • Allow more parallel jobs on powerful hosts. The default concurrency setting bounds how many jobs one worker executes at once. Treat it as a per-host budget: raise it when the host has spare CPU and memory, lower it when jobs share tools or targets and you see timeouts.
  • Prefer more instances over extreme concurrency. More instances spread load across machines; a very high concurrency value saturates one machine.
In the Docker Compose stack, connector containers dial each worker replica on its own address on the connector network, so the worker service scales with docker compose up -d --scale oasm-worker=3. Replicas can share one state volume: each locks its own token slot and keeps a distinct identity. Outside Compose, give each worker its own reachable connector address.

Connection settings

Workers join with a one-time API key, authenticate afterwards with their saved worker token, and read a small set of connection settings that point them at the platform and control how many jobs they run in parallel. The defaults match a standard deployment; change them only when your setup differs. Workers that run connector containers read a few connector settings on top of these:

Troubleshooting

A job only leaves the waiting stage when a connected worker picks it up. If jobs accumulate, check that at least one worker shows a connected status on the Workers page, then check the worker logs for registration errors. See Jobs for the full lifecycle.
A one-time API key works once and expires after five minutes. Copy a fresh command from the Connect worker dialog, update the worker’s WORKER_API_KEY, and restart the worker. Then check that the worker can reach the platform from its host.
The worker saves its token to WORKER_TOKEN_FILE. If that file is not on a persistent volume, every restart loses the identity, and the worker cannot rejoin until it gets a new one-time API key. Keep the token file on a persistent volume. Rotating the workspace API key in Settings → API Keys does not affect workers.
Verify network connectivity from the worker host to the platform. In a Docker Compose deployment, the worker must be on the same network as the platform service.
Connector runs need a worker that can start containers. Check that the worker has access to a Docker daemon, that its connector dial address is set, and that the connector image can be pulled from its registry. The worker log names the failing step — image pull, container start, or the connector’s registration.
This is the warm pool keeping an idle container ready for the next job. Idle containers are stopped and removed after the idle timeout; lower the timeout if you want them cleared sooner.
The egress proxy refuses private and loopback addresses, and the worker log shows egress deny lines naming the refused target. List the private IPs or ranges in WORKER_EGRESS_ALLOW (or set WORKER_EGRESS_PROXY=off) and restart the worker. Containers already in the warm pool keep the old setting until they are recycled.

Worker and connector runtime

How workers join, claim jobs and isolate connector containers

Jobs

Watch jobs move from waiting to finished in the registry

Tools & Connectors

The built-in tools and connector containers workers execute