web_security_scanner.proto 14 KB

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