1// Copyright 2019 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// 15 16syntax = "proto3"; 17 18package google.cloud.websecurityscanner.v1beta; 19 20import "google/api/resource.proto"; 21import "google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto"; 22import "google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; 26option go_package = "cloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb"; 27option java_multiple_files = true; 28option java_outer_classname = "ScanRunProto"; 29option java_package = "com.google.cloud.websecurityscanner.v1beta"; 30option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; 31option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; 32 33// A ScanRun is a output-only resource representing an actual run of the scan. 34// Next id: 12 35message ScanRun { 36 option (google.api.resource) = { 37 type: "websecurityscanner.googleapis.com/ScanRun" 38 pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" 39 }; 40 41 // Types of ScanRun execution state. 42 enum ExecutionState { 43 // Represents an invalid state caused by internal server error. This value 44 // should never be returned. 45 EXECUTION_STATE_UNSPECIFIED = 0; 46 47 // The scan is waiting in the queue. 48 QUEUED = 1; 49 50 // The scan is in progress. 51 SCANNING = 2; 52 53 // The scan is either finished or stopped by user. 54 FINISHED = 3; 55 } 56 57 // Types of ScanRun result state. 58 enum ResultState { 59 // Default value. This value is returned when the ScanRun is not yet 60 // finished. 61 RESULT_STATE_UNSPECIFIED = 0; 62 63 // The scan finished without errors. 64 SUCCESS = 1; 65 66 // The scan finished with errors. 67 ERROR = 2; 68 69 // The scan was terminated by user. 70 KILLED = 3; 71 } 72 73 // The resource name of the ScanRun. The name follows the format of 74 // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. 75 // The ScanRun IDs are generated by the system. 76 string name = 1; 77 78 // The execution state of the ScanRun. 79 ExecutionState execution_state = 2; 80 81 // The result state of the ScanRun. This field is only available after the 82 // execution state reaches "FINISHED". 83 ResultState result_state = 3; 84 85 // The time at which the ScanRun started. 86 google.protobuf.Timestamp start_time = 4; 87 88 // The time at which the ScanRun reached termination state - that the ScanRun 89 // is either finished or stopped by user. 90 google.protobuf.Timestamp end_time = 5; 91 92 // The number of URLs crawled during this ScanRun. If the scan is in progress, 93 // the value represents the number of URLs crawled up to now. 94 int64 urls_crawled_count = 6; 95 96 // The number of URLs tested during this ScanRun. If the scan is in progress, 97 // the value represents the number of URLs tested up to now. The number of 98 // URLs tested is usually larger than the number URLS crawled because 99 // typically a crawled URL is tested with multiple test payloads. 100 int64 urls_tested_count = 7; 101 102 // Whether the scan run has found any vulnerabilities. 103 bool has_vulnerabilities = 8; 104 105 // The percentage of total completion ranging from 0 to 100. 106 // If the scan is in queue, the value is 0. 107 // If the scan is running, the value ranges from 0 to 100. 108 // If the scan is finished, the value is 100. 109 int32 progress_percent = 9; 110 111 // If result_state is an ERROR, this field provides the primary reason for 112 // scan's termination and more details, if such are available. 113 ScanRunErrorTrace error_trace = 10; 114 115 // A list of warnings, if such are encountered during this scan run. 116 repeated ScanRunWarningTrace warning_traces = 11; 117} 118