Containerized Scan EngineCopy link

The Containerized Scan Engine is a form of Distributed Scan Engine that delivers the Scan Engine as a packaged or portable application that can easily be deployed to modern infrastructure. The Containerized Scan Engine ships as a single image and includes the Scan Engine software and all required dependencies, such as the Operating System, libraries, and associated files. Information about the Containerized Scan Engine is also maintained on Rapid7’s Docker Hub page .

  • Release schedule - The Containerized Scan Engine follows the regular product and content release schedule. Updates will be made on a continuous basis.
  • Supported architecture - The Containerized Scan Engine supports AMD64 architecture, specifically x86_64 architecture.

RequirementsCopy link

macOS supportability restriction

M1 chips are not supported.

For information about the Containerized Scan Engine’s system requirements, refer to System Requirements.

PrerequisitesCopy link

Before you begin, ensure that you have:

  • Access to the Security Console
  • The Console Shared Secret Key
  • The latest engine image - docker pull rapid7/insightvm_scan_engine:latest

Default TCP portCopy link

The default TCP port, 40814, is used by the Security Console to communicate with the Containerized Scan Engine. However, if the Containerized Scan Engine is connected to the Security Console it does not need to be exposed.

Image tagsCopy link

We provide multiple tags to help users identify the Scan Engine and content versions. The Containerized Scan Engine is updated continuously and bundled with the latest available content at the time of release. Refer to the digest of the image in order to see the correlation between tags.

Tag Value Description Example
latest The most recent product and content release version available. latest
product version The product release version. 6.6.188
product and content version The content release version. 6.6.188-content1.1.2837

Running the Containerized Scan EngineCopy link

Existing mount pointsCopy link

These are the existing mount points associated with the Containerized Scan Engine:

Mount point Description
/opt/rapid7/nexpose/nse/scans The scans directory is where the Containerized Scan Engine temporarily writes logs and results to. The Security Console will ask the Containerized Scan Engine to remove scan data associated with completed scans when the data associated with it is transferred to the Security Console. Though, if the Containerized Scan Engine is upgraded before all the scan data is transferred to the Security Console, and the scans directory is not a persisted volume, the scan data will be lost.

This directory is recommended. The file system performance of this directory can have an impact on scan performance.
/opt/rapid7/nexpose/nse/conf The configuration directory stores the Containerized Scan Engine, logger configuration properties, and a list of trusted consoles.

The configuration directory can be optional if auto-pairing environment variables are used, since the Containerized Scan Engine will auto-pair each time it starts. However, we do recommend that an external configuration directory be used.
/opt/rapid7/nexpose/nse/keystores The keystores directory stores the private identity of the Containerized Scan Engine, and is used to establish trust with the Security Console.

This directory is optional if you do not intend to keep the Containerized Scan Engine up to date or paired to the Security Console. Otherwise, the keystores directory must be mounted or the Containerized Scan Engine will generate a new private identity each time it is started.
/opt/rapid7/nexpose/nse/logs The logs directory stores logs on an eternal volume.

This directory is optional. The file system performance of this directory can have an impact on the performance of individual scans.

Environment variablesCopy link

You may encounter the following environment variables:

Environment Variable Description
CONNECT_TO_ADDRESS This is the IP address where the Security Console will wait for connections from the Containerized Scan Engine.
CONNECT_TO_SHARED_SECRET If a shared secret is provided, the Containerized Scan Engine will add itself to the Security Console. The shared secret must be the same as the one generated on the Containerized Scan Engine Management page in the Security Console’s UI.

In the event that the shared secret is not provided the Containerized Scan Engine must be added on the Containerized Scan Engine Management page under the Administration tab in the Security Console’s UI.
CONNECT_TO_PORT This listening port can be manually configured and requires exposure as it replaces the existing listening port number in the nsc.xml file.
ACCEPT_FROM_ADDRESS This IP address will be used by the Security Console to connect to the Containerized Scan Engine.
ACCEPT_FROM_SHARED_SECRET If a shared secret is provided, the Containerized Scan Engine will challenge the Security Console and will not trust the Security Console if the response from the Security Console is incorrect. The shared secret must be the same as the one generated on the Containerized Scan Engine Management page in the Security Console’s UI.

In the event that the shared secret is not provided, the Containerized Scan Engine will not challenge the Security Console and will trust the first console that connects to it using the IP address.
Environment variable stipulations

You can use a CONNECT_TO_ADDRESS and an ACCEPT_FROM_ADDRESS at the same time, but it is not possible to use multiple addresses for CONNECT_TO_ADDRESS or ACCEPT_FROM_ADDRESS at the same time.

Running containers with Docker commandsCopy link

You can run the following Docker commands:

Command Description
docker pull rapid7/insightvm_scan_engine:latest Pulls the latest image
docker run --env CONNECT_TO_SHARED_SECRET=<SHARED_SECRET> --env CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS> rapid7/insightvm_scan_engine:latest Starts a container connecting to the Security Console
docker run --env ACCEPT_FROM_ADDRESS=<CONSOLE_ADDRESS> --env ACCEPT_FROM_SHARED_SECRET=<SHARED_SECRET> -p 40814:40814 rapid7/insightvm_scan_engine:latest Starts a container with accepting connection from the Security Console
docker run --env CONNECT_TO_SHARED_SECRET=<SHARED_SECRET> --env CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS> -v /var/docker/nse-container/data/rapid7/nexpose/nse/conf:/opt/rapid7/nexpose/nse/conf -v /var/docker/nse-container/data/rapid7/nexpose/nse/keystores:/opt/rapid7/nexpose/nse/keystores -v /var/docker/nse-container/data/rapid7/nexpose/nse/logs:/opt/rapid7/nexpose/nse/logs -v /var/docker/nse-container/data/rapid7/nexpose/nse/scans:/opt/rapid7/nexpose/nse/scans rapid7/insightvm_scan_engine:latest Starts a container with external mount points

Running containers with Docker ComposeCopy link

You can run the following commands with Docker Compose:

Copy

Run a single container with Docker Compose connected to the Security Console

version: "3"
services:
  nse-1:
    image: rapid7/insightvm_scan_engine
    volumes:
      - /var/docker/nse-1/data/rapid7/nexpose/nse/conf:/opt/rapid7/nexpose/nse/conf
      - /var/docker/nse-1/data/rapid7/nexpose/nse/keystores:/opt/rapid7/nexpose/nse/keystores
      - /var/docker/nse-1/data/rapid7/nexpose/nse/logs:/opt/rapid7/nexpose/nse/logs
      - /var/docker/nse-1/data/rapid7/nexpose/nse/scans:/opt/rapid7/nexpose/nse/scans
    environment:
      - CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS>
      - CONNECT_TO_SHARED_SECRET=<SHARED_SECRET>
Copy

Run a single container with accepting connections from the Security Console

version: "3"
services:
  nse-1:
    image: rapid7/insightvm_scan_engine
    ports:
      - "40814:40814"
    volumes:
      - /var/docker/nse-1/data/rapid7/nexpose/nse/conf:/opt/rapid7/nexpose/nse/conf
      - /var/docker/nse-1/data/rapid7/nexpose/nse/keystores:/opt/rapid7/nexpose/nse/keystores
      - /var/docker/nse-1/data/rapid7/nexpose/nse/logs:/opt/rapid7/nexpose/nse/logs
      - /var/docker/nse-1/data/rapid7/nexpose/nse/scans:/opt/rapid7/nexpose/nse/scans
    environment:
      - ACCEPT_FROM_ADDRESS=<CONSOLE_ADDRESS>
      - ACCEPT_FROM_SHARED_SECRET=<SHARED_SECRET>
Copy

Run multiple engines connecting to the Security Console

version: "3"
services:
  nse-1:
    image: rapid7/insightvm_scan_engine
    volumes:
      - /var/docker/nse-1/data/rapid7/nexpose/nse/conf:/opt/rapid7/nexpose/nse/conf
      - /var/docker/nse-1/data/rapid7/nexpose/nse/keystores:/opt/rapid7/nexpose/nse/keystores
      - /var/docker/nse-1/data/rapid7/nexpose/nse/logs:/opt/rapid7/nexpose/nse/logs
      - /var/docker/nse-1/data/rapid7/nexpose/nse/scans:/opt/rapid7/nexpose/nse/scans
    environment:
      - CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS>
      - CONNECT_TO_SHARED_SECRET=<SHARED_SECRET>
  nse-2:
    image: rapid7/insightvm_scan_engine
    volumes:
      - /var/docker/nse-2/rapid7/nexpose/nse/conf:/opt/rapid7/nexpose/nse/conf
      - /var/docker/nse-2/rapid7/nexpose/nse/keystores:/opt/rapid7/nexpose/nse/keystores
      - /var/docker/nse-2/rapid7/nexpose/nse/logs:/opt/rapid7/nexpose/nse/logs
      - /var/docker/nse-2/rapid7/nexpose/nse/scans:/opt/rapid7/nexpose/nse/scans
    environment:
      - CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS>
      - CONNECT_TO_SHARED_SECRET=<SHARED_SECRET>
  nse-3:
    image: rapid7/insightvm_scan_engine
    volumes:
      - /var/docker/nse-3/rapid7/nexpose/nse/conf:/opt/rapid7/nexpose/nse/conf
      - /var/docker/nse-3/rapid7/nexpose/nse/keystores:/opt/rapid7/nexpose/nse/keystores
      - /var/docker/nse-3/rapid7/nexpose/nse/logs:/opt/rapid7/nexpose/nse/logs
      - /var/docker/nse-3/rapid7/nexpose/nse/scans:/opt/rapid7/nexpose/nse/scans
    environment:
      - CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS>
      - CONNECT_TO_SHARED_SECRET=<SHARED_SECRET>

Test the Containerized Scan EngineCopy link

If you want to start a Containerized Scan Engine to test how it works, you are able to run it in daemon mode. However, the Containerized Scan Engine will not be useful if it is not connected with the Security Console.

To test the Containerized Scan Engine without connecting to the Security Console:

  1. Run the container: docker run --name first_engine rapid7/insightvm_scan_engine:latest.
  2. Verify that the container is running: docker ps.

Run the Containerized Scan Engine and connect to the Security ConsoleCopy link

You can choose to either standard pair or reverse pair the Containerized Scan Engine to the Security Console.

Configure a standard pair with your Security Console - docker run --env ACCEPT_FROM_ADDRESS=<CONSOLE_ADDRESS> --env ACCEPT_FROM_SHARED_SECRET=<SHARED_SECRET> -p 40814:40814 rapid7/insightvm_scan_engine:latest

You may need to use the gateway address as your CONSOLE_ADDRESS, depending on your Docker network configuration when standard pairing - docker inspect <container-id> | grep Gateway

Configure a reverse pair with your Security Console - docker run --env CONNECT_TO_SHARED_SECRET=<SHARED_SECRET> --env CONNECT_TO_ADDRESS=<CONSOLE_ADDRESS> rapid7/insightvm_scan_engine:latest

Run the Containerized Scan Engine using KubernetesCopy link

To run the Containerized Scan Engine in Kubernetes, create the necessary infrastructure and permissions required.

PrerequisitesCopy link

To run the Containerized Scan Engine using Kubernetes, you’ll need the following:

  • A Kubernetes cluster with a node that meets the minimum requirements to run the Containerized Scan Engine
  • Access to the Scan Engine image egress access nodegroup to Docker Hub 
  • kubectl configured and installed for cluster management
  • A persistent production driver volume, which can differ depending on the storage provider 
  • To meet the necessary requirements for setup, as outlined in the AWS environment and GCP environment sections

Kubeconfig

A YAML file is used by Kubernetes to store cluster information for kubectl to refer to when running commands. Configure your Kubernetes environment to be able to run the Containerized Scan Engine:

Standard pairing

Reverse pairing is recommended

Reverse pairing is recommended as standard pairing may pose a security concern due to the requirement to expose a port and IP address for the Containerized Scan Engine. If you choose to standard pair, make sure the ingress rule is restricted to only the listener port and the console IP address.

When standard pairing (Console-to-Engine), use the cluster IP address in order to add the Scan Engine and the NodePort as the port. The value for ACCEPT_FROM_ADDRESS should be the internal IP address within the node that is used to route traffic to the pod. The IP range assigned to a node should have the IP address as the second address in the range (the first should be the broadcast address). The valid IP address in the node pod CIFR can be retrieved by the command or in the console:

Copy
kubectl get node <node name> -o jsonpath="{.spec}"
Copy
apiVersion: apps/v1
kind: Deployment
metadata:
  name: scan-engine
spec:
  selector:
    matchLabels:
      app: scan-engine
  template:
    metadata:
      labels:
       app: scan-engine
    spec:
      containers:
      - name: scan-engine
        image: rapid7/insightvm_scan_engine:latest
        ports:
        - containerPort: 40814
        volumeMounts:
          - name: persistent-storage
            mountPath: /opt/rapid7/nexpose/nse/conf
            subPath: engine1/conf
          - name: persistent-storage
            mountPath: /opt/rapid7/nexpose/nse/keystores
            subPath: engine1/keystores
        env:
        - name: ACCEPT_FROM_ADDRESS
          value: <Node Internal IP Address>
      volumes:
      - name: persistent-storage
        persistentVolumeClaim:
          claimName: ebs-claim
Copy
kubectl apply -f scan-engine-deployment.yaml
NodePort value must be within 30000-32767 range

The NodePort value must be within the 30000-32767 range. For more information on the default range, refer to Kubernetes’ documentation .
Copy
apiVersion: v1
kind: Service
metadata:
  name: scan-engine
  labels:
    app: scan-engine
spec:
  type: NodePort
  ports:
    - port: 40814
      targetPort: 40814
      protocol: TCP
      nodePort: 30001
  selector:
    app: scan-engine
Copy
kubectl apply -f ./scan-engine-service.yaml

Deploy and manage containers with Kubernetes StatefulSets

StatefulSet  is the workload API object used to manage stateful applications. It manages the deployment and scaling of a set of pods and provides a persistent identity for each of its pods through any rescheduling. It is especially ideal for those that intend to deploy multiple scan engine containers as long-lived (non-ephemeral) containers, as their identities will continue to persist for later updates.

Kubernetes Scan Engine AWS environmentCopy link

Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that is used to deploy and operate containerized applications at scale using Amazon infrastructure. EKS is beneficial when working with Kubernetes as it manages many underlying components for you.

Kubernetes Scan Engine GCP environmentCopy link

The Google Kubernetes Engine  (GKE) is a managed Kubernetes service that is used to deploy and operate containerized applications at scale using the Google infrastructure. GKE is beneficial when working with Kubernetes as it manages many underlying components (eg. control plane, nodes).

Frequently asked Questions

Troubleshooting