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

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.
endTimestringOutput only. The time at which the ScanRun reached termination state - that the ScanRun is either finished or stopped by user.
errorTraceobjectOutput only. Defines an error trace message for a ScanRun.
executionStatestringOutput only. The execution state of the ScanRun.
hasVulnerabilitiesbooleanOutput only. Whether the scan run has found any vulnerabilities.
progressPercentintegerOutput 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".
startTimestringOutput only. The time at which the ScanRun started.
urlsCrawledCountstringOutput 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.
urlsTestedCountstringOutput 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

NameAccessible byRequired ParamsDescription
getSELECTprojectsId, scanConfigsId, scanRunsIdGets a ScanRun.
listSELECTprojectsId, scanConfigsIdLists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
stopEXECprojectsId, scanConfigsId, scanRunsIdStops a ScanRun. The stopped ScanRun is returned.

SELECT examples

Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.

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