implementing-rapid7-insightvm-for-scanning

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implementing Rapid7 InsightVM for Scanning

实施Rapid7 InsightVM扫描方案

Overview

概述

Rapid7 InsightVM (formerly Nexpose) is an enterprise vulnerability management platform that combines on-premises scanning via Security Console and Scan Engines with cloud-based analytics through the Insight Platform. InsightVM leverages Rapid7's vulnerability research library, Metasploit exploit knowledge, global attacker behavior data, internet-wide scanning telemetry, and real-time reporting to provide comprehensive vulnerability visibility. This skill covers deploying the Security Console, configuring Scan Engines, setting up scan templates, credentialed scanning, and integrating with the Insight Agent for continuous assessment.
Rapid7 InsightVM(前身为Nexpose)是一款企业级漏洞管理平台,结合了通过Security Console和Scan Engines实现的本地扫描,以及通过Insight Platform提供的云端分析能力。InsightVM利用Rapid7的漏洞研究库、Metasploit漏洞利用知识库、全球攻击者行为数据、全网扫描遥测和实时报告,提供全面的漏洞可见性。本技能涵盖Security Console部署、Scan Engines配置、扫描模板设置、凭证式扫描,以及与Insight Agent集成以实现持续评估的内容。

When to Use

适用场景

  • When deploying or configuring implementing rapid7 insightvm for scanning capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation
  • 在环境中部署或配置Rapid7 InsightVM扫描能力时
  • 建立符合合规要求的安全控制措施时
  • 构建或优化该领域的安全架构时
  • 开展需要此方案的安全评估时

Prerequisites

前置条件

  • Server meeting minimum requirements: 16 GB RAM, 4 CPU cores, 500 GB disk (Security Console)
  • Scan Engine: 8 GB RAM, 4 CPU cores, 100 GB disk
  • Network access to target subnets (ports vary by scan type)
  • Administrative credentials for authenticated scanning (SSH, WMI, SNMP)
  • Rapid7 InsightVM license and Insight Platform account
  • PostgreSQL database (bundled with Security Console)
  • 满足最低要求的服务器:Security Console需16 GB内存、4核CPU、500 GB磁盘
  • Scan Engine需8 GB内存、4核CPU、100 GB磁盘
  • 可访问目标子网的网络权限(端口因扫描类型而异)
  • 用于认证扫描的管理员凭证(SSH、WMI、SNMP)
  • Rapid7 InsightVM许可证和Insight Platform账户
  • PostgreSQL数据库(随Security Console捆绑提供)

Core Concepts

核心概念

InsightVM Architecture Components

InsightVM架构组件

Security Console

Security Console

The central management server that:
  • Hosts the web-based management interface (default port 3780)
  • Stores scan results in an embedded PostgreSQL database
  • Manages Scan Engine deployments and scan schedules
  • Generates reports and dashboards
  • Connects to Rapid7 Insight Platform for cloud analytics
Note: Security Console is NOT supported in containerized environments.
中央管理服务器,具备以下功能:
  • 托管基于Web的管理界面(默认端口3780)
  • 将扫描结果存储在嵌入式PostgreSQL数据库中
  • 管理Scan Engine部署和扫描计划
  • 生成报告和仪表盘
  • 连接至Rapid7 Insight Platform以获取云端分析
注意:Security Console不支持容器化环境。

Scan Engines

Scan Engines

Distributed scanning components that:
  • Perform active network scanning against target assets
  • Can be deployed across network segments for segmented environments
  • Available as container images on Docker Hub for flexible deployment
  • Report results back to the Security Console
分布式扫描组件,具备以下功能:
  • 对目标资产执行主动网络扫描
  • 可部署在不同网段,适配分段网络环境
  • 在Docker Hub上提供容器镜像,支持灵活部署
  • 将扫描结果上报至Security Console

Insight Agent

Insight Agent

Lightweight endpoint agent providing:
  • Continuous vulnerability assessment without network scans
  • Assessment of remote/roaming endpoints
  • Complement to engine-based scanning for comprehensive coverage
  • Real-time asset inventory updates
轻量级端点代理,提供以下能力:
  • 无需网络扫描即可实现持续漏洞评估
  • 对远程/漫游端点进行评估
  • 与基于引擎的扫描互补,实现全面覆盖
  • 实时更新资产清单

Scan Template Types

扫描模板类型

TemplateUse CaseDepth
Discovery ScanAsset inventory, host enumerationLow
Full Audit without Web SpiderStandard vulnerability assessmentMedium
Full Audit Enhanced LoggingDeep assessment with verbose loggingHigh
HIPAA ComplianceHealthcare regulatory complianceHigh
PCI ASV AuditPCI DSS external scanning requirementHigh
CIS Policy ComplianceConfiguration benchmarkingMedium
Web SpiderWeb application discovery and assessmentMedium
模板适用场景深度
Discovery Scan资产清单、主机枚举
Full Audit without Web Spider标准漏洞评估
Full Audit Enhanced Logging带详细日志的深度评估
HIPAA Compliance医疗行业合规扫描
PCI ASV AuditPCI DSS外部扫描要求
CIS Policy Compliance配置基准检查
Web SpiderWeb应用发现与评估

Workflow

操作流程

Step 1: Install Security Console

步骤1:安装Security Console

bash
undefined
bash
undefined

Download InsightVM installer (Linux)

Download InsightVM installer (Linux)

chmod +x Rapid7Setup-Linux64.bin ./Rapid7Setup-Linux64.bin -c
chmod +x Rapid7Setup-Linux64.bin ./Rapid7Setup-Linux64.bin -c

Verify service is running

Verify service is running

systemctl status nexposeconsole.service
systemctl status nexposeconsole.service

Access web interface

Access web interface

https://<console-ip>:3780

https://<console-ip>:3780


Initial configuration:
1. Navigate to https://localhost:3780
2. Complete the setup wizard with license key
3. Configure database settings (embedded PostgreSQL recommended)
4. Set administrator credentials
5. Activate Insight Platform connection for cloud analytics

初始配置:
1. 访问https://localhost:3780
2. 使用许可证密钥完成设置向导
3. 配置数据库设置(推荐使用嵌入式PostgreSQL)
4. 设置管理员凭证
5. 激活Insight Platform连接以启用云端分析

Step 2: Deploy Distributed Scan Engines

步骤2:部署分布式Scan Engines

bash
undefined
bash
undefined

Install Scan Engine on remote server

Install Scan Engine on remote server

./Rapid7Setup-Linux64.bin -c
./Rapid7Setup-Linux64.bin -c

During installation, select "Scan Engine only"

During installation, select "Scan Engine only"

Pair with Security Console using shared secret

Pair with Security Console using shared secret

Docker-based Scan Engine deployment

Docker-based Scan Engine deployment

docker pull rapid7/insightvm-scan-engine docker run -d
--name scan-engine
-p 40814:40814
-e CONSOLE_HOST=<console-ip>
-e CONSOLE_PORT=3780
-e ENGINE_NAME=DMZ-Scanner
-e SHARED_SECRET=<pairing-secret>
rapid7/insightvm-scan-engine

Pair engines in Security Console:
1. Administration > Scan Engines > New Scan Engine
2. Enter engine hostname/IP and port (default 40814)
3. Use shared secret for authentication
4. Verify connectivity status shows "Active"
docker pull rapid7/insightvm-scan-engine docker run -d
--name scan-engine
-p 40814:40814
-e CONSOLE_HOST=<console-ip>
-e CONSOLE_PORT=3780
-e ENGINE_NAME=DMZ-Scanner
-e SHARED_SECRET=<pairing-secret>
rapid7/insightvm-scan-engine

在Security Console中配对引擎:
1. 进入Administration > Scan Engines > New Scan Engine
2. 输入引擎主机名/IP和端口(默认40814)
3. 使用共享密钥进行认证
4. 确认连接状态显示为"Active"

Step 3: Configure Asset Discovery Sites

步骤3:配置资产发现站点

Site Configuration:
  Name:           Production-Network
  Scan Engine:    Primary-Engine-01
  Scan Template:  Full Audit without Web Spider

  Included Assets:
    - 10.0.0.0/8     (Internal network)
    - 172.16.0.0/12   (DMZ network)

  Excluded Assets:
    - 10.0.0.1        (Core router - fragile)
    - 10.0.100.0/24   (ICS/SCADA segment)

  Schedule:
    Frequency:    Weekly
    Day:          Sunday
    Time:         02:00 AM
    Max Duration: 8 hours
Site Configuration:
  Name:           Production-Network
  Scan Engine:    Primary-Engine-01
  Scan Template:  Full Audit without Web Spider

  Included Assets:
    - 10.0.0.0/8     (Internal network)
    - 172.16.0.0/12   (DMZ network)

  Excluded Assets:
    - 10.0.0.1        (Core router - fragile)
    - 10.0.100.0/24   (ICS/SCADA segment)

  Schedule:
    Frequency:    Weekly
    Day:          Sunday
    Time:         02:00 AM
    Max Duration: 8 hours

Step 4: Configure Authenticated Scanning

步骤4:配置认证扫描

Windows Credentials (WMI)

Windows凭证(WMI)

Credential Type:    Microsoft Windows/Samba (SMB/CIFS)
Domain:             CORP.EXAMPLE.COM
Username:           svc_insightvm_scan
Password:           <service-account-password>
Authentication:     NTLM

Privilege Elevation:
  Type:   None (use domain admin or local admin)
Credential Type:    Microsoft Windows/Samba (SMB/CIFS)
Domain:             CORP.EXAMPLE.COM
Username:           svc_insightvm_scan
Password:           <service-account-password>
Authentication:     NTLM

Privilege Elevation:
  Type:   None (use domain admin or local admin)

Linux/Unix Credentials (SSH)

Linux/Unix凭证(SSH)

Credential Type:    Secure Shell (SSH)
Username:           insightvm_scan
Authentication:     SSH Key (preferred) or Password
SSH Private Key:    /opt/rapid7/.ssh/scan_key
Port:               22

Privilege Elevation:
  Type:             sudo
  sudo User:        root
  sudo Password:    <sudo-password>
Credential Type:    Secure Shell (SSH)
Username:           insightvm_scan
Authentication:     SSH Key (preferred) or Password
SSH Private Key:    /opt/rapid7/.ssh/scan_key
Port:               22

Privilege Elevation:
  Type:             sudo
  sudo User:        root
  sudo Password:    <sudo-password>

Database Credentials

数据库凭证

Credential Type:    Microsoft SQL Server
Instance:           MSSQLSERVER
Domain:             CORP
Username:           insightvm_db_scan
Authentication:     Windows Authentication

Credential Type:    Oracle
Port:               1521
SID:                ORCL
Username:           insightvm_scan
Credential Type:    Microsoft SQL Server
Instance:           MSSQLSERVER
Domain:             CORP
Username:           insightvm_db_scan
Authentication:     Windows Authentication

Credential Type:    Oracle
Port:               1521
SID:                ORCL
Username:           insightvm_scan

Step 5: Configure Scan Templates

步骤5:配置扫描模板

Custom scan template for balanced scanning:
Template Name:      Enterprise-Standard-Scan

Service Discovery:
  TCP Ports:        Well-known (1-1024) + common services
  UDP Ports:        DNS(53), SNMP(161), NTP(123), TFTP(69)
  Method:           SYN scan (stealth)

Vulnerability Checks:
  Safe checks only: Enabled
  Skip potential:   Disabled
  Web spidering:    Disabled (separate template)
  Policy checks:    Enabled (CIS benchmarks)

Performance:
  Max parallel assets:     10
  Max requests per second: 100
  Timeout per asset:       30 minutes
  Retries:                 2
自定义平衡型扫描模板:
Template Name:      Enterprise-Standard-Scan

Service Discovery:
  TCP Ports:        Well-known (1-1024) + common services
  UDP Ports:        DNS(53), SNMP(161), NTP(123), TFTP(69)
  Method:           SYN scan (stealth)

Vulnerability Checks:
  Safe checks only: Enabled
  Skip potential:   Disabled
  Web spidering:    Disabled (separate template)
  Policy checks:    Enabled (CIS benchmarks)

Performance:
  Max parallel assets:     10
  Max requests per second: 100
  Timeout per asset:       30 minutes
  Retries:                 2

Step 6: Set Up Insight Agent Deployment

步骤6:设置Insight Agent部署

powershell
undefined
powershell
undefined

Windows Agent Installation (via GPO or SCCM)

Windows Agent Installation (via GPO or SCCM)

msiexec /i agentInstaller-x86_64.msi /quiet /norestart
  CUSTOMTOKEN=<platform-token>
CUSTOMCONFIG=<agent-config>
msiexec /i agentInstaller-x86_64.msi /quiet /norestart
  CUSTOMTOKEN=<platform-token>
