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