Create a Dynamic Analysis with a crawl script using the REST API
You can use the Dynamic Analysis API with a prerecorded crawl sequence to supplement the crawl automation of the Veracode scan engine.
See the example Selenium scripts.
To complete this task:
-
Enter values for the
scan_config_request
,crawl_configuration
, andschedule
properties in the JSON file. -
Send the following request:
http --auth-type=veracode_hmac POST "https://api.veracode.com/was/configservice/v1/analyses" < input.json
This is an example of how to use a Dynamic Analysis with a crawl script:
noteBefore you paste the crawl script into the API body, you must escape the JSON. If you need assistance, use the JSON escape utility available at https://jsonformatter.org.
{
"name": "Name-of-Your-Dynamic-Analysis",
"scans": [
{
"scan_config_request": {
"target_url": {
"url": "http://www.example.com",
"http_and_https": true,
"directory_restriction_type": "DIRECTORY_AND_SUBDIRECTORY"
},
"crawl_configuration": {
"scripts": [
{
"crawl_script_data": {
"script_type": "SELENIUM",
"script_body": "<escaped JSON>"
},
"name": "ExampleCrawlScript.side"
}
],
"disabled": false
}
}
}
],
"schedule": {
"now": true,
"duration": {
"length": 1,
"unit": "DAY"
}
}
}