CUSTOMCONFIG=<agent-config>

Linux Agent Installation

Linux Agent Installation

chmod +x agent_installer.sh ./agent_installer.sh install_start
--token <platform-token>
chmod +x agent_installer.sh ./agent_installer.sh install_start
--token <platform-token>

Verify agent connectivity

Verify agent connectivity

Check InsightVM console: Assets > Agent Management

Check InsightVM console: Assets > Agent Management

undefined
undefined

Step 7: Configure Remediation Workflows

步骤7:配置修复工作流

Remediation Project:
  Name:             Q1-2025-Critical-Remediation

  Scope:
    Severity:       Critical + High
    CVSS Score:     >= 7.0
    Assets:         Production-Network site

  Assignment:
    Team:           Infrastructure-Ops
    Due Date:       2025-03-31

  Tracking:
    Auto-verify:    Enabled (re-scan on next scheduled scan)
    Notification:   Email on overdue items
    Escalation:     Manager notification at 75% SLA
Remediation Project:
  Name:             Q1-2025-Critical-Remediation

  Scope:
    Severity:       Critical + High
    CVSS Score:     >= 7.0
    Assets:         Production-Network site

  Assignment:
    Team:           Infrastructure-Ops
    Due Date:       2025-03-31

  Tracking:
    Auto-verify:    Enabled (re-scan on next scheduled scan)
    Notification:   Email on overdue items
    Escalation:     Manager notification at 75% SLA

Step 8: API Integration for Automation

步骤8:API集成实现自动化

python
import requests
import json

class InsightVMClient:
    """Rapid7 InsightVM API v3 client for automation."""

    def __init__(self, console_url, api_key):
        self.base_url = f"{console_url}/api/3"
        self.session = requests.Session()
        self.session.headers.update({
            "Content-Type": "application/json",
            "Authorization": f"Bearer {api_key}"
        })
        self.session.verify = not os.environ.get("SKIP_TLS_VERIFY", "").lower() == "true"  # Set SKIP_TLS_VERIFY=true for self-signed certs in lab environments

    def get_sites(self):
        """List all configured scan sites."""
        response = self.session.get(f"{self.base_url}/sites")
        response.raise_for_status()
        return response.json().get("resources", [])

    def start_scan(self, site_id, engine_id=None, template_id=None):
        """Trigger an ad-hoc scan for a site."""
        payload = {}
        if engine_id:
            payload["engineId"] = engine_id
        if template_id:
            payload["templateId"] = template_id

        response = self.session.post(
            f"{self.base_url}/sites/{site_id}/scans",
            json=payload
        )
        response.raise_for_status()
        return response.json()

    def get_asset_vulnerabilities(self, asset_id):
        """Retrieve vulnerabilities for a specific asset."""
        response = self.session.get(
            f"{self.base_url}/assets/{asset_id}/vulnerabilities"
        )
        response.raise_for_status()
        return response.json().get("resources", [])

    def get_scan_status(self, scan_id):
        """Check the status of a running scan."""
        response = self.session.get(f"{self.base_url}/scans/{scan_id}")
        response.raise_for_status()
        return response.json()

    def create_remediation_project(self, name, description, assets, vulns):
        """Create a remediation tracking project."""
        payload = {
            "name": name,
            "description": description,
            "assets": {"includedTargets": {"addresses": assets}},
            "vulnerabilities": {"includedVulnerabilities": vulns}
        }
        response = self.session.post(
            f"{self.base_url}/remediations",
            json=payload
        )
        response.raise_for_status()
        return response.json()
python
import requests
import json

