Rapid7 – Docker scan engine

I have tested running a rapid7 scan engine from docker.

Here are the “simple” command to download the image and have it running in a few minutes.
Try to get inspired from that one…

This one does deploy two new rapid7 scan engines.

 

#!/bin/bash
  
 
echo "--STOPPING THE CONTAINERS"
docker container stop scan scan1
docker container rm scan scan1
 
 
# get the image id
IMG=$(docker image ls | grep rapid7/insightvm_scan_engine | awk {'print $3'})
 
echo "${IMG}"
 
if [ ! -z "${IMG}" ]; then
        docker image rm ${IMG}
 
fi
 
echo "--PULLING THE NEW IMAGE"
#### -> https://hub.docker.com/u/rapid7
docker pull rapid7/insightvm_scan_engine
 
 
 
echo "--CREATING THE NEW CONTAINER 'SCAN'"
# Scan
docker create --name=scan --restart=always -p 40814:40814 -e PUID=1001 -e PGID=1001 -v /dev/rtc:/dev/rtc:ro -v /home/nicolas/scan_engine/nse/conf:/opt/rapid7/nexpose/nse/conf -v /home/nicolas/scan_engine/nse/keystores:/opt/rapid7/nexpose/nse/keystores -v /home/nicolas/scan_engine/nse/logs:/opt/rapid7/nexpose/nse/logs -v /home/nicolas/scan_engine/scans:/opt/rapid7/nexpose/nse/scans rapid7/insightvm_scan_engine
 
echo "--CREATING THE SECOND CONTAINER 'SCAN1'"
docker create --name=scan1 --restart=always -p 40813:40814 -e PUID=1001 -e PGID=1001 -v /dev/rtc:/dev/rtc:ro -v /home/nicolas/scan_engine1/nse/conf:/opt/rapid7/nexpose/nse/conf -v /home/nicolas/scan_engine1/nse/keystores:/opt/rapid7/nexpose/nse/keystores -v /home/nicolas/scan_engine1/nse/logs:/opt/rapid7/nexpose/nse/logs -v /home/nicolas/scan_engine1/scans:/opt/rapid7/nexpose/nse/scans rapid7/insightvm_scan_engine
 
echo "--STARTING BOTH CONTAINER NOW"
 
docker container start scan scan1




Leave a Reply