Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Repository files navigation

Build StatusLicenseKnown Vulnerabilities

SecureCodeBox Scanner Scaffolding

A wrapper to easily integrate new scanner into the secureCodeBox.

This bundles a few basic concernes every worker service should fullfill:

  • Fetching and completing Tasks
  • Healthcheck endpoints
  • Error handeling

Requirements

This libary is compatible with Node 8 and beyond.

Installation

npm install @securecodebox/scanner-scaffolding

Example

This example shows how this libary can be used:

constSecureCodeBoxScannerScaffolding=require('@securecodebox/scanner-scaffolding');constworker=newSecureCodeBoxScannerScaffolding(// Callback function which will be called when a new scan should be performedasynctargets=>{return{raw: [],result: []};},{engineAddress: 'http://localhost:8080',// Name of the External Task specified in the Enginetopic: 'nmap_portscan',// Used to generate the worker id. This Example would look something like this: securebox.portscan.60a6ac0c-4e26-40ea-908e-598e9c807887workername: 'portscan',// Used in the status page and logged on startup to check if the connection to the scanner is successful// Needs to return a object with to attribtues version and testRunasynctestScannerFunctionality(){return{version: '1.5.3',testRun: 'successful'};},});/** * Starts a small server with two endpoints: * * "/" basic endpoint for healthchecks returns the worker id as a string * "/status" returns a json object containing basic information about this worker */worker.startStatusServer();

Handeling Errors

In case of a scan failure you can throw Errors from the Callback function. The Error message will be submitted back to the engine.

About

Part of the deprecated secureCodeBox v1, see secureCodeBox/secureCodeBox Repo for v2

Resources

Stars

1 star

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages