Skip to content

On-Prem Scanners

Ostorlab supports on-premise scanning by deploying an Ostorlab scanner on user-controlled infrastructure. Depending on your license, you can run scans on mobile applications, Web/APIs, and private networks.

Following are the steps needed to run scans on-premise.

Go to report.ostorlab.co

1. Declare Scanner

Click the menu button in the top navigation bar to open the navigation drawer.

Open the navigation drawer

Click Scanning to expand the scanning section.

Expand the Scanning section

And choose Scanners.

Open the Scanners page

To declare a new scanner, click on Add and select Add Scanner.

Add a scanner

Fill in the Scanner name and description (and optionally assign it to an existing Scanner Group).

Fill in the scanner name and description

Save the scanner-identifier of your scanner (you can copy it directly using the copy icon in the table). Initially, the scanner will appear with an Offline status until the scanning daemon connects. This identifier will be used when launching the Ostorlab scanning daemon.

Copy the scanner identifier

Optional: Scanner Groups (Parallel Execution & High Availability)

On the same Scanners page, you can organize multiple scanner nodes into Scanner Groups by switching to the Scanner Groups tab or choosing Add Scanner Group.

Scanner Groups tab

Fill in the group name, description, and select the scanner nodes to include in the group.

Add a scanner group

Why use Scanner Groups?
A scan creates multiple universes (sub-tasks and agent environments). With a single scanner node, scan universes wait in line and execute sequentially one after the other by default (though a single node can process universes concurrently if configured with --parallel N). With a Scanner Group, scan universes are distributed and processed simultaneously across all scanner nodes in the group. For example, grouping 2 scanners doubles processing throughput across machines; with enough scanners (greater than or equal to the number of universes), all universes run simultaneously for horizontal scaling, high availability, and the fastest possible scan completion.

2. Install and Authenticate the Scanner

Install the ostorlab CLI tool on the target machine with the scanner extras (ostorlab[scanner]), which adds python-daemon, required to run the scanning daemon. Note that the scanner daemon is supported on Linux and macOS (Unix systems; Windows is not currently supported as the daemon relies on Unix process mechanics). Please also note that Ostorlab exclusively supports Python 3.13+ (>=3.13); older Python versions (such as Python 3.11) are deprecated and no longer supported. For more details, follow the instructions on the Ostorlab GitHub repository.

pip install --upgrade "ostorlab[scanner]"

Install the Ostorlab CLI with the scanner extras

Next, create an Organization API Key for authentication. Navigate to Integrations/API → API Keys in the left sidebar, click New API Key, specify a name, set the Role to Admin, and generate your API key. For detailed steps, refer to the Organization API Key documentation.

Create an Organization API key

Run the scanner daemon on your machine using your Organization API key and the scanner identifier obtained earlier:

ostorlab --api-key=XXXX.XXXXXXX scanner --scanner-id=XXXX-XXXX-XXXXX

Tip

By default, the scanner executes one universe at a time (--parallel 1). You can increase concurrency on a single machine by passing --parallel N (e.g., --parallel 2).

Run the scanner daemon

Once connected, return to the Scanners page. The scanner status will update to Online (in green) with live system telemetry including IP address, CPU, and memory metrics:

Scanner online status

Keep the Scanner Running

The command above stops when the machine reboots or the process crashes. To keep the scanner running without starting it by hand, you can use any tool that runs it in the background and restarts it automatically. Docker Swarm is one way to do it.

The steps below run the scanner as a Docker Swarm stack, using the public ostorlab/oxo image, which already includes the scanner extras.

Prerequisites

  • Docker Engine (installation guide). Docker Swarm is part of Docker Engine, so there is nothing else to install for it.
  • A user allowed to run Docker commands (root or a member of the docker group).
  • Outbound internet access to the Ostorlab platform (api.ostorlab.co, scanner.ostorlab.co) and Docker Hub, to pull the scanner and agent images.

The scanner creates the scan agents as Docker Swarm services on the host, so Swarm mode must be enabled. Initialize it once on the host:

docker swarm init

Note

On machines with several network interfaces, docker swarm init fails because it cannot choose an address to advertise. Run docker swarm init --advertise-addr <machine-ip> instead.

Create a folder for the scanner and go into it:

mkdir -p ~/ostorlab && cd ~/ostorlab

Add a .env file with your Organization API key and scanner identifier:

cat > .env <<'EOF'
OSTORLAB_API_KEY=XXXX.XXXXXXX
OSTORLAB_SCANNER_ID=XXXX-XXXX-XXXXX
EOF

The file holds your API key, so make it readable only by you:

chmod 600 .env

In the same folder, create a docker-compose.yaml file:

version: "3.8"

services:
  ostorlab-scanner:
    image: ostorlab/oxo:latest
    command: >
      --api-key=${OSTORLAB_API_KEY}
      scanner
      --scanner-id=${OSTORLAB_SCANNER_ID}
      --no-daemon
      --parallel 1
    hostname: "{{.Node.Hostname}}"
    deploy:
      placement:
        constraints: [node.role == manager]
      restart_policy:
        condition: any
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ostorlab-data:/root/.ostorlab

volumes:
  ostorlab-data:
  • --no-daemon is required: it keeps the scanner in the foreground. Without it, the scanner detaches from the main process and the container exits.
  • --parallel 1 runs one universe at a time. Increase it to run more universes at the same time on this machine.
  • hostname makes the scanner report the machine hostname on the Scanners page instead of the container's.
  • The placement constraint runs the scanner on the Swarm manager. The scanner creates the agents through the Docker socket, and only a manager can create Swarm services.
  • The restart_policy restarts the scanner when its container exits. After a reboot, Docker Swarm starts it again on its own, with no manual step. A scanner that hangs without exiting is not restarted.
  • The latest tag lets the update command below pick up new releases. Use a version tag instead, for example ostorlab/oxo:2.22.6, to keep the same version on every deployment.

docker stack deploy does not read the .env file, so load it first, then deploy the stack from the scanner folder:

cd ~/ostorlab
set -a && . ./.env && set +a
docker stack deploy -c docker-compose.yaml ostorlab

Check the scanner logs:

docker service logs -f ostorlab_ostorlab-scanner

If the scanner keeps restarting and never appears as Online, run docker service ps ostorlab_ostorlab-scanner to see its restarts, and check the first lines of the logs. The usual causes are a wrong API key in .env or blocked outbound access to the Ostorlab platform.

To update the scanner to the latest version:

docker service update --image ostorlab/oxo:latest ostorlab_ostorlab-scanner

To stop and remove the scanner:

docker stack rm ostorlab

The ostorlab-data volume and the .env file are kept, so deploying the stack again brings the scanner back with the same configuration.

The Docker socket mount lets the scanner create the agents on the host, and the ostorlab-data volume keeps the scanner configuration and logs (/root/.ostorlab/scanner.log) across restarts. Mounting the Docker socket gives the scanner full control of the host's Docker, so only run it on a machine dedicated to scanning. Once the container is running, the scanner appears as Online on the Scanners page.

3. Run a Scan

Now, to run a scan, head back to the Ostorlab platform and click New Scan in the top bar.

Click New Scan in the top bar

Choose your asset type, e.g., Web App.

Choose the asset type

Fill in your targets (URLs or domains), and click Continue.

Fill in the targets

In the Scanner step, select either your individual scanner node or a Scanner Group to distribute the scan across multiple scanners, then click Continue.

Select the scanner or scanner group

Select the scan profile, e.g., Full Web Scan.

Select the scan profile

Configure additional settings or credentials if needed.

Configure additional settings or credentials

And click Start scan.

The scan will be created and dispatched to your on-premise scanner (or distributed across the scanner nodes in your chosen Scanner Group).

This guide presented a comprehensive walk-through of on-premise scanning, spanning from the declaration of a scanner and scanner groups to running scans on designated infrastructure.