xref: /aosp_15_r20/external/googleapis/google/cloud/websecurityscanner/v1/web_security_scanner.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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/api/annotations.proto";
20import "google/api/client.proto";
21import "google/cloud/websecurityscanner/v1/crawled_url.proto";
22import "google/cloud/websecurityscanner/v1/finding.proto";
23import "google/cloud/websecurityscanner/v1/finding_type_stats.proto";
24import "google/cloud/websecurityscanner/v1/scan_config.proto";
25import "google/cloud/websecurityscanner/v1/scan_run.proto";
26import "google/protobuf/empty.proto";
27import "google/protobuf/field_mask.proto";
28
29option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1";
30option go_package = "cloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb";
31option java_multiple_files = true;
32option java_outer_classname = "WebSecurityScannerProto";
33option java_package = "com.google.cloud.websecurityscanner.v1";
34option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1";
35option ruby_package = "Google::Cloud::WebSecurityScanner::V1";
36
37// Web Security Scanner Service identifies security vulnerabilities in web
38// applications hosted on Google Cloud. It crawls your application, and
39// attempts to exercise as many user inputs and event handlers as possible.
40service WebSecurityScanner {
41  option (google.api.default_host) = "websecurityscanner.googleapis.com";
42  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
43
44  // Creates a new ScanConfig.
45  rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) {
46    option (google.api.http) = {
47      post: "/v1/{parent=projects/*}/scanConfigs"
48      body: "scan_config"
49    };
50  }
51
52  // Deletes an existing ScanConfig and its child resources.
53  rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) {
54    option (google.api.http) = {
55      delete: "/v1/{name=projects/*/scanConfigs/*}"
56    };
57  }
58
59  // Gets a ScanConfig.
60  rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) {
61    option (google.api.http) = {
62      get: "/v1/{name=projects/*/scanConfigs/*}"
63    };
64  }
65
66  // Lists ScanConfigs under a given project.
67  rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) {
68    option (google.api.http) = {
69      get: "/v1/{parent=projects/*}/scanConfigs"
70    };
71  }
72
73  // Updates a ScanConfig. This method support partial update of a ScanConfig.
74  rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) {
75    option (google.api.http) = {
76      patch: "/v1/{scan_config.name=projects/*/scanConfigs/*}"
77      body: "scan_config"
78    };
79  }
80
81  // Start a ScanRun according to the given ScanConfig.
82  rpc StartScanRun(StartScanRunRequest) returns (ScanRun) {
83    option (google.api.http) = {
84      post: "/v1/{name=projects/*/scanConfigs/*}:start"
85      body: "*"
86    };
87  }
88
89  // Gets a ScanRun.
90  rpc GetScanRun(GetScanRunRequest) returns (ScanRun) {
91    option (google.api.http) = {
92      get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}"
93    };
94  }
95
96  // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
97  // stop time.
98  rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) {
99    option (google.api.http) = {
100      get: "/v1/{parent=projects/*/scanConfigs/*}/scanRuns"
101    };
102  }
103
104  // Stops a ScanRun. The stopped ScanRun is returned.
105  rpc StopScanRun(StopScanRunRequest) returns (ScanRun) {
106    option (google.api.http) = {
107      post: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop"
108      body: "*"
109    };
110  }
111
112  // List CrawledUrls under a given ScanRun.
113  rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) {
114    option (google.api.http) = {
115      get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls"
116    };
117  }
118
119  // Gets a Finding.
120  rpc GetFinding(GetFindingRequest) returns (Finding) {
121    option (google.api.http) = {
122      get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}"
123    };
124  }
125
126  // List Findings under a given ScanRun.
127  rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) {
128    option (google.api.http) = {
129      get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings"
130    };
131  }
132
133  // List all FindingTypeStats under a given ScanRun.
134  rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) {
135    option (google.api.http) = {
136      get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats"
137    };
138  }
139}
140
141// Request for the `CreateScanConfig` method.
142message CreateScanConfigRequest {
143  // Required. The parent resource name where the scan is created, which should be a
144  // project resource name in the format 'projects/{projectId}'.
145  string parent = 1;
146
147  // Required. The ScanConfig to be created.
148  ScanConfig scan_config = 2;
149}
150
151// Request for the `DeleteScanConfig` method.
152message DeleteScanConfigRequest {
153  // Required. The resource name of the ScanConfig to be deleted. The name follows the
154  // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
155  string name = 1;
156}
157
158// Request for the `GetScanConfig` method.
159message GetScanConfigRequest {
160  // Required. The resource name of the ScanConfig to be returned. The name follows the
161  // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
162  string name = 1;
163}
164
165// Request for the `ListScanConfigs` method.
166message ListScanConfigsRequest {
167  // Required. The parent resource name, which should be a project resource name in the
168  // format 'projects/{projectId}'.
169  string parent = 1;
170
171  // A token identifying a page of results to be returned. This should be a
172  // `next_page_token` value returned from a previous List request.
173  // If unspecified, the first page of results is returned.
174  string page_token = 2;
175
176  // The maximum number of ScanConfigs to return, can be limited by server.
177  // If not specified or not positive, the implementation will select a
178  // reasonable value.
179  int32 page_size = 3;
180}
181
182// Request for the `UpdateScanConfigRequest` method.
183message UpdateScanConfigRequest {
184  // Required. The ScanConfig to be updated. The name field must be set to identify the
185  // resource to be updated. The values of fields not covered by the mask
186  // will be ignored.
187  ScanConfig scan_config = 2;
188
189  // Required. The update mask applies to the resource. For the `FieldMask` definition,
190  // see
191  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
192  google.protobuf.FieldMask update_mask = 3;
193}
194
195// Response for the `ListScanConfigs` method.
196message ListScanConfigsResponse {
197  // The list of ScanConfigs returned.
198  repeated ScanConfig scan_configs = 1;
199
200  // Token to retrieve the next page of results, or empty if there are no
201  // more results in the list.
202  string next_page_token = 2;
203}
204
205// Request for the `StartScanRun` method.
206message StartScanRunRequest {
207  // Required. The resource name of the ScanConfig to be used. The name follows the
208  // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
209  string name = 1;
210}
211
212// Request for the `GetScanRun` method.
213message GetScanRunRequest {
214  // Required. The resource name of the ScanRun to be returned. The name follows the
215  // format of
216  // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
217  string name = 1;
218}
219
220// Request for the `ListScanRuns` method.
221message ListScanRunsRequest {
222  // Required. The parent resource name, which should be a scan resource name in the
223  // format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
224  string parent = 1;
225
226  // A token identifying a page of results to be returned. This should be a
227  // `next_page_token` value returned from a previous List request.
228  // If unspecified, the first page of results is returned.
229  string page_token = 2;
230
231  // The maximum number of ScanRuns to return, can be limited by server.
232  // If not specified or not positive, the implementation will select a
233  // reasonable value.
234  int32 page_size = 3;
235}
236
237// Response for the `ListScanRuns` method.
238message ListScanRunsResponse {
239  // The list of ScanRuns returned.
240  repeated ScanRun scan_runs = 1;
241
242  // Token to retrieve the next page of results, or empty if there are no
243  // more results in the list.
244  string next_page_token = 2;
245}
246
247// Request for the `StopScanRun` method.
248message StopScanRunRequest {
249  // Required. The resource name of the ScanRun to be stopped. The name follows the
250  // format of
251  // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
252  string name = 1;
253}
254
255// Request for the `ListCrawledUrls` method.
256message ListCrawledUrlsRequest {
257  // Required. The parent resource name, which should be a scan run resource name in the
258  // format
259  // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
260  string parent = 1;
261
262  // A token identifying a page of results to be returned. This should be a
263  // `next_page_token` value returned from a previous List request.
264  // If unspecified, the first page of results is returned.
265  string page_token = 2;
266
267  // The maximum number of CrawledUrls to return, can be limited by server.
268  // If not specified or not positive, the implementation will select a
269  // reasonable value.
270  int32 page_size = 3;
271}
272
273// Response for the `ListCrawledUrls` method.
274message ListCrawledUrlsResponse {
275  // The list of CrawledUrls returned.
276  repeated CrawledUrl crawled_urls = 1;
277
278  // Token to retrieve the next page of results, or empty if there are no
279  // more results in the list.
280  string next_page_token = 2;
281}
282
283// Request for the `GetFinding` method.
284message GetFindingRequest {
285  // Required. The resource name of the Finding to be returned. The name follows the
286  // format of
287  // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
288  string name = 1;
289}
290
291// Request for the `ListFindings` method.
292message ListFindingsRequest {
293  // Required. The parent resource name, which should be a scan run resource name in the
294  // format
295  // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
296  string parent = 1;
297
298  // The filter expression. The expression must be in the format: <field>
299  // <operator> <value>.
300  // Supported field: 'finding_type'.
301  // Supported operator: '='.
302  string filter = 2;
303
304  // A token identifying a page of results to be returned. This should be a
305  // `next_page_token` value returned from a previous List request.
306  // If unspecified, the first page of results is returned.
307  string page_token = 3;
308
309  // The maximum number of Findings to return, can be limited by server.
310  // If not specified or not positive, the implementation will select a
311  // reasonable value.
312  int32 page_size = 4;
313}
314
315// Response for the `ListFindings` method.
316message ListFindingsResponse {
317  // The list of Findings returned.
318  repeated Finding findings = 1;
319
320  // Token to retrieve the next page of results, or empty if there are no
321  // more results in the list.
322  string next_page_token = 2;
323}
324
325// Request for the `ListFindingTypeStats` method.
326message ListFindingTypeStatsRequest {
327  // Required. The parent resource name, which should be a scan run resource name in the
328  // format
329  // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
330  string parent = 1;
331}
332
333// Response for the `ListFindingTypeStats` method.
334message ListFindingTypeStatsResponse {
335  // The list of FindingTypeStats returned.
336  repeated FindingTypeStats finding_type_stats = 1;
337}
338