Created
November 20, 2020 15:35
-
-
Save dustinbutterworth/7fc2144e23689d5d8cd8dac43e89c43e to your computer and use it in GitHub Desktop.
Rapid7 Scan Hosts via API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rapid7 Scan Request | |
# Sites and their corresponding ID: | |
# ATL = 1 | |
# NYC = 2 | |
# | |
# Scan Engines and their corresponding ID: | |
# ATLSCANNER = 1 | |
# NYCSCANNER = 2 | |
# | |
# Which Scan Engines Go with Which Sites: | |
# ATLSCANNER = ATL | |
# NYCSCANNER = NYC | |
# | |
# Variables: | |
# INSIGHTVM_AUTH variable must be environment variable, preferably run through orchestration tool or pulled from parameter store. | |
SITE="1" | |
ENGINE="1" | |
HOSTS='"10.10.10.10","10.10.10.11","10.10.10.12"' | |
SCAN_NAME="Test" | |
TEMPLATE="a-test-template" | |
BASE_URL="https://rapid7consoleurl.com:3780" | |
curl --location --request POST ''${BASE_URL}'/api/3/sites/'${SITE}'/scans' \ | |
--header 'Content-Type: application/json' \ | |
--header 'Authorization: Basic '${INSIGHTVM_AUTH}'' \ | |
--data-raw '{ | |
"engineId": "'${ENGINE}'", | |
"hosts": [ | |
'${HOSTS}' | |
], | |
"name": "'${SCAN_NAME}'", | |
"templateId": "'${TEMPLATE}'" | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment