Scale

SCNR can be configured into a Grid, in order to combine the resources of multiple nodes and thus perform large amounts of scans simultaneously or complete individual scans faster.

Its Grid can distribute workload horizontally and vertically and can also easily scale up and/or down.

In essence, Grids are created by connecting multiple Agents together, at which point a mesh network of Agents is formed. Doing so requires no configuration, other than specifying an already running Agent when booting up a new one.

This allows for creating a private Cloud of scanners, with minimal configuration, that can handle an indefinite amount of workload.

Prior to continuing, it would be best if you took a look at SCNR’s distributed architecture.

Strategies

Scaling strategies can be configured via the --strategy option of Agents, like so:

bin/scnr_agent --strategy=horizonstal
bin/scnr_agent --strategy=vertical

Horizontal (default)

SCNR Instances will be provided by the least burdened Agent, i.e. the Agent with the least utilization of its slots.

This strategy helps to keep the overall Grid health good by spreading the workload across as many nodes as possible.

Vertical

SCNR Instances will be provided by the most burdened Agent, i.e. the Agent with the most utilization of its slots.

This strategy helps to keep the overall Grid size (and thus cost) low by utilizing as few Grid nodes as possible.

It will also let you know if you have over-provisioned as extra nodes will not be receiving any workload.

Creating a Grid

In one terminal run:

bin/scnr_agent

This is the initial Agent.

Scaling up

To scale up just boot more Agents and specify a peer.

So, in another terminal run:

bin/scnr_agent --port=7332 --peer=127.0.0.1:7331

Lastly, in yet another terminal run:

bin/scnr_agent --port=7333 --peer=127.0.0.1:7332

(It doesn’t matter who the peer is as long as it’s part of the Grid.)

Now we have a Grid of 3 Agents.

The point of course is to run each Agent on a different machine in real life, but this will do for now.

Scaling down

You can scale down by unplugging an Agent from its Grid using:

bin/scnr_agent_unplug 127.0.0.1:7332

Running Grid scans

To start a scan that will be load-balanced across the Grid, simply issue a spawn request on any of the Grid members.

Like so:

bin/scnr_spawn --agent-url=127.0.0.1:7331 http://testhtml5.vulnweb.com

The above will run a scan with the default options against http://testhtml5.vulnweb.com, originating from whichever node is optimal at any given time.

If the Grid is out of slots you will see the following message:

[~] Agent is at maximum utilization, please try again later.

In which case you can keep retrying until a slot opens up.

Running multi-Instance scans

The above is useful when you have multiple scans to run and you want to run them at the same time; another cool feature of SCNR though is that it can parallelize individual scans across the Grid thus resulting in huge single-scan performance gains.

For example, this would be useful if you were to scan a site with tens of thousands, hundreds of thousands or even millions of pages.

Even better, doing so is as easy as:

bin/scnr_spawn --agent-url=127.0.0.1:7331 http://testhtml5.vulnweb.com --multi-instances=5

The --multi-instances=5 option will instruct SCNR to use 5 Instances to run this particular scan, with the aforementioned Instances being of course load-balanced across the Grid.