veracode dynamic
Perform a Dynamic Analysis of a web application or REST API, check the status of an analysis, review the results of an analysis, and record login sequences.
To use the scan, status, and results commands, create at least one target in DAST on the Veracode Platform. A target defines the URLs of the web applications or REST APIs that you want to scan. You can run multiple analyses within the same target, called analysis runs.
Commands
| Command | Description |
|---|---|
scan | Runs an analysis in the specified target and outputs the discovered vulnerabilities. |
status | Returns the status of an analysis run. |
results | Returns the results of an analysis run. |
record (experimental) | Records a login sequence in Chrome and saves it as a SIDE file. |
veracode dynamic scan
Runs an analysis and outputs the discovered vulnerabilities. Make a note of the numeric analysis run ID listed in the output. You provide the analysis run ID when you run the commands veracode dynamic status or veracode dynamic results.
Usage
./veracode dynamic scan --webhook <string> [flags]
Flags
| Flag | Description |
|---|---|
--api-spec-file | Path to a REST API specification file, in JSON or YAML format, on the local file system. The analysis scans the endpoints defined in this file. If not specified, the analysis uses the API specification file uploaded to the target in the Veracode Platform. |
--app-auth-username | For standard or form-based authentication, the username to sign in to the application. |
--app-auth-password | Required if you include --app-auth-username. For standard or form-based authentication, the password to sign in to the application. |
--app-auth-url | Required if you include --app-auth-username and --app-auth-password. For form-based authentication, enter the URL to the sign-in form. |
--background | Run the analysis silently and do not display the status. |
--basic-auth-username | For HTTP basic authentication, the username to sign in to the application. |
--basic-auth-password | For HTTP basic authentication, the password to sign in to the application. |
--fail-on-severity | Fail the command based on one or more severity levels of the discovered vulnerabilities. Values are: CriticalHighMediumLowInformationalThe default is Informational. |
-h, --help | Show help for this command. |
--param-auth-type | Required if you include --param-auth-key and --param-auth-value. For parameter authentication, the configuration type. Values are: HTTP_HEADERCOOKIEGET_PARAMETERSESSION_STORAGELOCAL_STORAGE |
--param-auth-key | Required if you include --param-auth-type and --param-auth-value. For parameter authentication, the key name. |
--param-auth-value | Required if you include --param-auth-type and --param-auth-key. For parameter authentication, the key value. |
--payload-file | Path to a custom payload file, in JSON format, on the local file system. |
-w, --webhook | Required. The UUID of the target to run the analysis for. For example, 290c0aa5-5554-4f9b-b564-9544f9fb7323. To find the target UUID, open the target in the Veracode Platform. If you have a legacy webhook UUID, you can continue to use it for backward compatibility. |
Examples
To run an analysis using a target UUID, run:
./veracode dynamic scan --webhook 290c0aa5-5554-4f9b-b564-9544f9fb7323
To run an analysis and update a form-based authentication configuration, run:
./veracode dynamic scan -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 --app-auth-username [email protected] --app-auth-password rand0m123 --app-auth-url https://app.yourodmain.tld/login
To run an analysis and update a parameter authentication configuration, run:
./veracode dynamic scan -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 --param-auth-type COOKIE --param-auth-key gdpr_overlay --param-auth-value false
To run an analysis and update multiple settings of a parameter authentication configuration, run:
./veracode dynamic scan -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 --param-auth-type COOKIE --param-auth-key gdpr_overlay --param-auth-value false --param-auth-type GET_PARAMETER --param-auth-key auth_provider --param-auth-value local
To run an analysis on a REST API using a local API specification file, run:
./veracode dynamic scan -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 --api-spec-file ./swagger.json
veracode dynamic status
Returns the status of an analysis run.
Usage
./veracode dynamic status --analysis-run-id <integer> --webhook <string> [flags]
Flags
| Flag | Description |
|---|---|
-a, --analysis-run-id | Required. The numeric ID of the analysis run. The ID is listed in the output of the command veracode dynamic scan. In the following output examples, the ID is 18063: Starting Dynamic Scan with analysis run ID: 18063, Scan complete: analysis run ID 18063. |
-w, --webhook | Required. The UUID of the target that contains the analysis run. For example, 290c0aa5-5554-4f9b-b564-9544f9fb7323. To find the target UUID, open the target in the Veracode Platform. If you have a legacy webhook UUID, you can continue to use it for backward compatibility. |
Example
To return the status of an analysis run, run:
./veracode dynamic status -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 -a 18063
veracode dynamic results
Returns the results of an analysis run.
Usage
./veracode dynamic results --webhook <string> --analysis-run-id <integer> [flags]
Flags
| Flag | Description |
|---|---|
-w, --webhook | Required. The UUID of the target that contains the analysis run. For example, 290c0aa5-5554-4f9b-b564-9544f9fb7323. To find the target UUID, open the target in the Veracode Platform. If you have a legacy webhook UUID, you can continue to use it for backward compatibility. |
-a, --analysis-run-id | Required. The numeric ID of the analysis run. The ID is listed in the output of the command veracode dynamic scan. In the following output examples, the ID is 18063: Starting Dynamic Scan with analysis run ID: 18063, Scan complete: analysis run ID 18063. |
--format | Optional. Format of the results output. Values are: jsonjunitpdf By default, the results are listed in the command prompt window and saved as JSON in the current directory. If you enter junit or pdf, by default, the results are saved as ./results.xml or ./results.pdf. |
--output | Optional. Path and filename of the results output. By default, the output file is results.json in the current directory. To change the file format and extension, include --format. |
Examples
To print the results in the command prompt window, run:
./veracode dynamic results -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 -a 18063
To output the results in JUnit format, run:
./veracode dynamic results -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 -a 18063 --format junit --output ./my_results.xml
To output the results in PDF format, run:
./veracode dynamic results -w 290c0aa5-5554-4f9b-b564-9544f9fb7323 -a 18063 --format pdf --output ./my_results.pdf
veracode dynamic record
This command is experimental. Its flags, prompts, and output might change in future releases.
Records browser interactions in Chrome and saves them as a Selenium IDE SIDE (.side) file. You can upload the file to DAST or Dynamic Analysis as a login script.
The command opens a Chrome window at the URL that you specify and records your clicks and form input. It then converts the recording into the supported Selenium commands. You do not need to install Selenium IDE.
This command does not require a target or a connection to the Veracode Platform.
Before you begin
- Install Google Chrome on the computer where you run the command.
- Use a test account for the recording, not a personal or real user account.
Usage
./veracode dynamic record --url <string> [flags]
Flags
| Flag | Description |
|---|---|
--force | Optional. Overwrite the output file if it already exists. |
-h, --help | Show help for this command. |
-n, --name | Optional. The name of the recorded test in the SIDE file. The default is Recorded login sequence. |
-o, --output | Optional. Path and filename of the SIDE file. The default is login.side in the current directory. If the file exists, the command replaces it only if you include --force. |
--timeout | Optional. The maximum duration of the recording session in minutes. When the timeout is reached, Chrome closes and the command does not save the recording. To set no limit, enter 0. The default is 20. |
-u, --url | Required. The URL of the page where the recording starts. |
Record a script
After you run the command, complete these steps:
- Chrome opens at the URL. Perform the sequence in the Chrome window, such as signing in or completing a multistep form. Do not close the browser.
- In the command prompt window, press Enter.
- Optional. When prompted, enter text that appears only after the sequence succeeds, such as a welcome message after signing in. The command adds a
waitForTextPresentcommand to the script to verify successful completion. To skip this step, leave the text blank and press Enter. - Press Enter to close the browser and save the SIDE file.
The command lists the number of recorded commands and any warnings.
Recorded commands
A login script starts with deleteAllCookies and open commands. The command records clicks, double-clicks, text entry, dropdown selections, checkbox selections, form submissions, and the Enter key. It inserts a waitForElementPresent command before each command that targets an element. It identifies elements using the first unique attribute from the following list: id, data-testid, name, aria-label, and placeholder. If none of these attributes identify the element, it uses a CSS path.
Limitations
- The command does not record hover and drag actions.
- The command cannot record file uploads. A warning appears, and you must add a file upload step manually.
- The command records the values that you type, including passwords. Before you upload the file, open it in a text editor and replace the credential values with scanner variables. The command saves the file so that only the current user can read and write it.
- Chrome autofill might populate fields without generating input events. Clear saved credentials from the browser profile before recording.
- The scanner can complete multifactor authentication (MFA) only if it is time-based one-time password (TOTP) MFA. The command does not record the TOTP code. Configure a TOTP seed as a scanner variable in the Veracode Platform, then add the variable to the TOTP field step in the script manually. For an example, see the example script for MFA. Other types of MFA are not supported.
Examples
To record a login script and save it as login.side, run:
./veracode dynamic record --url https://app.example.com/login --output login.side
To replace an existing file and allow a 30-minute recording session, run:
./veracode dynamic record --url https://app.example.com/login --output login.side --force --timeout 30