1// Copyright 2022 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.websecurityscanner.v1; 18 19import "google/cloud/websecurityscanner/v1/scan_run_error_trace.proto"; 20import "google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto"; 21import "google/protobuf/timestamp.proto"; 22 23option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; 24option go_package = "cloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb"; 25option java_multiple_files = true; 26option java_outer_classname = "ScanRunProto"; 27option java_package = "com.google.cloud.websecurityscanner.v1"; 28option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; 29option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; 30 31// A ScanRun is a output-only resource representing an actual run of the scan. 32// Next id: 12 33message ScanRun { 34 // Types of ScanRun execution state. 35 enum ExecutionState { 36 // Represents an invalid state caused by internal server error. This value 37 // should never be returned. 38 EXECUTION_STATE_UNSPECIFIED = 0; 39 40 // The scan is waiting in the queue. 41 QUEUED = 1; 42 43 // The scan is in progress. 44 SCANNING = 2; 45 46 // The scan is either finished or stopped by user. 47 FINISHED = 3; 48 } 49 50 // Types of ScanRun result state. 51 enum ResultState { 52 // Default value. This value is returned when the ScanRun is not yet 53 // finished. 54 RESULT_STATE_UNSPECIFIED = 0; 55 56 // The scan finished without errors. 57 SUCCESS = 1; 58 59 // The scan finished with errors. 60 ERROR = 2; 61 62 // The scan was terminated by user. 63 KILLED = 3; 64 } 65 66 // Output only. The resource name of the ScanRun. The name follows the format of 67 // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. 68 // The ScanRun IDs are generated by the system. 69 string name = 1; 70 71 // Output only. The execution state of the ScanRun. 72 ExecutionState execution_state = 2; 73 74 // Output only. The result state of the ScanRun. This field is only available after the 75 // execution state reaches "FINISHED". 76 ResultState result_state = 3; 77 78 // Output only. The time at which the ScanRun started. 79 google.protobuf.Timestamp start_time = 4; 80 81 // Output only. The time at which the ScanRun reached termination state - that the ScanRun 82 // is either finished or stopped by user. 83 google.protobuf.Timestamp end_time = 5; 84 85 // Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, 86 // the value represents the number of URLs crawled up to now. 87 int64 urls_crawled_count = 6; 88 89 // Output only. The number of URLs tested during this ScanRun. If the scan is in progress, 90 // the value represents the number of URLs tested up to now. The number of 91 // URLs tested is usually larger than the number URLS crawled because 92 // typically a crawled URL is tested with multiple test payloads. 93 int64 urls_tested_count = 7; 94 95 // Output only. Whether the scan run has found any vulnerabilities. 96 bool has_vulnerabilities = 8; 97 98 // Output only. The percentage of total completion ranging from 0 to 100. 99 // If the scan is in queue, the value is 0. 100 // If the scan is running, the value ranges from 0 to 100. 101 // If the scan is finished, the value is 100. 102 int32 progress_percent = 9; 103 104 // Output only. If result_state is an ERROR, this field provides the primary reason for 105 // scan's termination and more details, if such are available. 106 ScanRunErrorTrace error_trace = 10; 107 108 // Output only. A list of warnings, if such are encountered during this scan run. 109 repeated ScanRunWarningTrace warning_traces = 11; 110} 111