web_security_scanner.proto 15 KB

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