Skip to main content

scan_runs

Creates, updates, deletes, gets or lists a scan_runs resource.

Overview

Namescan_runs
TypeResource
Idgoogle.websecurityscanner.scan_runs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the ScanRun. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. The ScanRun IDs are generated by the system.
endTimestring (google-datetime)Output only. The time at which the ScanRun reached termination state - that the ScanRun is either finished or stopped by user.
errorTraceobjectOutput only. If result_state is an ERROR, this field provides the primary reason for scan's termination and more details, if such are available. (id: ScanRunErrorTrace)
executionStatestringOutput only. The execution state of the ScanRun.
hasVulnerabilitiesbooleanOutput only. Whether the scan run has found any vulnerabilities.
progressPercentinteger (int32)Output only. The percentage of total completion ranging from 0 to 100. If the scan is in queue, the value is 0. If the scan is running, the value ranges from 0 to 100. If the scan is finished, the value is 100.
resultStatestringOutput only. The result state of the ScanRun. This field is only available after the execution state reaches "FINISHED".
startTimestring (google-datetime)Output only. The time at which the ScanRun started.
urlsCrawledCountstring (int64)Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, the value represents the number of URLs crawled up to now.
urlsTestedCountstring (int64)Output only. The number of URLs tested during this ScanRun. If the scan is in progress, the value represents the number of URLs tested up to now. The number of URLs tested is usually larger than the number URLS crawled because typically a crawled URL is tested with multiple test payloads.
warningTracesarrayOutput only. A list of warnings, if such are encountered during this scan run.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, scanConfigsId, scanRunsIdGets a ScanRun.
listselectprojectsId, scanConfigsIdpageToken, pageSizeLists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
stopexecprojectsId, scanConfigsId, scanRunsIdStops a ScanRun. The stopped ScanRun is returned.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
projectsIdstring
scanConfigsIdstring
scanRunsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a ScanRun.

SELECT
name,
endTime,
errorTrace,
executionState,
hasVulnerabilities,
progressPercent,
resultState,
startTime,
urlsCrawledCount,
urlsTestedCount,
warningTraces
FROM google.websecurityscanner.scan_runs
WHERE projectsId = '{{ projectsId }}' -- required
AND scanConfigsId = '{{ scanConfigsId }}' -- required
AND scanRunsId = '{{ scanRunsId }}' -- required;

Lifecycle Methods

Stops a ScanRun. The stopped ScanRun is returned.

EXEC google.websecurityscanner.scan_runs.stop 
@projectsId='{{ projectsId }}' --required,
@scanConfigsId='{{ scanConfigsId }}' --required,
@scanRunsId='{{ scanRunsId }}' --required;