class InsightVMClient:
    """Rapid7 InsightVM API v3 client for automation."""

    def __init__(self, console_url, api_key):
        self.base_url = f"{console_url}/api/3"
        self.session = requests.Session()
        self.session.headers.update({
            "Content-Type": "application/json",
            "Authorization": f"Bearer {api_key}"
        })
        self.session.verify = not os.environ.get("SKIP_TLS_VERIFY", "").lower() == "true"  # Set SKIP_TLS_VERIFY=true for self-signed certs in lab environments

    def get_sites(self):
        """List all configured scan sites."""
        response = self.session.get(f"{self.base_url}/sites")
        response.raise_for_status()
        return response.json().get("resources", [])

    def start_scan(self, site_id, engine_id=None, template_id=None):
        """Trigger an ad-hoc scan for a site."""
        payload = {}
        if engine_id:
            payload["engineId"] = engine_id
        if template_id:
            payload["templateId"] = template_id

        response = self.session.post(
            f"{self.base_url}/sites/{site_id}/scans",
            json=payload
        )
        response.raise_for_status()
        return response.json()

    def get_asset_vulnerabilities(self, asset_id):
        """Retrieve vulnerabilities for a specific asset."""
        response = self.session.get(
            f"{self.base_url}/assets/{asset_id}/vulnerabilities"
        )
        response.raise_for_status()
        return response.json().get("resources", [])

    def get_scan_status(self, scan_id):
        """Check the status of a running scan."""
        response = self.session.get(f"{self.base_url}/scans/{scan_id}")
        response.raise_for_status()
        return response.json()

    def create_remediation_project(self, name, description, assets, vulns):
        """Create a remediation tracking project."""
        payload = {
            "name": name,
            "description": description,
            "assets": {"includedTargets": {"addresses": assets}},
            "vulnerabilities": {"includedVulnerabilities": vulns}
        }
        response = self.session.post(
            f"{self.base_url}/remediations",
            json=payload
        )
        response.raise_for_status()
        return response.json()

Usage

Usage

client = InsightVMClient("https://insightvm-console:3780", "api-key-here") sites = client.get_sites() for site in sites: print(f"Site: {site['name']} - Assets: {site.get('assets', 0)}")
undefined
client = InsightVMClient("https://insightvm-console:3780", "api-key-here") sites = client.get_sites() for site in sites: print(f"Site: {site['name']} - Assets: {site.get('assets', 0)}")
undefined

Best Practices

最佳实践

  1. Deploy Scan Engines close to target networks to minimize scan traffic traversing firewalls
  2. Use Insight Agents for roaming laptops and remote workers that are not always reachable by network scans
  3. Combine agent-based and engine-based scanning for the most accurate vulnerability view
  4. Configure scan blackout windows during business-critical hours to avoid operational impact
  5. Use credential testing before full scans to validate authentication works
  6. Enable safe checks to prevent accidental denial of service on production systems
  7. Separate scan sites by network segment, business unit, or compliance scope
  8. Leverage tag-based asset groups for dynamic reporting and remediation tracking
  1. 将Scan Engines部署在靠近目标网络的位置,减少扫描流量穿越防火墙
  2. 为漫游笔记本和远程员工使用Insight Agent,这类设备无法始终被网络扫描覆盖
  3. 结合基于代理和基于引擎的扫描,获得最准确的漏洞视图
  4. 在业务关键时段配置扫描黑窗,避免影响业务运行
  5. 在全面扫描前进行凭证测试,验证认证有效性
  6. 启用安全检查,防止对生产系统造成意外拒绝服务
  7. 按网段、业务单元或合规范围划分扫描站点
  8. 利用基于标签的资产组实现动态报告和修复跟踪

Common Pitfalls

常见误区

  • Running full scans during business hours causing network congestion or service degradation
  • Using unauthenticated scans only, missing 60-80% of local vulnerabilities
  • Not excluding fragile devices (printers, ICS/SCADA, medical devices) from aggressive scan templates
  • Failing to distribute Scan Engines across network segments, causing firewall bottlenecks
  • Ignoring scan engine resource utilization leading to incomplete scans
  • Not configuring scan duration limits, allowing runaway scans to consume resources indefinitely
  • 在工作时间运行全面扫描,导致网络拥堵或服务性能下降
  • 仅使用未认证扫描,遗漏60-80%的本地漏洞
  • 未将脆弱设备(打印机、ICS/SCADA、医疗设备)排除在激进扫描模板之外
  • 未在各网段分布式部署Scan Engines,导致防火墙瓶颈
  • 忽略Scan Engine资源利用率,导致扫描不完整
  • 未配置扫描时长限制,导致失控扫描持续消耗资源

Related Skills

相关技能

  • performing-agentless-vulnerability-scanning
  • building-vulnerability-data-pipeline-with-api
  • implementing-wazuh-for-vulnerability-detection
  • performing-remediation-validation-scanning
  • performing-agentless-vulnerability-scanning
  • building-vulnerability-data-pipeline-with-api
  • implementing-wazuh-for-vulnerability-detection
  • performing-remediation-validation-scanning