Integrations

ServiceNow Rapid7 Integration Guide

advancedAPI Key in header with X-Api-Key authenticationRapid7 InsightVM

The ServiceNow Rapid7 InsightVM integration enables organizations to automatically import vulnerability scan findings from Rapid7's InsightVM platform into ServiceNow's Vulnerability Response application, creating a centralized security operations workflow. This integration solves the challenge of manually tracking and remediating vulnerabilities by automating the creation of vulnerability records, risk scoring, and remediation task assignments. Security teams, IT operations, and vulnerability management analysts rely on this integration to maintain comprehensive vulnerability tracking and ensure timely remediation. The integration supports bidirectional data flows using the official ServiceNow IntegrationHub Rapid7 InsightVM spoke, with InsightVM pushing scan results and asset data to ServiceNow while ServiceNow can query InsightVM for additional vulnerability details and update remediation status. The primary automation pattern involves scheduled imports and real-time vulnerability creation triggers, operating within the ServiceNow Vulnerability Response module and leveraging Connection & Credential Aliases for secure API communication.

Prerequisites

  • ServiceNow Quebec release or later with Vulnerability Response plugin activated
  • IntegrationHub Professional license or higher
  • Rapid7 InsightVM Console with API access enabled
  • Rapid7 user account with Administrator or Asset Manager role for API key generation
  • ServiceNow Integration Hub Rapid7 InsightVM spoke installed from ServiceNow Store
  • MID Server configured if InsightVM Console is deployed on-premises behind firewall
  • Vulnerability Response tables (sn_vul_vulnerable_item, sn_vul_entry) properly configured

Architecture Overview

The integration utilizes the official ServiceNow IntegrationHub Rapid7 InsightVM spoke, which provides pre-built Actions for vulnerability data synchronization and asset discovery. Authentication is established using API key-based authentication stored in ServiceNow Connection & Credential Aliases, with the API key generated from the InsightVM Security Console and stored securely in the sys_alias table. Data flows unidirectionally from InsightVM to ServiceNow through scheduled IntegrationHub flows that poll InsightVM APIs for new scan results and vulnerability findings, triggering automatic creation of vulnerable item records and associated remediation tasks. A MID Server is required when the InsightVM Console is deployed on-premises to facilitate secure communication between ServiceNow's cloud instance and the internal InsightVM deployment. The InsightVM API enforces rate limiting of 500 requests per minute per API key, requiring flow design considerations for bulk data imports and error handling for rate limit exceptions.

Sourdough
Chrome Extension

Sourdough: ServiceNow Monitoring and Analytics

A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.

Instance HealthGraphs & ChartsAPI HealthDeveloper ToolsQuick SearchInstance Switcher
Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Implementation Steps

1

Generate and configure Rapid7 InsightVM API credentials

Log into your Rapid7 InsightVM Security Console and navigate to Administration > Global and Engine Settings > API. Click 'Generate API Key' and provide a descriptive name like 'ServiceNow Integration'. Copy the generated API key immediately as it will not be displayed again. In ServiceNow, navigate to Connections & Credentials > Credentials and create a new Basic Auth Credential with Type 'API Key', setting the API Key field to your copied Rapid7 key. Name the credential 'Rapid7_InsightVM_API' for easy identification and set the Connection timeout to 30 seconds to accommodate potentially large vulnerability datasets.

2

Create Connection Alias for InsightVM Console

Navigate to Connections & Credentials > Connection & Credential Aliases and create a new Connection Alias record. Set the Name field to 'Rapid7_InsightVM_Connection' and the Connection URL to your InsightVM Console base URL (e.g., https://your-console.rapid7.com:3780). Associate the previously created credential in the Credential field and verify the connection type is set to 'Use for Outbound requests'. Test the connection by clicking 'Test Connection' to ensure ServiceNow can reach your InsightVM Console. If using an on-premises InsightVM deployment, ensure the MID Server field is populated with your configured MID Server instance.

3

Install and configure the Rapid7 InsightVM IntegrationHub spoke

Navigate to System Applications > All Applications > All and search for 'Rapid7 InsightVM' to locate the official spoke. If not already installed, access the ServiceNow Store through System Applications > Application Repository and search for 'Rapid7 InsightVM spoke' to install the latest version. Once installed, navigate to Process Automation > Flow Designer and create a new Flow named 'Rapid7 Vulnerability Sync'. Add the 'InsightVM - Get Vulnerabilities' Action from the Rapid7 spoke and configure it to use your Connection Alias. Verify that the Action properties include fields for site filtering, vulnerability states, and severity levels to control the scope of imported vulnerabilities.

4

Configure vulnerability data mapping and transformation

Within your Flow Designer flow, add a 'For Each' loop to process the vulnerability results returned from InsightVM. Inside the loop, add a 'Create Record' Action targeting the Vulnerable Item table (sn_vul_vulnerable_item). Map InsightVM fields to ServiceNow fields: vulnerability ID to Source ID, CVSS score to CVSS Base Score, severity to Priority, and affected asset information to Configuration Item references. Create a Data Transformation script to handle InsightVM-specific vulnerability classifications and map them to ServiceNow's vulnerability categories. Configure error handling to capture and log any mapping failures for troubleshooting purposes.

ServiceNow Script
// Data transformation script for InsightVM to ServiceNow vulnerability mapping
(function transform(source, target) {
    target.source_id = source.id;
    target.vulnerability = source.title;
    target.description = source.description;
    target.cvss_base_score = source.cvss_v3_score || source.cvss_v2_score;
    target.priority = mapSeverityToPriority(source.severity);
    target.state = 'open';
    target.source_table = 'rapid7_insightvm';
    
    function mapSeverityToPriority(severity) {
        switch(severity.toLowerCase()) {
            case 'critical': return '1';
            case 'severe': return '2';
            case 'moderate': return '3';
            default: return '4';
        }
    }
})(source, target);
5

Set up automated remediation task creation workflow

Create a Business Rule on the Vulnerable Item table (sn_vul_vulnerable_item) that triggers 'after insert' to automatically create remediation tasks when new vulnerabilities are imported. Navigate to System Definition > Business Rules and create a rule named 'Create Remediation Tasks for Rapid7 Vulnerabilities'. In the Advanced tab, write a script that creates records in the Remediation Task table (sn_vul_remediation_task) with appropriate assignment groups based on vulnerability type and affected asset ownership. Configure the task priority, due dates, and escalation rules based on CVSS scores and organizational SLAs. Include logic to prevent duplicate task creation by checking for existing remediation tasks for the same vulnerability and asset combination.

ServiceNow Script
// Business Rule script for automated remediation task creation
(function executeRule(current, previous /*null when async*/) {
    var task = new GlideRecord('sn_vul_remediation_task');
    task.initialize();
    task.vulnerable_item = current.sys_id;
    task.short_description = 'Remediate: ' + current.vulnerability;
    task.description = 'Address vulnerability: ' + current.description;
    task.priority = current.priority;
    task.assigned_to = determineAssignee(current.cmdb_ci);
    task.due_date = calculateDueDate(current.cvss_base_score);
    task.state = 'open';
    task.insert();
    
    function calculateDueDate(cvssScore) {
        var daysToAdd = cvssScore >= 9 ? 7 : cvssScore >= 7 ? 14 : 30;
        var dueDate = new GlideDateTime();
        dueDate.addDays(daysToAdd);
        return dueDate;
    }
})(current, previous);
6

Configure risk scoring and vulnerability prioritization

Navigate to Vulnerability Response > Configuration > Risk Conditions to set up risk scoring rules that incorporate InsightVM threat intelligence and exploit availability data. Create Risk Condition records that evaluate CVSS scores, exploit maturity levels, and asset criticality to generate comprehensive risk scores for imported vulnerabilities. Configure the Vulnerability Risk Calculator to weight InsightVM-specific metrics such as Malware Kits usage and Real World Impact ratings. Set up automated vulnerable item categorization based on InsightVM vulnerability categories and solutions, ensuring that similar vulnerabilities are grouped for efficient remediation planning. Verify that the risk scoring algorithm properly handles InsightVM's unique scoring methodology and threat context information.

ServiceNow Script
// Risk scoring script incorporating InsightVM threat data
(function calculateRisk() {
    var riskScore = 0;
    var cvssScore = parseFloat(current.cvss_base_score) || 0;
    var exploitMaturity = current.u_exploit_maturity || '';
    var assetCriticality = current.cmdb_ci.u_criticality || 'medium';
    
    // Base CVSS contribution (40% weight)
    riskScore += (cvssScore / 10) * 40;
    
    // Exploit maturity modifier (30% weight)
    var exploitWeight = {'proof-of-concept': 10, 'functional': 20, 'weaponized': 30};
    riskScore += (exploitWeight[exploitMaturity] || 0);
    
    // Asset criticality modifier (30% weight)
    var criticalityWeight = {'low': 5, 'medium': 15, 'high': 25, 'critical': 30};
    riskScore += criticalityWeight[assetCriticality] || 15;
    
    return Math.min(riskScore, 100);
})();
7

Set up scheduled synchronization and monitoring

Configure your IntegrationHub flow to run on a scheduled basis by adding a Timer trigger set to run every 4 hours during business hours to avoid overwhelming the InsightVM API rate limits. Navigate to Process Automation > Flow Designer and modify your flow trigger settings to include error handling and retry logic for failed API calls. Create a ServiceNow Dashboard in Performance Analytics or create custom reports to monitor integration health, including metrics for successfully imported vulnerabilities, failed synchronizations, and remediation task completion rates. Set up Event Management rules to alert administrators when the integration fails or when API rate limits are exceeded. Configure logging levels to capture detailed information about data transformation and mapping issues for troubleshooting purposes.

ServiceNow Script
// Flow error handling and retry logic
var attempt = 0;
var maxAttempts = 3;
var success = false;

while (attempt < maxAttempts && !success) {
    try {
        var response = sn_ih_rapid7.InsightVM().getVulnerabilities({
            connection: 'Rapid7_InsightVM_Connection',
            site_id: inputs.site_id,
            severity: inputs.severity_filter
        });
        
        if (response.status_code == 200) {
            success = true;
            outputs.vulnerabilities = response.body.resources;
        } else if (response.status_code == 429) {
            // Rate limit exceeded, wait and retry
            gs.sleep(60000); // Wait 1 minute
            attempt++;
        }
    } catch (ex) {
        gs.error('Rapid7 sync error on attempt ' + (attempt + 1) + ': ' + ex.message);
        attempt++;
        if (attempt < maxAttempts) gs.sleep(30000);
    }
}
8

Test integration and validate data flow

Execute a manual test of your integration flow by navigating to Process Automation > Flow Designer and running your Rapid7 synchronization flow with test parameters. Verify that vulnerability records are created in the Vulnerable Item table with proper field mappings and that associated remediation tasks are generated with correct priorities and assignments. Check the System Logs > System Log > All for any errors during data transformation and validate that CMDB CI references are properly resolved for affected assets. Test the error handling by temporarily modifying the Connection Alias to use invalid credentials and confirm that appropriate error messages are logged and notification emails are sent to administrators. Perform end-to-end testing by introducing a test vulnerability in InsightVM and verifying its complete workflow through to task assignment and resolution tracking in ServiceNow.

ServiceNow Script
// Validation script to verify data integrity after sync
(function validateSync() {
    var vulnItems = new GlideRecord('sn_vul_vulnerable_item');
    vulnItems.addQuery('source_table', 'rapid7_insightvm');
    vulnItems.addQuery('sys_created_on', '>', gs.daysAgoStart(1));
    vulnItems.query();
    
    var validCount = 0;
    var errorCount = 0;
    
    while (vulnItems.next()) {
        if (vulnItems.source_id.nil() || vulnItems.cvss_base_score.nil()) {
            gs.error('Invalid vulnerability record: ' + vulnItems.number);
            errorCount++;
        } else {
            validCount++;
        }
    }
    
    gs.info('Rapid7 sync validation: ' + validCount + ' valid, ' + errorCount + ' errors');
    return {valid: validCount, errors: errorCount};
})();

Common Use Cases

Automated vulnerability lifecycle management

InsightVM scan results automatically create vulnerable item records in ServiceNow with complete vulnerability details, CVSS scores, and affected asset information. The system generates remediation tasks assigned to appropriate teams based on asset ownership and vulnerability severity. Progress tracking occurs throughout the remediation process, with status updates flowing back to InsightVM when vulnerabilities are resolved. This use case eliminates manual vulnerability tracking and ensures comprehensive coverage of security findings across the organization.

Risk-based vulnerability prioritization

The integration imports InsightVM threat intelligence data including exploit availability, malware kit usage, and real-world impact assessments to enhance ServiceNow's risk scoring algorithms. Vulnerabilities are automatically prioritized based on combined CVSS scores, exploit maturity, asset criticality, and business context. High-risk vulnerabilities trigger expedited workflows with shorter SLAs and executive notifications. This approach ensures security teams focus remediation efforts on vulnerabilities that pose the greatest actual risk to the organization.

Asset-centric vulnerability reporting

Vulnerability data from InsightVM is correlated with ServiceNow CMDB records to provide comprehensive asset-based security reporting and dashboard views. Each configuration item displays associated vulnerabilities, remediation status, and historical vulnerability trends. Security metrics roll up to business service levels, enabling risk reporting aligned with business priorities. This use case supports compliance reporting requirements and executive-level security posture visibility.

Automated patch management workflow integration

Vulnerabilities identified by InsightVM automatically trigger ServiceNow change management processes for patch deployment when applicable patches are available. The system correlates vulnerability findings with software inventory data to identify affected systems and required patches. Change requests are automatically generated with pre-populated technical details and risk assessments from InsightVM. This integration streamlines the path from vulnerability discovery to remediation through established change management processes.

Exception and false positive management

The integration supports bidirectional communication for managing vulnerability exceptions and false positive determinations made in ServiceNow. Security analysts can mark vulnerabilities as accepted risks or false positives in ServiceNow, with status updates synchronized back to InsightVM to prevent duplicate reporting. Exception approvals follow ServiceNow approval workflows with proper documentation and periodic review requirements. This ensures vulnerability databases remain accurate and focused on actionable security findings.

Troubleshooting

401 Unauthorized error when connecting to InsightVM Console API

Verify the API key is correctly stored in the ServiceNow credential record and has not expired in InsightVM. Navigate to Connections & Credentials > Credentials and test the connection using the 'Test Connection' button. Check the InsightVM Security Console user permissions to ensure the API key owner has Administrator or Asset Manager role. If the connection still fails, regenerate the API key in InsightVM and update the ServiceNow credential record with the new key value.

429 Rate limit exceeded errors during bulk vulnerability imports

The InsightVM API enforces a 500 requests per minute limit that can be exceeded during large vulnerability imports. Implement retry logic with exponential backoff in your IntegrationHub flow and reduce the batch size of API calls. Consider scheduling flows during off-peak hours and adding delays between API requests. Monitor the Flow Execution Details for rate limit patterns and adjust the flow frequency or implement pagination to stay within API quotas.

Duplicate vulnerability records created for the same finding

Check your data transformation logic to ensure proper deduplication based on InsightVM vulnerability ID and affected asset combinations. Review the Business Rule conditions for remediation task creation to prevent duplicate tasks. Implement a lookup mechanism using the source_id field to check for existing vulnerable item records before creating new ones. Verify that your scheduled flow includes proper state management to track previously imported vulnerabilities.

CMDB CI references not resolving for InsightVM assets

Ensure that InsightVM asset names or IP addresses match the identification criteria used in your ServiceNow CMDB discovery processes. Review the asset correlation logic in your data transformation scripts to handle variations in hostname formats and IP address representations. Consider implementing a secondary lookup mechanism using MAC addresses or other unique identifiers. If assets don't exist in CMDB, configure your flow to create basic CI records or flag unresolved assets for manual review.

Risk scoring calculations producing inconsistent results

Validate that InsightVM CVSS scores are properly mapped to ServiceNow vulnerability records and check for null or invalid score values. Review your risk condition logic to ensure InsightVM-specific threat intelligence fields are correctly weighted in calculations. Test risk scoring with known vulnerability examples and compare results with expected values. Verify that asset criticality and environmental factors are properly incorporated into the risk calculation methodology.

MID Server connectivity issues with on-premises InsightVM Console

Verify that the MID Server can reach the InsightVM Console on the required ports (typically 3780 for HTTPS) and that firewall rules permit bidirectional communication. Check MID Server logs for connection errors and validate that the MID Server is in 'Up' status in ServiceNow. Test connectivity from the MID Server host using curl or telnet to verify network path availability. Ensure that SSL certificates are properly configured if using HTTPS connections and that certificate validation is appropriately handled.

Pro Tips

  • Implement custom business rules to automatically adjust vulnerability priorities based on asset business criticality and InsightVM threat context, creating a more sophisticated risk-based prioritization than default CVSS scoring alone. Use ServiceNow's Event Management capabilities to correlate vulnerability findings with security incidents for comprehensive threat response workflows.
  • Configure InsightVM vulnerability categories to map to ServiceNow knowledge base articles containing standardized remediation procedures, enabling consistent and efficient vulnerability resolution across teams. Leverage ServiceNow's approval workflows for vulnerability exceptions to maintain audit trails and periodic review cycles for accepted risks.
  • Utilize ServiceNow's Performance Analytics to create trending dashboards showing vulnerability discovery rates, mean time to remediation, and team performance metrics based on InsightVM data. Set up automated reporting for compliance frameworks by correlating vulnerability findings with specific regulatory requirements and control mappings.
  • Implement webhook endpoints in ServiceNow to receive real-time notifications from InsightVM for critical vulnerabilities, enabling immediate response workflows that bypass scheduled synchronization delays. Use ServiceNow's Machine Learning capabilities to predict vulnerability remediation timeframes based on historical InsightVM data and asset characteristics.
  • Create custom Integration Hub actions that enrich InsightVM vulnerability data with external threat intelligence feeds and ServiceNow asset context before creating vulnerable item records. Establish bidirectional workflows that update InsightVM scan schedules based on ServiceNow change management activities to ensure vulnerabilities are re-verified after remediation.
  • Design your integration to handle InsightVM site-based architecture by creating separate flows for different network segments or business units, allowing for customized vulnerability management workflows based on organizational structure and security requirements.

Known Limitations

  • The InsightVM API enforces strict rate limiting of 500 requests per minute per API key, which can significantly impact bulk vulnerability import operations and requires careful flow design with retry logic and request throttling. Large organizations with extensive vulnerability datasets may need to implement pagination and extended synchronization windows to avoid hitting these limits.
  • InsightVM's vulnerability data model includes proprietary threat intelligence fields and risk calculations that may not have direct equivalents in ServiceNow's standard vulnerability schema, requiring custom field extensions and complex data transformation logic. Some InsightVM-specific vulnerability context may be lost during the mapping process to ServiceNow's standardized vulnerability format.
  • The integration relies heavily on asset correlation between InsightVM and ServiceNow CMDB, but asset naming conventions and identification methods may differ significantly between systems, potentially resulting in unlinked vulnerabilities and incomplete risk assessment. Manual intervention may be required to establish proper asset relationships for newly discovered systems.
  • Real-time vulnerability notifications require webhook implementation and additional development beyond the standard spoke functionality, as the default integration pattern relies on scheduled polling which introduces latency in critical vulnerability response scenarios. Organizations requiring immediate vulnerability notifications must implement custom webhook receivers and associated security measures.
  • The IntegrationHub Professional license is required for the Rapid7 spoke functionality, and spoke action limitations may restrict the complexity of vulnerability data processing and transformation operations within flow designer, potentially requiring custom scripted solutions for advanced integration requirements.

Frequently Asked Questions

Can the integration handle multiple InsightVM Security Console instances or distributed deployments?

Yes, you can configure multiple Connection Aliases pointing to different InsightVM Console instances and create separate IntegrationHub flows for each environment. Each console requires its own API key and credential record in ServiceNow. Consider using flow naming conventions and vulnerability source identifiers to distinguish between different InsightVM instances. However, you'll need to manage API rate limits across all instances to avoid overwhelming ServiceNow or the InsightVM APIs.

How does the integration handle vulnerability state changes and lifecycle management?

The integration supports bidirectional state synchronization where vulnerability status changes in ServiceNow can be reflected back to InsightVM through the spoke's update actions. When vulnerabilities are marked as resolved or exceptions in ServiceNow, corresponding API calls can update InsightVM vulnerability states to prevent duplicate reporting. Implement business rules to automatically trigger state updates based on remediation task completion or vulnerability exception approvals. The spoke provides actions for both reading and updating vulnerability status information.

What happens to vulnerability data when InsightVM assets are decommissioned or removed?

The integration typically maintains historical vulnerability records even when assets are removed from InsightVM to preserve audit trails and compliance documentation. Configure your synchronization flows to handle asset lifecycle by checking asset status and updating corresponding CMDB CI records appropriately. Consider implementing data retention policies for vulnerable item records associated with decommissioned assets. You can create cleanup processes that archive or remove vulnerability records based on asset status and organizational retention requirements.

How can I customize vulnerability prioritization beyond standard CVSS scoring?

ServiceNow's Vulnerability Response allows extensive customization of risk scoring algorithms by incorporating InsightVM threat intelligence data such as exploit availability, malware kit usage, and real-world impact ratings. Create custom Risk Conditions that evaluate these InsightVM-specific fields alongside asset criticality and business context. Implement business rules that adjust vulnerability priorities based on asset ownership, network location, or compliance requirements. The integration can import InsightVM's proprietary risk scores and threat context to enhance ServiceNow's prioritization algorithms.

Is it possible to trigger InsightVM scans from ServiceNow based on change management activities?

Yes, the Rapid7 InsightVM spoke includes actions for initiating scans and managing scan schedules that can be incorporated into ServiceNow change management workflows. Create business rules on Change Request completion that trigger targeted scans of affected assets using the InsightVM API. Configure Flow Designer workflows that automatically schedule vulnerability rescans when patches are deployed or system configurations are modified. This ensures that vulnerability status is updated promptly after remediation activities and maintains accurate security posture visibility.

How should I handle InsightVM custom vulnerability checks and findings?

InsightVM custom vulnerability checks can be imported into ServiceNow using the same integration patterns as standard vulnerability findings, but may require additional field mappings for custom attributes and remediation guidance. Create custom fields on the Vulnerable Item table to capture InsightVM-specific vulnerability metadata and custom check results. Implement data transformation scripts that handle custom vulnerability categories and map them to appropriate ServiceNow vulnerability classifications. Consider creating custom knowledge articles linked to specific custom checks to provide standardized remediation procedures.

What are the best practices for managing API credentials and security for this integration?

Store InsightVM API keys using ServiceNow's secure credential management with appropriate access controls and regular rotation schedules. Implement Connection Alias configurations that limit API access to specific ServiceNow integration users and monitor API usage through both ServiceNow and InsightVM logging. Use dedicated service accounts in InsightVM with minimal required permissions rather than personal user credentials. Configure SSL/TLS validation for all API communications and implement proper error handling that doesn't expose sensitive credential information in logs or error messages.

Test Your Knowledge

Quick 3-question quiz — see how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue